pub struct TraceMetadata {
pub chunk_op_hash: u64,
pub anchor_ip: usize,
pub fallthrough_ip: usize,
pub ops: Vec<Op>,
pub recorded_ips: Vec<usize>,
pub slot_kinds_at_anchor: Vec<SlotKind>,
}Expand description
Serializable trace metadata for persistent cache export/import (phase 7).
Captures everything needed to re-compile a previously-installed trace
in a fresh process: the original recorded op sequence, the parallel
bytecode IPs, the slot-type entry guard, and the fallthrough IP. Bind
to the chunk via chunk_op_hash so a stale metadata file (chunk has
changed) is rejected on import rather than silently mis-compiled.
Persistence format is intentionally serde-based so callers can pick
whatever encoding fits their environment (JSON, bincode, custom binary).
fusevm itself doesn’t ship a file format — JitCompiler::export_trace
returns the struct, import_trace consumes one. The user owns I/O.
Fields§
§chunk_op_hash: u64Hash of the chunk’s ops + constants pool at trace-record time. Used to detect chunk drift on import: a mismatched hash means the bytecode has changed and the persisted trace is stale.
anchor_ip: usizeBytecode IP where the trace was anchored (the backward-branch
header that crossed TRACE_THRESHOLD).
fallthrough_ip: usizeBytecode IP the interpreter should resume at after the trace runs to completion (one past the loop’s natural exit).
ops: Vec<Op>The captured op sequence in record order; the trace is a straight-line projection of these ops with side-exit guards inserted at each branch.
recorded_ips: Vec<usize>Parallel array to ops: the original bytecode IP each recorded
op corresponds to. Used to materialise the interpreter’s IP on
deopt so execution resumes at the right place.
slot_kinds_at_anchor: Vec<SlotKind>Slot type fingerprint at the entry guard. The trace’s entry stub compares each slot’s runtime type against this snapshot; mismatch → skip the trace and let the interpreter handle the iteration.
Trait Implementations§
Source§impl Clone for TraceMetadata
impl Clone for TraceMetadata
Source§fn clone(&self) -> TraceMetadata
fn clone(&self) -> TraceMetadata
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more