Skip to main content

Module jit

Module jit 

Source
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 → Result

The 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.