Refine looking up aot function with index (#3882)
* Refine looking up aot function with index * refine the code
This commit is contained in:
@ -3383,21 +3383,8 @@ wasm_func_call(const wasm_func_t *func, const wasm_val_vec_t *params,
|
||||
if (!(func_comm_rt = func->func_comm_rt)) {
|
||||
AOTModuleInstance *inst_aot =
|
||||
(AOTModuleInstance *)func->inst_comm_rt;
|
||||
AOTModule *module_aot = (AOTModule *)inst_aot->module;
|
||||
uint32 export_i = 0, export_func_j = 0;
|
||||
|
||||
for (; export_i < module_aot->export_count; ++export_i) {
|
||||
AOTExport *export = module_aot->exports + export_i;
|
||||
if (export->kind == EXPORT_KIND_FUNC) {
|
||||
if (export->index == func->func_idx_rt) {
|
||||
func_comm_rt =
|
||||
aot_lookup_function(inst_aot, export->name);
|
||||
((wasm_func_t *)func)->func_comm_rt = func_comm_rt;
|
||||
break;
|
||||
}
|
||||
export_func_j++;
|
||||
}
|
||||
}
|
||||
func_comm_rt = ((wasm_func_t *)func)->func_comm_rt =
|
||||
aot_lookup_function_with_idx(inst_aot, func->func_idx_rt);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1579,8 +1579,7 @@ wasm_runtime_get_memory(WASMModuleInstanceCommon *module_inst, uint32 index)
|
||||
|
||||
#if WASM_ENABLE_AOT != 0
|
||||
if (module_inst->module_type == Wasm_Module_AoT)
|
||||
return aot_get_memory_with_index((AOTModuleInstance *)module_inst,
|
||||
index);
|
||||
return aot_get_memory_with_idx((AOTModuleInstance *)module_inst, index);
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user