-
Notifications
You must be signed in to change notification settings - Fork 115
Description
To achieve the goal of integrating a portable JIT compiler (#81) , we plan to implement a multi-tier compilation framework. We will start with the Fast JIT tier and then transition to LLVM JIT (ORC lazy JIT) to achieve both quick startup times and improved performance.
Following a similar approach to V8 JIT tiering, we will employ backend threads (#239) with eager compilation. This implies that once the profiling data indicates the shift from interpreter to JIT (#189), all RISC-V instructions will undergo compilation with the Fast JIT. We will patiently await the compilation process's completion, then proceed to instantiate the runtime module and execute the RISC-V instructions. Concurrently, we'll initiate LLVM JIT to compile RISC-V instructions and progressively transition to LLVM JIT functions during execution.
Design goals:
- Short compilation time and quick startup.
- Good overall performance.
- Small memory footprint.
- Ease of support for additional targets, typically requiring codegen re-implementation.
- Long-term objective: Tier-up to LLVM JIT.
Reference:
- bpftime vm: userspace eBPF vm with JIT support
- ubpf/vm
- wasm-micro-runtime
- Beyond Wasm: Is RISC-V the Next Great Leap for Smart Contracts? / PolkaVM : Fast to compile, with guaranteed single-pass O(n) compilation. Loading new code into the VM should be near instantaneous.
- Exploring alternatives to WASM for smart contracts
- rv32jit