Skip to content

Commit 5844737

Browse files
Merge branch 'main' into dev/extended_const
2 parents b6033c3 + be33a40 commit 5844737

39 files changed

Lines changed: 2813 additions & 658 deletions

core/iwasm/aot/aot_reloc.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,13 @@ typedef struct {
185185
#define REG_STRINGREF_SYM()
186186
#endif
187187

188+
#if WASM_ENABLE_SHARED_HEAP != 0
189+
#define REG_SHARED_HEAP_SYM() \
190+
REG_SYM(wasm_runtime_check_and_update_last_used_shared_heap),
191+
#else
192+
#define REG_SHARED_HEAP_SYM()
193+
#endif
194+
188195
#define REG_COMMON_SYMBOLS \
189196
REG_SYM(aot_set_exception_with_id), \
190197
REG_SYM(aot_invoke_native), \
@@ -218,6 +225,7 @@ typedef struct {
218225
REG_LLVM_PGO_SYM() \
219226
REG_GC_SYM() \
220227
REG_STRINGREF_SYM() \
228+
REG_SHARED_HEAP_SYM() \
221229

222230
#define CHECK_RELOC_OFFSET(data_size) do { \
223231
if (!check_reloc_offset(target_section_size, \

core/iwasm/aot/aot_runtime.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@ bh_static_assert(offsetof(AOTModuleInstanceExtra, stack_sizes) == 0);
6060
bh_static_assert(offsetof(AOTModuleInstanceExtra, shared_heap_base_addr_adj)
6161
== 8);
6262
bh_static_assert(offsetof(AOTModuleInstanceExtra, shared_heap_start_off) == 16);
63+
bh_static_assert(offsetof(AOTModuleInstanceExtra, shared_heap_end_off) == 24);
64+
bh_static_assert(offsetof(AOTModuleInstanceExtra, shared_heap) == 32);
65+
66+
bh_static_assert(offsetof(WASMSharedHeap, next) == 0);
67+
bh_static_assert(offsetof(WASMSharedHeap, chain_next) == 8);
68+
bh_static_assert(offsetof(WASMSharedHeap, heap_handle) == 16);
69+
bh_static_assert(offsetof(WASMSharedHeap, base_addr) == 24);
70+
bh_static_assert(offsetof(WASMSharedHeap, size) == 32);
71+
bh_static_assert(offsetof(WASMSharedHeap, start_off_mem64) == 40);
72+
bh_static_assert(offsetof(WASMSharedHeap, start_off_mem32) == 48);
6373

6474
bh_static_assert(sizeof(CApiFuncImport) == sizeof(uintptr_t) * 3);
6575

@@ -2090,6 +2100,8 @@ aot_instantiate(AOTModule *module, AOTModuleInstance *parent,
20902100
#else
20912101
extra->shared_heap_start_off.u32[0] = UINT32_MAX;
20922102
#endif
2103+
/* After shared heap chain, will early stop if shared heap is NULL */
2104+
extra->shared_heap = NULL;
20932105

20942106
#if WASM_ENABLE_PERF_PROFILING != 0
20952107
total_size = sizeof(AOTFuncPerfProfInfo)

core/iwasm/aot/aot_runtime.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ typedef struct AOTModuleInstanceExtra {
125125
*/
126126
DefPointer(uint8 *, shared_heap_base_addr_adj);
127127
MemBound shared_heap_start_off;
128+
MemBound shared_heap_end_off;
129+
DefPointer(WASMSharedHeap *, shared_heap);
128130

129131
WASMModuleInstanceExtraCommon common;
130132

@@ -142,9 +144,6 @@ typedef struct AOTModuleInstanceExtra {
142144
WASMModuleInstanceCommon **import_func_module_insts;
143145
#endif
144146

145-
#if WASM_ENABLE_SHARED_HEAP != 0
146-
WASMSharedHeap *shared_heap;
147-
#endif
148147
} AOTModuleInstanceExtra;
149148

150149
#if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64)

0 commit comments

Comments
 (0)