Remove unused argument in wasm_runtime_lookup_function and refactor WASMModuleInstance (#3218)

Remove the unused parameter `signature` from `wasm_runtime_lookup_function`.

Refactor the layout of WASMModuleInstance structure:
- move common data members `c_api_func_imports` and `cur_exec_env` from
  `WASMModuleInstanceExtraCommon` to `WASMModuleInstance`
- In `WASMModuleInstance`, enlarge `reserved[3]` to `reserved[5]` in case that
  we need to add more fields in the future

ps.
https://github.com/bytecodealliance/wasm-micro-runtime/issues/2530
https://github.com/bytecodealliance/wasm-micro-runtime/issues/3202
This commit is contained in:
TianlongLiang
2024-03-13 12:28:45 +08:00
committed by GitHub
parent ce44e0ec0c
commit c3e33a96ea
28 changed files with 100 additions and 136 deletions

View File

@ -1853,17 +1853,17 @@ wasm_runtime_get_function_type(const WASMFunctionInstanceCommon *function,
WASMFunctionInstanceCommon *
wasm_runtime_lookup_function(WASMModuleInstanceCommon *const module_inst,
const char *name, const char *signature)
const char *name)
{
#if WASM_ENABLE_INTERP != 0
if (module_inst->module_type == Wasm_Module_Bytecode)
return (WASMFunctionInstanceCommon *)wasm_lookup_function(
(const WASMModuleInstance *)module_inst, name, signature);
(const WASMModuleInstance *)module_inst, name);
#endif
#if WASM_ENABLE_AOT != 0
if (module_inst->module_type == Wasm_Module_AoT)
return (WASMFunctionInstanceCommon *)aot_lookup_function(
(const AOTModuleInstance *)module_inst, name, signature);
(const AOTModuleInstance *)module_inst, name);
#endif
return NULL;
}