Skip to main content

TraceRecordBuffer

Struct TraceRecordBuffer 

Source
pub struct TraceRecordBuffer { /* private fields */ }

Implementations§

Source§

impl TraceRecordBuffer

Source

pub fn new(num_inputargs: usize) -> Self

Create a new trace recording buffer.

Source

pub fn tag_overflow_imminent(&self) -> bool

opencoder.py: tag_overflow_imminent() Check if the recording buffer is nearly full.

Source

pub fn tracing_done(&mut self) -> bool

opencoder.py: tracing_done() Finalize the trace and check for overflow.

Source

pub fn record_op(&mut self, opcode: u16, num_args: u8)

Record an operation.

Source

pub fn _op_start(&self) -> usize

opencoder.py: _op_start() — mark start offset for current opcode.

Source

pub fn _op_end(&self) -> usize

opencoder.py: _op_end() — mark end offset for current opcode.

Source

pub fn _encode(&self, kind: u8, value: u32) -> u32

RPython-compatible: Trace._encode(op, arg).

Returns a tagged representation for values stored in snapshots and arrays.

Source

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

RPython-compatible: Trace._cached_const_int(value). Reuse pooled small constants to keep indexes stable.

Source

pub fn _cached_const_ptr(&mut self, ptr: u64) -> u32

RPython-compatible: Trace._cached_const_ptr(ptr). Reuse pooled pointer constants to keep indexes stable.

Source

pub fn _encode_descr(&self, descr: u32) -> u32

opencoder.py: _encode_descr(descr) — encode descriptor index.

Source

pub fn _add_box_to_storage(&mut self, value: u32) -> usize

opencoder.py: _add_box_to_storage(value).

Store box value into a dedicated pool; return index for compatibility.

Source

pub fn append_byte(&mut self, byte: u8)

opencoder.py: append_byte(byte) — append raw byte to trace data.

Source

pub fn append_int(&mut self, value: u32)

opencoder.py: append_int(value) — append LEB128 value to trace data.

Source

pub fn append_snapshot_array_data_int(data: &mut Vec<u32>, value: i32)

opencoder.py: append_snapshot_array_data_int(data, value).

Source

pub fn append_snapshot_data_int(data: &mut Vec<u32>, value: i32)

opencoder.py: append_snapshot_data_int(data, value).

Source

pub fn _encode_snapshot(snapshot: &Snapshot) -> Vec<u32>

opencoder.py: _encode_snapshot(snapshot) → encoded snapshot payload.

Source

pub fn create_snapshot(&self, values: Vec<u32>) -> Snapshot

opencoder.py: create_snapshot(values) — helper for building a snapshot.

Source

pub fn snapshot_add_prev(snapshot: &mut Snapshot, prev: Option<usize>)

opencoder.py: snapshot_add_prev(snapshot, prev).

Source

pub fn record_op0(&mut self, opcode: u16)

opencoder.py compatibility: record fixed-arity opcodes with explicit argument slots.

Source

pub fn record_op1(&mut self, opcode: u16, arg0: u32)

opencoder.py compatibility: record fixed-arity opcodes with explicit argument slots.

Source

pub fn record_op2(&mut self, opcode: u16, arg0: u32, arg1: u32)

opencoder.py compatibility: record fixed-arity opcodes with explicit argument slots.

Source

pub fn record_op3(&mut self, opcode: u16, arg0: u32, arg1: u32, arg2: u32)

opencoder.py compatibility: record fixed-arity opcodes with explicit argument slots.

Source

pub fn _list_of_boxes(&self, boxes: &[u32]) -> Vec<u32>

RPython-compatible: encode a boxed value array.

Source

pub fn _list_of_boxes_virtualizable(&self, boxes: &[u32]) -> Vec<u32>

RPython-compatible: encode boxes for virtualizable state.

Source

pub fn new_array(&self, items: &[u32]) -> Vec<u32>

RPython-compatible helper: return a copied encoded array payload.

Source

pub fn record_arg(&mut self, value: u32)

Record an argument value.

Source

pub fn cut_point(&mut self)

opencoder.py: cut_point() Mark the current position as a potential bridge entry.

Source

pub fn num_ops(&self) -> usize

Number of recorded operations.

Source

pub fn overflowed(&self) -> bool

Whether the trace overflowed.

Source

pub fn snapshots(&self) -> &SnapshotStorage

Get the snapshot storage.

Source

pub fn snapshots_mut(&mut self) -> &mut SnapshotStorage

Get mutable snapshot storage (for adding snapshots during tracing).

Source

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

opencoder.py: capture_resumedata(snapshot) Record a snapshot at the current position (for guard resume data).

Source

pub fn create_top_snapshot( &mut self, snapshot: Snapshot, vable_array_index: Option<usize>, vref_array_index: Option<usize>, ) -> usize

opencoder.py: create_top_snapshot(frame, vable_boxes, vref_boxes) Create a top-level snapshot with virtualizable and virtual ref arrays.

Source

pub fn create_empty_top_snapshot( &mut self, vable_array_index: Option<usize>, vref_array_index: Option<usize>, ) -> usize

opencoder.py: create_empty_top_snapshot(vable_boxes, vref_boxes) Create a top snapshot with no frame data (for bridge entry).

Source

pub fn get_live_ranges(&self, ops: &[Op]) -> Vec<usize>

opencoder.py: get_live_ranges() Compute live ranges for all recorded values. Returns a vector where index i contains the last position where value i is used.

Source

pub fn data_len(&self) -> usize

opencoder.py: unpack() Decode the recorded trace into (inputargs, ops). Convenience method for testing and debugging.

Source

pub fn max_size(&self) -> usize

Maximum allowed data size.

Source

pub fn set_max_size(&mut self, size: usize)

Set the maximum allowed data size.

Source

pub fn capture_resumedata_framestack( &mut self, frame_pcs: &[u64], frame_slots: &[Vec<u32>], _virtualizable_boxes: &[u32], _virtualref_boxes: &[u32], ) -> usize

opencoder.py: capture_resumedata(framestack, vable_boxes, vref_boxes)

Multi-frame version: creates a chain of snapshots for the full frame stack, with the topmost frame as a TopSnapshot.

Source

pub fn get_dead_ranges(&self, ops: &[Op]) -> Vec<usize>

opencoder.py: get_dead_ranges()

Compute dead ranges: for each op index x, the values that are known to be dead before x. Used by the register allocator to know when to free registers.

Source

pub fn unpack(&self, encoded: &[u32]) -> Vec<(u8, u32)>

RPython-compatible: unpack tagged box stream into raw pairs.

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.