Expand description
JIT Compiler Module for Shape
Compiles Shape bytecode to native x86-64/ARM machine code using Cranelift for high-performance strategy execution in backtesting.
§Module Structure
ffi::jit_kinds- JIT-specific heap kinds and allocation typesffi::value_ffi- NaN-boxing value encoding/decoding helperscontext- JITContext, JITDataFrame, and related structuresffi- FFI functions called from JIT-compiled codeloop_analysis- Loop analysis for JIT optimizationosr_compiler- OSR (On-Stack Replacement) loop compilationffi_refs- FFI function references for heap operationscompiler- JITCompiler implementation (split into logical modules)core- Legacy re-exports and tests
Re-exports§
pub use error::JitError;pub use executor::JITExecutor;pub use self::osr_compiler::OsrCompilationResult;pub use self::osr_compiler::compile_osr_loop;pub use self::worker::JitCompilationBackend;pub use shape_ast as ast;pub use shape_runtime as runtime;pub use context::*;pub use ffi::jit_kinds::*;pub use ffi::value_ffi::*;
Modules§
- context
- JIT Context and Related Data Structures
- error
- JIT compiler error types.
- executor
- JIT executor implementing the ProgramExecutor trait
- ffi
- FFI Functions for JIT-compiled Code
- jit_
array - JIT array — Route A close.
- jit_
cache - Content-addressed JIT code cache with dependency-based invalidation.
- jit_
matrix - Native JIT matrix with guaranteed C-compatible layout.
- loop_
analysis - Loop Analysis for JIT Optimization
- mir_
compiler - MIR-to-Cranelift IR compiler (JIT v2).
- mixed_
table - Mixed function table supporting both JIT-compiled and interpreter-fallback entries.
- osr_
compiler - OSR (On-Stack Replacement) Loop Compilation
- worker
- JIT Compilation Backend
Structs§
- JITCompiler
- JitParity
Entry - Program-level JIT parity entry (opcode/builtin support row).
- JitPreflight
Report - Program-level preflight report for JIT capability checks.
Enums§
- JitParity
Target - What the parity row describes.
Functions§
- build_
full_ builtin_ parity_ matrix - Build a full builtin parity matrix across the entire BuiltinFunction surface.
- build_
full_ opcode_ parity_ matrix - Build a full opcode parity matrix across the entire VM opcode surface.
- build_
program_ parity_ matrix - Build a program-specific JIT parity matrix.
- can_
jit_ compile - Check if a bytecode program can be fully JIT-compiled
- get_
incomplete_ opcodes - Get a list of opcodes that have placeholder (incomplete) implementations
- get_
unsupported_ opcodes - Get a list of unsupported opcodes in a program (for debugging)
- preflight_
blob_ jit_ compatibility - Run JIT compatibility preflight on a single function blob.
- preflight_
instructions - Run JIT compatibility preflight on a raw instruction slice.
- preflight_
jit_ compatibility - Run JIT preflight and collect all constructs that require VM fallback.