Refine AOT/JIT code call wasm-c-api import process (#2982)

Allow to invoke the quick call entry wasm_runtime_quick_invoke_c_api_import to
call the wasm-c-api import functions to speedup the calling process, which reduces
the data copying.

Use `wamrc --invoke-c-api-import` to generate the optimized AOT code, and set
`jit_options->quick_invoke_c_api_import` true in wasm_engine_new when LLVM JIT
is enabled.
This commit is contained in:
Wenyong Huang
2024-01-10 18:37:02 +08:00
committed by GitHub
parent 7c7684819d
commit b21f17dd6d
20 changed files with 393 additions and 35 deletions

View File

@ -46,6 +46,18 @@ get_tbl_inst_offset(const AOTCompContext *comp_ctx,
return offset;
}
uint32
get_module_inst_extra_offset(AOTCompContext *comp_ctx)
{
const AOTCompData *comp_data = comp_ctx->comp_data;
uint32 table_count = comp_data->import_table_count + comp_data->table_count;
uint64 offset = get_tbl_inst_offset(comp_ctx, NULL, table_count);
uint32 offset_32 = (uint32)offset;
bh_assert(offset <= UINT32_MAX);
offset_32 = align_uint(offset_32, 8);
return offset_32;
}
#if WASM_ENABLE_REF_TYPES != 0
LLVMValueRef