wasm-micro-runtime/core/iwasm/compilation
YAMAMOTO Takashi cd7941cc39
AOT/JIT native stack bound check improvement (#2244)
Move the native stack overflow check from the caller to the callee because the
former doesn't work for call_indirect and imported functions.

Make the stack usage estimation more accurate. Instead of making a guess from
the number of wasm locals in the function, use the LLVM's idea of the stack size
of each MachineFunction. The former is inaccurate because a) it doesn't reflect
optimization passes, and b) wasm locals are not the only reason to use stack.

To use the post-compilation stack usage information without requiring 2-pass
compilation or machine-code imm rewriting, introduce a global array to store
stack consumption of each functions:
For JIT, use a custom IRCompiler with an extra pass to fill the array.
For AOT, use `clang -fstack-usage` equivalent because we support external llc.

Re-implement function call stack usage estimation to reflect the real calling
conventions better. (aot_estimate_stack_usage_for_function_call)

Re-implement stack estimation logic (--enable-memory-profiling) based on the new
machinery.

Discussions: #2105.
2023-06-22 07:27:07 +08:00
..
debug dwarf_extractor: Constify a bit (#2278) 2023-06-09 09:52:03 +08:00
simd Implement the segue optimization for LLVM AOT/JIT (#2230) 2023-05-26 10:13:33 +08:00
aot_compiler.c AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_compiler.h Implement the segue optimization for LLVM AOT/JIT (#2230) 2023-05-26 10:13:33 +08:00
aot_emit_aot_file.c AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_emit_compare.c Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_compare.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_const.c Refactor interpreter/AOT module instance layout (#1559) 2022-10-18 10:59:28 +08:00
aot_emit_const.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_control.c Implement Fast JIT multi-threading feature (#2134) 2023-04-20 10:09:34 +08:00
aot_emit_control.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_conversion.c Simplify fcmp intrinsic logic for AOT/XIP (#1881) 2023-01-12 12:05:53 +08:00
aot_emit_conversion.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_exception.c Refactor interpreter/AOT module instance layout (#1559) 2022-10-18 10:59:28 +08:00
aot_emit_exception.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_function.c AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_emit_function.h AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_emit_memory.c Implement the segue optimization for LLVM AOT/JIT (#2230) 2023-05-26 10:13:33 +08:00
aot_emit_memory.h Implement the segue optimization for LLVM AOT/JIT (#2230) 2023-05-26 10:13:33 +08:00
aot_emit_numberic.c Return result directly if float cmp is called in AOT XIP (#1851) 2022-12-30 16:45:39 +08:00
aot_emit_numberic.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_parametric.c Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_parametric.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_table.c Refine Fast JIT call indirect and call native process (#1620) 2022-10-19 17:11:38 +08:00
aot_emit_table.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_emit_variable.c core/iwasm/compilation: constify a bit (#2223) 2023-05-20 11:55:02 +08:00
aot_emit_variable.h Apply clang-format for core/iwasm compilation and libraries (#784) 2021-10-13 15:13:00 +08:00
aot_llvm_extra.cpp Fix build error with LLVM 16 (#2259) 2023-06-06 13:45:18 +08:00
aot_llvm_extra2.cpp AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_llvm_extra2.h AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_llvm.c AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_llvm.h AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_orc_extra.cpp AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_orc_extra.h AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot_orc_extra2.cpp AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
aot.c Enable emitting custom name section to aot file (#794) 2021-10-26 16:32:52 +08:00
aot.h AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
iwasm_compl.cmake Implement atomic and memset/memmove/memcpy intrinsic for riscv (#841) 2021-11-30 17:10:14 +08:00