Introduce WASMModuleInstanceExtraCommon (#2429)
Move the common parts of WASMModuleInstanceExtra and AOTModuleInstanceExtra into the new structure.
This commit is contained in:
@ -4858,7 +4858,7 @@ wasm_instance_new_with_args(wasm_store_t *store, const wasm_module_t *module,
|
||||
if (instance->inst_comm_rt->module_type == Wasm_Module_Bytecode) {
|
||||
WASMModuleInstanceExtra *e =
|
||||
((WASMModuleInstance *)instance->inst_comm_rt)->e;
|
||||
p_func_imports = &(e->c_api_func_imports);
|
||||
p_func_imports = &(e->common.c_api_func_imports);
|
||||
import_func_count = MODULE_INTERP(module)->import_function_count;
|
||||
}
|
||||
#endif
|
||||
@ -4868,7 +4868,7 @@ wasm_instance_new_with_args(wasm_store_t *store, const wasm_module_t *module,
|
||||
(AOTModuleInstanceExtra *)((AOTModuleInstance *)
|
||||
instance->inst_comm_rt)
|
||||
->e;
|
||||
p_func_imports = &(e->c_api_func_imports);
|
||||
p_func_imports = &(e->common.c_api_func_imports);
|
||||
import_func_count = MODULE_AOT(module)->import_func_count;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2491,14 +2491,14 @@ wasm_runtime_set_bounds_checks(WASMModuleInstanceCommon *module_inst,
|
||||
#if WASM_ENABLE_INTERP != 0
|
||||
if (module_inst->module_type == Wasm_Module_Bytecode) {
|
||||
((WASMModuleInstanceExtra *)((WASMModuleInstance *)module_inst)->e)
|
||||
->disable_bounds_checks = enable ? false : true;
|
||||
->common.disable_bounds_checks = enable ? false : true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if WASM_ENABLE_AOT != 0
|
||||
if (module_inst->module_type == Wasm_Module_AoT) {
|
||||
((AOTModuleInstanceExtra *)((AOTModuleInstance *)module_inst)->e)
|
||||
->disable_bounds_checks = enable ? false : true;
|
||||
->common.disable_bounds_checks = enable ? false : true;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -2511,7 +2511,7 @@ wasm_runtime_is_bounds_checks_enabled(WASMModuleInstanceCommon *module_inst)
|
||||
if (module_inst->module_type == Wasm_Module_Bytecode) {
|
||||
return !((WASMModuleInstanceExtra *)((WASMModuleInstance *)module_inst)
|
||||
->e)
|
||||
->disable_bounds_checks;
|
||||
->common.disable_bounds_checks;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2519,7 +2519,7 @@ wasm_runtime_is_bounds_checks_enabled(WASMModuleInstanceCommon *module_inst)
|
||||
if (module_inst->module_type == Wasm_Module_AoT) {
|
||||
return !((AOTModuleInstanceExtra *)((WASMModuleInstance *)module_inst)
|
||||
->e)
|
||||
->disable_bounds_checks;
|
||||
->common.disable_bounds_checks;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user