Skip to content

Commit fccb871

Browse files
committed
test
1 parent 56d45b5 commit fccb871

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

core/iwasm/interpreter/wasm_loader.c

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6800,29 +6800,36 @@ wasm_loader_unload(WASMModule *module)
68006800
{
68016801
uint32 i;
68026802

6803+
LOG_DEBUG("%s %d", __func__, __LINE__);
68036804
if (!module)
68046805
return;
68056806

6807+
LOG_DEBUG("%s %d", __func__, __LINE__);
68066808
#if WASM_ENABLE_FAST_JIT != 0 && WASM_ENABLE_JIT != 0 \
68076809
&& WASM_ENABLE_LAZY_JIT != 0
68086810
module->orcjit_stop_compiling = true;
68096811
if (module->llvm_jit_init_thread)
68106812
os_thread_join(module->llvm_jit_init_thread, NULL);
68116813
#endif
6814+
LOG_DEBUG("%s %d", __func__, __LINE__);
68126815

68136816
#if WASM_ENABLE_FAST_JIT != 0 || WASM_ENABLE_JIT != 0
68146817
/* Stop Fast/LLVM JIT compilation firstly to avoid accessing
68156818
module internal data after they were freed */
68166819
orcjit_stop_compile_threads(module);
68176820
#endif
6821+
LOG_DEBUG("%s %d", __func__, __LINE__);
68186822

68196823
#if WASM_ENABLE_JIT != 0
68206824
if (module->func_ptrs)
68216825
wasm_runtime_free(module->func_ptrs);
6826+
LOG_DEBUG("%s %d", __func__, __LINE__);
68226827
if (module->comp_ctx)
68236828
aot_destroy_comp_context(module->comp_ctx);
6829+
LOG_DEBUG("%s %d", __func__, __LINE__);
68246830
if (module->comp_data)
68256831
aot_destroy_comp_data(module->comp_data);
6832+
LOG_DEBUG("%s %d", __func__, __LINE__);
68266833
#endif
68276834

68286835
#if WASM_ENABLE_FAST_JIT != 0 && WASM_ENABLE_JIT != 0 \
@@ -6832,15 +6839,21 @@ wasm_loader_unload(WASMModule *module)
68326839
os_cond_destroy(&module->tierup_wait_cond);
68336840
}
68346841
#endif
6842+
LOG_DEBUG("%s %d", __func__, __LINE__);
68356843

68366844
if (module->imports)
68376845
wasm_runtime_free(module->imports);
68386846

6847+
LOG_DEBUG("%s %d", __func__, __LINE__);
68396848
if (module->functions) {
6849+
LOG_DEBUG("%s %d", __func__, __LINE__);
68406850
for (i = 0; i < module->function_count; i++) {
6851+
LOG_DEBUG("%s %d", __func__, __LINE__);
68416852
if (module->functions[i]) {
6853+
LOG_DEBUG("%s %d", __func__, __LINE__);
68426854
if (module->functions[i]->local_offsets)
68436855
wasm_runtime_free(module->functions[i]->local_offsets);
6856+
LOG_DEBUG("%s %d", __func__, __LINE__);
68446857
#if WASM_ENABLE_FAST_INTERP != 0
68456858
if (module->functions[i]->code_compiled)
68466859
wasm_runtime_free(module->functions[i]->code_compiled);
@@ -6852,6 +6865,7 @@ wasm_loader_unload(WASMModule *module)
68526865
jit_code_cache_free(
68536866
module->functions[i]->fast_jit_jitted_code);
68546867
}
6868+
LOG_DEBUG("%s %d", __func__, __LINE__);
68556869
#if WASM_ENABLE_JIT != 0 && WASM_ENABLE_LAZY_JIT != 0
68566870
if (module->functions[i]->call_to_fast_jit_from_llvm_jit) {
68576871
jit_code_cache_free(
@@ -6865,32 +6879,47 @@ wasm_loader_unload(WASMModule *module)
68656879
module->functions[i]->local_ref_type_maps);
68666880
}
68676881
#endif
6882+
LOG_DEBUG("%s %d", __func__, __LINE__);
68686883
wasm_runtime_free(module->functions[i]);
6884+
LOG_DEBUG("%s %d", __func__, __LINE__);
68696885
}
6886+
LOG_DEBUG("%s %d", __func__, __LINE__);
68706887
}
6888+
LOG_DEBUG("%s %d", __func__, __LINE__);
68716889
wasm_runtime_free(module->functions);
6890+
LOG_DEBUG("%s %d", __func__, __LINE__);
68726891
}
6892+
LOG_DEBUG("%s %d", __func__, __LINE__);
68736893

68746894
if (module->tables) {
6895+
LOG_DEBUG("%s %d", __func__, __LINE__);
68756896
#if WASM_ENABLE_GC != 0
68766897
for (i = 0; i < module->table_count; i++) {
68776898
destroy_init_expr(module, &module->tables[i].init_expr);
68786899
}
68796900
#endif
68806901
wasm_runtime_free(module->tables);
6902+
LOG_DEBUG("%s %d", __func__, __LINE__);
68816903
}
6904+
LOG_DEBUG("%s %d", __func__, __LINE__);
68826905

68836906
if (module->memories)
68846907
wasm_runtime_free(module->memories);
6908+
LOG_DEBUG("%s %d", __func__, __LINE__);
68856909

