Expand description
JIT compilation module for the JavaScript engine.
Provides a bytecode compiler and stack-based VM as an alternative execution path to the tree-walking interpreter. The pipeline is:
JavaScript source → Parser → AST → Compiler → Bytecode → VM → ResultThe bytecode representation eliminates per-node dispatch overhead and improves cache locality compared to recursive AST evaluation.
Modules§
- bytecode
- Bytecode instruction set and chunk structure for the JIT compiler.
- compiler
- AST-to-bytecode compiler.
- reg_
bytecode - Register-based bytecode instruction set and chunk structure.
- reg_
compiler - AST-to-register-bytecode compiler.
- reg_jit
- Cranelift-based JIT for register bytecode (numeric prototype).
- reg_vm
- Register-based bytecode virtual machine.
- vm
- Stack-based bytecode virtual machine.
Functions§
- compile
- Compile an AST program into stack-based bytecode.
- compile_
and_ run - Compile and execute a program in one step.
- compile_
and_ run_ reg - Compile and execute a program with the register VM.
- compile_
and_ run_ reg_ jit_ with_ ctx - Compile and execute with the numeric JIT prototype.
- compile_
and_ run_ reg_ with_ ctx - Compile and execute with register VM, returning the EvalContext.
- compile_
and_ run_ with_ ctx - Compile and execute, returning the context for variable inspection.
- compile_
reg - Compile an AST program into register-based bytecode.
- execute
- Execute stack-based bytecode.
- execute_
reg - Execute a compiled register bytecode chunk.
- execute_
reg_ jit - Execute register bytecode with Cranelift JIT compilation.
- execute_
reg_ jit_ or_ vm - Execute register bytecode with JIT when possible; fall back to RegVm on failure.