Avoid initialize LLVM repeatedly (#1671)

Currently we initialize and destroy LLVM environment in aot_create_comp_context
and aot_destroy_comp_context, which are called in wasm_module_load/unload,
and the latter may be invoked multiple times, which leads to duplicated LLVM
initialization/destroy and may result in unexpected behaviors.

Move the LLVM init/destroy into runtime init/destroy to resolve the issue.
This commit is contained in:
Wenyong Huang
2022-11-02 16:13:58 +08:00
committed by GitHub
parent f1f6f4a125
commit 5b144c491d
5 changed files with 68 additions and 11 deletions

View File

@ -1642,9 +1642,11 @@ wasm_trap_new_internal(wasm_store_t *store,
const char *error_info)
{
wasm_trap_t *trap;
#if WASM_ENABLE_DUMP_CALL_STACK != 0
wasm_instance_vec_t *instances;
wasm_instance_t *frame_instance = NULL;
uint32 i;
#endif
if (!singleton_engine || !singleton_engine->stores
|| !singleton_engine->stores->num_elems) {