Revert "Implement call Fast JIT function from LLVM JIT jitted code" (#1737)
Reverts bytecodealliance/wasm-micro-runtime#1714, which was merged mistakenly.
This commit is contained in:
@ -309,8 +309,6 @@ aot_get_imp_tbl_data_slots(const AOTImportTable *tbl, bool is_jit_mode)
|
||||
#if WASM_ENABLE_MULTI_MODULE != 0
|
||||
if (is_jit_mode)
|
||||
return tbl->table_max_size;
|
||||
#else
|
||||
(void)is_jit_mode;
|
||||
#endif
|
||||
return tbl->possible_grow ? tbl->table_max_size : tbl->table_init_size;
|
||||
}
|
||||
@ -321,8 +319,6 @@ aot_get_tbl_data_slots(const AOTTable *tbl, bool is_jit_mode)
|
||||
#if WASM_ENABLE_MULTI_MODULE != 0
|
||||
if (is_jit_mode)
|
||||
return tbl->table_max_size;
|
||||
#else
|
||||
(void)is_jit_mode;
|
||||
#endif
|
||||
return tbl->possible_grow ? tbl->table_max_size : tbl->table_init_size;
|
||||
}
|
||||
|
||||
@ -789,53 +789,7 @@ aot_compile_op_call(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
|
||||
func = func_ctx->func;
|
||||
}
|
||||
else {
|
||||
if (!comp_ctx->is_jit_mode) {
|
||||
func = func_ctxes[func_idx - import_func_count]->func;
|
||||
}
|
||||
else {
|
||||
#if !(WASM_ENABLE_FAST_JIT != 0 && WASM_ENABLE_LAZY_JIT != 0)
|
||||
func = func_ctxes[func_idx - import_func_count]->func;
|
||||
#else
|
||||
/* JIT tier-up, load func ptr from func_ptrs[func_idx] */
|
||||
LLVMValueRef func_ptr, func_idx_const;
|
||||
LLVMTypeRef func_ptr_type;
|
||||
|
||||
if (!(func_idx_const = I32_CONST(func_idx))) {
|
||||
aot_set_last_error("llvm build const failed.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!(func_ptr = LLVMBuildInBoundsGEP2(
|
||||
comp_ctx->builder, OPQ_PTR_TYPE,
|
||||
func_ctx->func_ptrs, &func_idx_const, 1,
|
||||
"func_ptr_tmp"))) {
|
||||
aot_set_last_error("llvm build inbounds gep failed.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!(func_ptr =
|
||||
LLVMBuildLoad2(comp_ctx->builder, OPQ_PTR_TYPE,
|
||||
func_ptr, "func_ptr"))) {
|
||||
aot_set_last_error("llvm build load failed.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!(func_ptr_type = LLVMPointerType(
|
||||
func_ctxes[func_idx - import_func_count]
|
||||
->func_type,
|
||||
0))) {
|
||||
aot_set_last_error("construct func ptr type failed.");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!(func = LLVMBuildBitCast(comp_ctx->builder, func_ptr,
|
||||
func_ptr_type,
|
||||
"indirect_func"))) {
|
||||
aot_set_last_error("llvm build bit cast failed.");
|
||||
goto fail;
|
||||
}
|
||||
#endif /* end of !(WASM_ENABLE_FAST_JIT != 0 && WASM_ENABLE_LAZY_JIT != 0) */
|
||||
}
|
||||
func = func_ctxes[func_idx - import_func_count]->func;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user