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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user