Refine call native function from AOT code (#1015)

When calling native function from AOT code, current implementation is to return
back to runtime to call aot_invoke_native, which calls wasm_runtime_invoke_native
and the latter calls assembly code. We did it before as there may be pointer and
string arguments to check and convert if the native function's registered signature
has character '*' and '$'.
As the built-in native function's signatures can be gotten in compilation time, we
check the pointer/string arguments and convert them into native address in AOT
code, and then invoke the native function directly, so as to improve performance.
This commit is contained in:
Wenyong Huang
2022-02-23 14:58:32 +08:00
committed by GitHub
parent 44d75cec3c
commit 25fc006c33
5 changed files with 267 additions and 14 deletions

View File

@ -113,6 +113,7 @@ typedef struct {
REG_SYM(aot_call_indirect), \
REG_SYM(aot_enlarge_memory), \
REG_SYM(aot_set_exception), \
REG_SYM(aot_check_app_addr_and_convert),\
{ "memset", (void*)aot_memset }, \
{ "memmove", (void*)aot_memmove }, \
{ "memcpy", (void*)aot_memmove }, \