Refine wasm/aot function instance lookup (#3865)

Sort the module instance's export functions with the function name,
and use binary search to lookup the wasm/aot function.
This commit is contained in:
Wenyong Huang
2024-10-18 15:15:33 +08:00
committed by GitHub
parent 74d2427fdc
commit 48eaa2286a
4 changed files with 57 additions and 37 deletions

View File

@ -3391,8 +3391,7 @@ wasm_func_call(const wasm_func_t *func, const wasm_val_vec_t *params,
if (export->kind == EXPORT_KIND_FUNC) {
if (export->index == func->func_idx_rt) {
func_comm_rt =
(AOTFunctionInstance *)inst_aot->export_functions
+ export_func_j;
aot_lookup_function(inst_aot, export->name);
((wasm_func_t *)func)->func_comm_rt = func_comm_rt;
break;
}