Available on crate feature
jit only.Expand description
Trace JIT for Byteflow — Cranelift backend, isolated unsafe.
Compiles int-specialized traces (LoadImm, LoadConst, Move, binops,
Neg, Branch, Jump, Call, Return). Scheduler effects stop recording.
Structs§
- Compiled
Trace - HotCounter
- JitCall
Record - Saved caller state for one
Opcode::Call. - JitContext
- JitFrame
- Mutable state for one JIT invocation on the current bytecode frame.
- JitReturn
- Wire format returned across the native boundary.
- JitRuntime
- Runtime-wide JIT state: compiled traces are shared; each worker thread owns
its own Cranelift module for compilation ([
super::module_local]). - Trace
Cache - Trace
Compiler - Trace
Key - Trace
Span
Enums§
- Compile
Error - Exit
Reason - Why a compiled trace stopped.
- Sync
Slots Result - Result of copying VM registers into JIT shadow slots.
Constants§
- HOT_
THRESHOLD - How many times
(function, pc)must run before compilation is attempted. - JIT_
BUDGET - JIT_
CONTINUE - JIT_
DEOPT - JIT_
EFFECT - JIT_
RETURN - JIT_
TRAP - MAX_
JIT_ CALL_ DEPTH - Maximum nested intra-chunk calls handled inside one compiled trace.
- MAX_
TRACE_ LENGTH - Maximum instructions recorded into a single trace.
Functions§
- apply_
exit_ to_ vm - Apply a native trace exit to a live
Vm, producing an optional earlyVmResultwhen the trace finished the flow. - force_
compile - Force-compile a trace (tests / benchmarks).
- hot_
threshold - Threshold at which a
(function, pc)pair becomes a compilation candidate. - run_
compiled_ trace - Run a compiled trace against the shadow slot table.
- run_
compiled_ trace_ ref - Run a cached trace by reference.
- run_
vm_ with_ jit - Run at most
budgetinstructions, retrying compiled traces after each interpreter step when a site becomes hot. - run_
vm_ with_ jit_ runtime - Runtime path: shared cache, per-thread compilation module.
- sync_
slots_ from_ vm - Copy int-compatible registers from the VM into JIT shadow slots.
- sync_
slots_ to_ vm - Write JIT shadow slots back into the active VM register file.
- try_
run_ hot - Compile
keyif needed and execute once. ReturnsNonewhen compilation fails (caller should fall back to the interpreter). - try_
run_ hot_ runtime - Shared-runtime variant (no global lock during execution).