wasm-micro-runtime/core/iwasm
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
..
aot Enable windows x86-32 AOT relocations (#2285) 2023-06-16 11:48:12 +08:00
common Implement AOT static PGO (#2243) 2023-06-05 09:17:39 +08:00
compilation AOT/JIT native stack bound check improvement (#2244) 2023-06-22 07:27:07 +08:00
doc Add architecture diagram for wasm globals and classic-interp stack frame (#2058) 2023-03-25 09:39:20 +08:00
fast-jit Implement Fast JIT multi-threading feature (#2134) 2023-04-20 10:09:34 +08:00
include Implement AOT static PGO (#2243) 2023-06-05 09:17:39 +08:00
interpreter Fix fast-interp issue of LAST_OP_OUTPUT_I32/64 check (#2295) 2023-06-16 10:00:24 +08:00
libraries Fix dockerfile linter warnings (#2291) 2023-06-15 16:52:48 +08:00
README.md Add architecture diagram for wasm globals and classic-interp stack frame (#2058) 2023-03-25 09:39:20 +08:00