Skip to main content

byteflow/jit/
mod.rs

1//! Trace JIT for Byteflow — Cranelift backend, isolated `unsafe`.
2//!
3//! Compiles int traces (`LoadImm`, `AddImm`, `SubImm`, `MulImm`, `LtImm`,
4//! `EqImm`, `LeImm`, `LoadConst`, `Move`, `Nop`, arithmetic, `Div`, `Mod`,
5//! bitwise ops including `Shl`/`Shr`, `Neg`, `Branch`, `Jump`, `Call`,
6//! `Return`). A float trace covers `LoadConst` of `Float`, `Move`, `Add`,
7//! `Sub`, `Mul`, `Div`, `Eq`, `Lt`, `Le`, `Neg`, and the same control
8//! opcodes. Scheduler effects, lists, maps, and records stop recording.
9
10mod call;
11mod compiler;
12
13mod dispatch;
14mod error;
15mod exit;
16mod frame;
17mod module_local;
18#[cfg(test)]
19mod parity;
20mod runtime;
21mod trace;
22
23pub use compiler::TraceCompiler;
24pub use dispatch::{
25    apply_exit_to_vm, force_compile, hot_threshold, run_compiled_trace, run_compiled_trace_ref,
26    run_vm_with_jit, run_vm_with_jit_runtime, sync_slots_from_vm, sync_slots_to_vm, try_run_hot,
27    try_run_hot_runtime, SyncSlotsResult,
28};
29pub use error::CompileError;
30pub use exit::{
31    ExitReason, JitReturn, JIT_BUDGET, JIT_CONTINUE, JIT_DEOPT, JIT_EFFECT, JIT_RETURN, JIT_TRAP,
32};
33pub use frame::{JitCallRecord, JitEntry, JitFrame, MAX_JIT_CALL_DEPTH};
34pub use runtime::JitRuntime;
35pub use trace::{
36    CompiledTrace, HotCounter, JitContext, TraceCache, TraceKey, TraceSpan, HOT_THRESHOLD,
37    MAX_TRACE_LENGTH,
38};