Expand description
Tier-2 trace-JIT compiler for stabilized superinstruction plans.
Compiles high-confidence hostcall superinstruction traces into guarded native dispatch stubs, removing residual interpreter overhead while preserving deterministic fallback to the sequential dispatch path.
§Architecture
The JIT tier sits above the superinstruction compiler:
Tier 0: Interpreter (sequential dispatch via match)
Tier 1: Superinstruction fusion (plan-based dispatch, see hostcall_superinstructions.rs)
Tier 2: Trace-JIT (pre-compiled dispatch tables with guard stubs) ← this moduleA plan is promoted to JIT when it reaches a configurable hotness
threshold (min_jit_executions). The compiled trace holds a guard
sequence that is checked at entry; on guard failure the trace
deoptimizes and falls back to tier-0 sequential dispatch.
Structs§
- Compiled
Trace - A compiled trace stub with guard conditions and dispatch metadata.
- Guard
Context - Context supplied to guard checks.
- JitExecution
Result - Result of attempting to execute via JIT.
- Trace
JitCompiler - Tier-2 trace-JIT compiler and dispatch cache.
- Trace
JitConfig - Configuration for the trace-JIT compiler tier.
- Trace
JitTelemetry - Snapshot of JIT compiler telemetry.
Enums§
- Compilation
Tier - Compilation tier for a trace.
- Deopt
Reason - Reason why a JIT-compiled trace deoptimized.
- Trace
Guard - A guard condition that must hold for a compiled trace to execute.
Functions§
- estimated_
jit_ cost - Estimated JIT dispatch cost for a given opcode window width.