Enable call wasm-c-api native func directly from interpreter (#656)

And update loader error messages for latest spec cases, fix aot compiler build error based on latest LLVM code base.
This commit is contained in:
Wenyong Huang
2021-06-28 11:59:49 +08:00
committed by GitHub
parent c6783ef258
commit cba4c78273
13 changed files with 249 additions and 364 deletions

View File

@ -826,7 +826,18 @@ wasm_interp_call_func_native(WASMModuleInstance *module_inst,
return;
}
if (!func_import->call_conv_raw) {
if (func_import->call_conv_wasm_c_api) {
ret = wasm_runtime_invoke_c_api_native(
(WASMModuleInstanceCommon *)module_inst,
func_import->func_ptr_linked, func_import->func_type,
cur_func->param_cell_num, frame->lp,
func_import->wasm_c_api_with_env, func_import->attachment);
if (ret) {
argv_ret[0] = frame->lp[0];
argv_ret[1] = frame->lp[1];
}
}
else if (!func_import->call_conv_raw) {
ret = wasm_runtime_invoke_native(exec_env, func_import->func_ptr_linked,
func_import->func_type, func_import->signature,
func_import->attachment,