Skip to main content

SnapshotStorage

Struct SnapshotStorage 

Source
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

Source

pub fn new() -> Self

Source

pub fn add_snapshot(&mut self, snapshot: Snapshot) -> usize

Add a snapshot and return its index.

Source

pub fn add_top_snapshot(&mut self, top: TopSnapshot) -> usize

Add a top snapshot (for a guard).

Source

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.

Source

pub fn add_const_bigint(&mut self, value: i64) -> u32

Add a big integer constant and return its pool index.

Source

pub fn add_const_float(&mut self, value: f64) -> u32

Add a float constant and return its pool index.

Source

pub fn num_snapshots(&self) -> usize

Total number of snapshots.

Source

pub fn refresh_from_gc(&mut self)

Update const_refs from shadow stack — GC may have moved objects. gcreftracer.py:gcrefs_trace parity.

Trait Implementations§

Source§

impl Debug for SnapshotStorage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SnapshotStorage

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Drop for SnapshotStorage

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.