@@ -47,15 +47,15 @@ bh_static_assert(offsetof(AOTModuleInstance, func_type_indexes)
47
47
== 6 * sizeof (uint64 ));
48
48
bh_static_assert (offsetof(AOTModuleInstance , cur_exception )
49
49
== 13 * sizeof (uint64 ));
50
+ bh_static_assert (offsetof(AOTModuleInstance , c_api_func_imports )
51
+ == 13 * sizeof (uint64 ) + 128 + 8 * sizeof (uint64 ));
50
52
bh_static_assert (offsetof(AOTModuleInstance , global_table_data )
51
- == 13 * sizeof (uint64 ) + 128 + 11 * sizeof (uint64 ));
53
+ == 13 * sizeof (uint64 ) + 128 + 14 * sizeof (uint64 ));
52
54
53
55
bh_static_assert (sizeof (AOTMemoryInstance ) == 112 );
54
56
bh_static_assert (offsetof(AOTTableInstance , elems ) == 24 );
55
57
56
58
bh_static_assert (offsetof(AOTModuleInstanceExtra , stack_sizes ) == 0 );
57
- bh_static_assert (offsetof (AOTModuleInstanceExtra , common .c_api_func_imports )
58
- == sizeof (uint64 ));
59
59
60
60
bh_static_assert (sizeof (CApiFuncImport ) == sizeof (uintptr_t ) * 3 );
61
61
@@ -1273,7 +1273,7 @@ lookup_post_instantiate_func(AOTModuleInstance *module_inst,
1273
1273
AOTFunctionInstance * func ;
1274
1274
AOTFuncType * func_type ;
1275
1275
1276
- if (!(func = aot_lookup_function (module_inst , func_name , NULL )))
1276
+ if (!(func = aot_lookup_function (module_inst , func_name )))
1277
1277
/* Not found */
1278
1278
return NULL ;
1279
1279
@@ -1908,9 +1908,8 @@ aot_deinstantiate(AOTModuleInstance *module_inst, bool is_sub_inst)
1908
1908
if (module_inst -> func_type_indexes )
1909
1909
wasm_runtime_free (module_inst -> func_type_indexes );
1910
1910
1911
- if (common -> c_api_func_imports )
1912
- wasm_runtime_free (((AOTModuleInstanceExtra * )module_inst -> e )
1913
- -> common .c_api_func_imports );
1911
+ if (module_inst -> c_api_func_imports )
1912
+ wasm_runtime_free (module_inst -> c_api_func_imports );
1914
1913
1915
1914
#if WASM_ENABLE_GC != 0
1916
1915
if (!is_sub_inst ) {
@@ -1941,8 +1940,7 @@ aot_deinstantiate(AOTModuleInstance *module_inst, bool is_sub_inst)
1941
1940
}
1942
1941
1943
1942
AOTFunctionInstance *
1944
- aot_lookup_function (const AOTModuleInstance * module_inst , const char * name ,
1945
- const char * signature )
1943
+ aot_lookup_function (const AOTModuleInstance * module_inst , const char * name )
1946
1944
{
1947
1945
uint32 i ;
1948
1946
AOTFunctionInstance * export_funcs =
@@ -1951,7 +1949,6 @@ aot_lookup_function(const AOTModuleInstance *module_inst, const char *name,
1951
1949
for (i = 0 ; i < module_inst -> export_func_count ; i ++ )
1952
1950
if (!strcmp (export_funcs [i ].func_name , name ))
1953
1951
return & export_funcs [i ];
1954
- (void )signature ;
1955
1952
return NULL ;
1956
1953
}
1957
1954
@@ -2157,8 +2154,8 @@ aot_call_function(WASMExecEnv *exec_env, AOTFunctionInstance *function,
2157
2154
hw bound check is enabled */
2158
2155
#endif
2159
2156
2160
- /* Set exec env so it can be later retrieved from instance */
2161
- (( AOTModuleInstanceExtra * ) module_inst -> e ) -> common . cur_exec_env = exec_env ;
2157
+ /* Set exec env, so it can be later retrieved from instance */
2158
+ module_inst -> cur_exec_env = exec_env ;
2162
2159
2163
2160
if (ext_ret_count > 0 ) {
2164
2161
uint32 cell_num = 0 , i ;
@@ -2497,22 +2494,18 @@ aot_module_malloc_internal(AOTModuleInstance *module_inst,
2497
2494
&& module -> free_func_index != (uint32 )- 1 ) {
2498
2495
AOTFunctionInstance * malloc_func , * retain_func = NULL ;
2499
2496
char * malloc_func_name ;
2500
- char * malloc_func_sig ;
2501
2497
2502
2498
if (module -> retain_func_index != (uint32 )- 1 ) {
2503
2499
malloc_func_name = "__new" ;
2504
- malloc_func_sig = "(ii)i" ;
2505
- retain_func = aot_lookup_function (module_inst , "__retain" , "(i)i" );
2500
+ retain_func = aot_lookup_function (module_inst , "__retain" );
2506
2501
if (!retain_func )
2507
- retain_func = aot_lookup_function (module_inst , "__pin" , "(i)i" );
2502
+ retain_func = aot_lookup_function (module_inst , "__pin" );
2508
2503
bh_assert (retain_func );
2509
2504
}
2510
2505
else {
2511
2506
malloc_func_name = "malloc" ;
2512
- malloc_func_sig = "(i)i" ;
2513
2507
}
2514
- malloc_func =
2515
- aot_lookup_function (module_inst , malloc_func_name , malloc_func_sig );
2508
+ malloc_func = aot_lookup_function (module_inst , malloc_func_name );
2516
2509
2517
2510
if (!malloc_func
2518
2511
|| !execute_malloc_function (module_inst , exec_env , malloc_func ,
@@ -2621,10 +2614,9 @@ aot_module_free_internal(AOTModuleInstance *module_inst, WASMExecEnv *exec_env,
2621
2614
else {
2622
2615
free_func_name = "free" ;
2623
2616
}
2624
- free_func =
2625
- aot_lookup_function (module_inst , free_func_name , "(i)i" );
2617
+ free_func = aot_lookup_function (module_inst , free_func_name );
2626
2618
if (!free_func && module -> retain_func_index != (uint32 )- 1 )
2627
- free_func = aot_lookup_function (module_inst , "__unpin" , "(i)i" );
2619
+ free_func = aot_lookup_function (module_inst , "__unpin" );
2628
2620
2629
2621
if (free_func )
2630
2622
execute_free_function (module_inst , exec_env , free_func ,
@@ -2687,11 +2679,9 @@ aot_invoke_native(WASMExecEnv *exec_env, uint32 func_idx, uint32 argc,
2687
2679
AOTModuleInstance * module_inst =
2688
2680
(AOTModuleInstance * )wasm_runtime_get_module_inst (exec_env );
2689
2681
AOTModule * aot_module = (AOTModule * )module_inst -> module ;
2690
- AOTModuleInstanceExtra * module_inst_extra =
2691
- (AOTModuleInstanceExtra * )module_inst -> e ;
2692
2682
CApiFuncImport * c_api_func_import =
2693
- module_inst_extra -> common . c_api_func_imports
2694
- ? module_inst_extra -> common . c_api_func_imports + func_idx
2683
+ module_inst -> c_api_func_imports
2684
+ ? module_inst -> c_api_func_imports + func_idx
2695
2685
: NULL ;
2696
2686
uint32 * func_type_indexes = module_inst -> func_type_indexes ;
2697
2687
uint32 func_type_idx = func_type_indexes [func_idx ];
0 commit comments