pub struct SnapshotStorage {
pub snapshots: Vec<Snapshot>,
pub top_snapshots: Vec<TopSnapshot>,
pub const_refs: Vec<u64>,
pub const_bigints: Vec<i64>,
pub const_floats: Vec<f64>,
/* private fields */
}Expand description
Snapshot storage for a trace. opencoder.py: Trace._snapshot_data, _snapshot_array_data
gcreftracer.py parity: const_refs entries are GC references stored as raw u64. They are rooted on the shadow stack so GC can update them when objects move. refresh_from_gc() copies updated values back.
Fields§
§snapshots: Vec<Snapshot>All snapshots in this trace, indexed by position.
top_snapshots: Vec<TopSnapshot>Top snapshots corresponding to guard operations.
const_refs: Vec<u64>Constant pool: GC references (pointers). opencoder.py: Trace._refs
const_bigints: Vec<i64>Constant pool: big integers (>28-bit).
const_floats: Vec<f64>Constant pool: float values.
Implementations§
Source§impl SnapshotStorage
impl SnapshotStorage
pub fn new() -> Self
Sourcepub fn add_snapshot(&mut self, snapshot: Snapshot) -> usize
pub fn add_snapshot(&mut self, snapshot: Snapshot) -> usize
Add a snapshot and return its index.
Sourcepub fn add_top_snapshot(&mut self, top: TopSnapshot) -> usize
pub fn add_top_snapshot(&mut self, top: TopSnapshot) -> usize
Add a top snapshot (for a guard).
Sourcepub fn add_const_ref(&mut self, ptr: u64) -> u32
pub fn add_const_ref(&mut self, ptr: u64) -> u32
Add a GC reference constant and return its pool index. gcreftracer.py parity: non-null refs are rooted on shadow stack.
Sourcepub fn add_const_bigint(&mut self, value: i64) -> u32
pub fn add_const_bigint(&mut self, value: i64) -> u32
Add a big integer constant and return its pool index.
Sourcepub fn add_const_float(&mut self, value: f64) -> u32
pub fn add_const_float(&mut self, value: f64) -> u32
Add a float constant and return its pool index.
Sourcepub fn num_snapshots(&self) -> usize
pub fn num_snapshots(&self) -> usize
Total number of snapshots.
Sourcepub fn refresh_from_gc(&mut self)
pub fn refresh_from_gc(&mut self)
Update const_refs from shadow stack — GC may have moved objects. gcreftracer.py:gcrefs_trace parity.