From 2da0ccf952d574c13f6f2ec141c3c6ff639df60a Mon Sep 17 00:00:00 2001 From: victoryang00 Date: Mon, 27 May 2024 02:36:53 +0800 Subject: [PATCH] Merge branch 'dev/checkpoint_and_restore' into main Signed-off-by: victoryang00 --- core/iwasm/compilation/aot_compiler.c | 9 ++-- core/iwasm/compilation/aot_emit_function.c | 15 ------- .../libraries/ckpt-restore/get_func_name.py | 43 ------------------- .../ckpt-restore/wamr_wasi_arguments.h | 2 +- test-tools/addr2line/addr2line.py | 1 - 5 files changed, 5 insertions(+), 65 deletions(-) delete mode 100644 core/iwasm/libraries/ckpt-restore/get_func_name.py diff --git a/core/iwasm/compilation/aot_compiler.c b/core/iwasm/compilation/aot_compiler.c index f254a2dea8..3711143738 100644 --- a/core/iwasm/compilation/aot_compiler.c +++ b/core/iwasm/compilation/aot_compiler.c @@ -358,20 +358,19 @@ aot_gen_commit_value(AOTCompFrame *frame, bool reset_dirty_bit, } if (local_idx < func_ctx->aot_func->func_type->param_count + func_ctx->aot_func->local_count) { - fprintf(stderr, "LLVMBuildLoad2 %d < %d\n", local_idx, - func_ctx->aot_func->local_count); value = LLVMBuildLoad2(comp_ctx->builder, llvm_value_type, func_ctx->locals[local_idx], "commit_stack_load"); - fprintf(stderr, "DONE LLVMBuildLoad2 %d\n", local_idx); } else { if (!(*p)->value) { fprintf(stderr, "value is null, %d %d\n", local_idx, n); exit(-1); } - value = LLVMBuildLoad2(comp_ctx->builder, llvm_value_type, (*p)->value, - "commit_stack_load"); + value = (*p)->value; + // value = LLVMBuildLoad2(comp_ctx->builder, llvm_value_type, + // (*p)->value, + // "commit_stack_load"); } if (value == NULL) { fprintf(stderr, "gen value load error\n"); diff --git a/core/iwasm/compilation/aot_emit_function.c b/core/iwasm/compilation/aot_emit_function.c index ca49543619..215c36013e 100644 --- a/core/iwasm/compilation/aot_emit_function.c +++ b/core/iwasm/compilation/aot_emit_function.c @@ -1420,21 +1420,6 @@ aot_compile_op_call(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx, /* Get param cell number */ param_cell_num = func_type->param_cell_num; - // #if (WASM_ENABLE_DUMP_CALL_STACK != 0) || (WASM_ENABLE_PERF_PROFILING != - // 0) - // if (comp_ctx->enable_aux_stack_frame) { - // LLVMValueRef func_idx_const; - - // if (!(func_idx_const = I32_CONST(func_idx))) { - // aot_set_last_error("llvm build const failed."); - // return false; - // } - // if (!call_aot_alloc_frame_func(comp_ctx, func_ctx, - // func_idx_const)) - // return false; - // } - // #endif - /* Allocate memory for parameters. * Parameters layout: * - exec env diff --git a/core/iwasm/libraries/ckpt-restore/get_func_name.py b/core/iwasm/libraries/ckpt-restore/get_func_name.py deleted file mode 100644 index 60a769834d..0000000000 --- a/core/iwasm/libraries/ckpt-restore/get_func_name.py +++ /dev/null @@ -1,43 +0,0 @@ -import subprocess - -def get_func_name(func, file): - cmd = ["wasm2wat", "--enable-all", file] - grep_cmd = ["grep", "func"] - process = subprocess.Popen(cmd, stdout=subprocess.PIPE) - grep_process = subprocess.Popen( - grep_cmd, stdin=process.stdout, stdout=subprocess.PIPE - ) - process.stdout.close() - output = grep_process.communicate()[0].decode("utf-8") - output = output.split("\n") - output1 = [ - x - for x in output - if not x.__contains__("(type (;") - # and not x.__contains__("(import ") - and not x.__contains__("(table (;") - and not x.__contains__("global.get") - ] - - import_count = len([ - x - for x in output - if x.__contains__("(import ") - ]) - - for i in range(len(output1)): - if i == func: - return output1[i].split(" ")[3], i - import_count - -if __name__ == "__main__": - import sys - wasm = sys.argv[1] - names = [] - aot_idxes = [] - for i in range(2, len(sys.argv)): - idx = int(sys.argv[i]) - name, aot_idx = get_func_name(idx, wasm) - names.append(name) - aot_idxes.append(aot_idx) - for i in range(len(names)): - print(f"{names[i]} {aot_idxes[i]}") \ No newline at end of file diff --git a/core/iwasm/libraries/ckpt-restore/wamr_wasi_arguments.h b/core/iwasm/libraries/ckpt-restore/wamr_wasi_arguments.h index 3fcadb33ff..196c102b82 100644 --- a/core/iwasm/libraries/ckpt-restore/wamr_wasi_arguments.h +++ b/core/iwasm/libraries/ckpt-restore/wamr_wasi_arguments.h @@ -17,12 +17,12 @@ #include "wamr_serializer.h" #include "wasm_runtime.h" #include -#include #include #include #include #include #include +#include #include struct WAMRAddrPool { diff --git a/test-tools/addr2line/addr2line.py b/test-tools/addr2line/addr2line.py index 736c1b4f18..421b0bdb24 100644 --- a/test-tools/addr2line/addr2line.py +++ b/test-tools/addr2line/addr2line.py @@ -346,7 +346,6 @@ def main(): if splitted is None: print(f"{line}") continue - index = index[2:] _, offset, index = splitted if args.no_addr: