Skip to content

Commit

Permalink
[instantiation linking] Create and import WASMGlobalInstance (#3914)
Browse files Browse the repository at this point in the history
  • Loading branch information
lum1n0us authored Dec 19, 2024
1 parent 23c8be1 commit b18cb3b
Show file tree
Hide file tree
Showing 23 changed files with 1,255 additions and 376 deletions.
10 changes: 8 additions & 2 deletions core/iwasm/aot/aot_loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -2144,9 +2144,11 @@ load_import_globals(const uint8 **p_buf, const uint8 *buf_end,
AOTImportGlobal *import_globals;
uint64 size;
uint32 i, data_offset = 0;
#if WASM_ENABLE_MULTI_MODULE != 0
#if WASM_ENABLE_LIBC_BUILTIN != 0
WASMGlobalImport tmp_global;
#endif
#endif /* WASM_ENABLE_MULTI_MODULE != 0 */

/* Allocate memory */
size = sizeof(AOTImportGlobal) * (uint64)module->import_global_count;
Expand All @@ -2167,6 +2169,7 @@ load_import_globals(const uint8 **p_buf, const uint8 *buf_end,
return false;
}

#if WASM_ENABLE_MULTI_MODULE != 0
#if WASM_ENABLE_LIBC_BUILTIN != 0
if (wasm_native_lookup_libc_builtin_global(
import_globals[i].module_name, import_globals[i].global_name,
Expand All @@ -2182,9 +2185,12 @@ load_import_globals(const uint8 **p_buf, const uint8 *buf_end,
tmp_global.global_data_linked;
import_globals[i].is_linked = true;
}
#else
import_globals[i].is_linked = false;
else
#endif
#endif /* WASM_ENABLE_MULTI_MODULE != 0 */
{
import_globals[i].is_linked = false;
}

import_globals[i].size =
wasm_value_type_size(import_globals[i].type.val_type);
Expand Down
Loading

0 comments on commit b18cb3b

Please sign in to comment.