6910+
LOG_DEBUG("%s %d", __func__, __LINE__);
68866911
if (module->globals) {
6912+
LOG_DEBUG("%s %d", __func__, __LINE__);
68876913
#if WASM_ENABLE_GC != 0
68886914
for (i = 0; i < module->global_count; i++) {
68896915
destroy_init_expr(module, &module->globals[i].init_expr);
68906916
}
68916917
#endif
6918+
LOG_DEBUG("%s %d", __func__, __LINE__);
68926919
wasm_runtime_free(module->globals);
6920+
LOG_DEBUG("%s %d", __func__, __LINE__);
68936921
}
6922+
LOG_DEBUG("%s %d", __func__, __LINE__);
68946923

68956924
#if WASM_ENABLE_TAGS != 0
68966925
if (module->tags) {
@@ -6902,8 +6931,10 @@ wasm_loader_unload(WASMModule *module)
69026931
}
69036932
#endif
69046933

6934+
LOG_DEBUG("%s %d", __func__, __LINE__);
69056935
if (module->exports)
69066936
wasm_runtime_free(module->exports);
6937+
LOG_DEBUG("%s %d", __func__, __LINE__);
69076938

69086939
if (module->table_segments) {
69096940
for (i = 0; i < module->table_seg_count; i++) {
@@ -6920,6 +6951,7 @@ wasm_loader_unload(WASMModule *module)
69206951
}
69216952
wasm_runtime_free(module->table_segments);
69226953
}
6954+
LOG_DEBUG("%s %d", __func__, __LINE__);
69236955

69246956
if (module->data_segments) {
69256957
for (i = 0; i < module->data_seg_count; i++) {
@@ -6931,6 +6963,7 @@ wasm_loader_unload(WASMModule *module)
69316963
}
69326964
wasm_runtime_free(module->data_segments);
69336965
}
6966+
LOG_DEBUG("%s %d", __func__, __LINE__);
69346967

69356968
if (module->types) {
69366969
for (i = 0; i < module->type_count; i++) {
@@ -6940,6 +6973,7 @@ wasm_loader_unload(WASMModule *module)
69406973
wasm_runtime_free(module->types);
69416974
}
69426975

6976+
LOG_DEBUG("%s %d", __func__, __LINE__);
69436977
if (module->const_str_list) {
69446978
StringNode *node = module->const_str_list, *node_next;
69456979
while (node) {
@@ -6949,6 +6983,7 @@ wasm_loader_unload(WASMModule *module)
69496983
}
69506984
}
69516985

6986+
LOG_DEBUG("%s %d", __func__, __LINE__);
69526987
#if WASM_ENABLE_STRINGREF != 0
69536988
if (module->string_literal_ptrs) {
69546989
wasm_runtime_free((void *)module->string_literal_ptrs);
@@ -6958,6 +6993,7 @@ wasm_loader_unload(WASMModule *module)
69586993
}
69596994
#endif
69606995

6996+
LOG_DEBUG("%s %d", __func__, __LINE__);
69616997
#if WASM_ENABLE_FAST_INTERP == 0
69626998
if (module->br_table_cache_list) {
69636999
BrTableCache *node = bh_list_first_elem(module->br_table_cache_list);
@@ -6970,6 +7006,7 @@ wasm_loader_unload(WASMModule *module)
69707006
}
69717007
#endif
69727008

7009+
LOG_DEBUG("%s %d", __func__, __LINE__);
69737010
#if WASM_ENABLE_MULTI_MODULE != 0
69747011
/* just release the sub module list */
69757012
if (module->import_module_list) {
@@ -6992,6 +7029,7 @@ wasm_loader_unload(WASMModule *module)
69927029
}
69937030
}
69947031
#endif
7032+
LOG_DEBUG("%s %d", __func__, __LINE__);
69957033

69967034
#if WASM_ENABLE_DEBUG_INTERP != 0
69977035
WASMFastOPCodeNode *fast_opcode =
@@ -7002,16 +7040,19 @@ wasm_loader_unload(WASMModule *module)
70027040
fast_opcode = next;
70037041
}
70047042
#endif
7043+
LOG_DEBUG("%s %d", __func__, __LINE__);
70057044

70067045
#if WASM_ENABLE_DEBUG_INTERP != 0 \
70077046
|| (WASM_ENABLE_FAST_JIT != 0 && WASM_ENABLE_JIT != 0 \
70087047
&& WASM_ENABLE_LAZY_JIT != 0)
70097048
os_mutex_destroy(&module->instance_list_lock);
70107049
#endif
7050+
LOG_DEBUG("%s %d", __func__, __LINE__);
70117051

70127052
#if WASM_ENABLE_LOAD_CUSTOM_SECTION != 0
70137053
wasm_runtime_destroy_custom_sections(module->custom_section_list);
70147054
#endif
7055+
LOG_DEBUG("%s %d", __func__, __LINE__);
70157056

70167057
#if WASM_ENABLE_FAST_JIT != 0
70177058
if (module->fast_jit_func_ptrs) {
@@ -7043,7 +7084,9 @@ wasm_loader_unload(WASMModule *module)
70437084
#endif
70447085
#endif
70457086

7087+
LOG_DEBUG("%s %d", __func__, __LINE__);
70467088
wasm_runtime_free(module);
7089+
LOG_DEBUG("%s %d", __func__, __LINE__);
70477090
}
70487091

70497092
bool

0 commit comments

Comments
 (0)