pub struct TraceRecordBuffer { /* private fields */ }Implementations§
Source§impl TraceRecordBuffer
impl TraceRecordBuffer
Sourcepub fn tag_overflow_imminent(&self) -> bool
pub fn tag_overflow_imminent(&self) -> bool
opencoder.py: tag_overflow_imminent() Check if the recording buffer is nearly full.
Sourcepub fn tracing_done(&mut self) -> bool
pub fn tracing_done(&mut self) -> bool
opencoder.py: tracing_done() Finalize the trace and check for overflow.
Sourcepub fn _op_start(&self) -> usize
pub fn _op_start(&self) -> usize
opencoder.py: _op_start() — mark start offset for current opcode.
Sourcepub fn _encode(&self, kind: u8, value: u32) -> u32
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.
Sourcepub fn _cached_const_int(&mut self, value: i64) -> u32
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.
Sourcepub fn _cached_const_ptr(&mut self, ptr: u64) -> u32
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.
Sourcepub fn _encode_descr(&self, descr: u32) -> u32
pub fn _encode_descr(&self, descr: u32) -> u32
opencoder.py: _encode_descr(descr) — encode descriptor index.
Sourcepub fn _add_box_to_storage(&mut self, value: u32) -> usize
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.
Sourcepub fn append_byte(&mut self, byte: u8)
pub fn append_byte(&mut self, byte: u8)
opencoder.py: append_byte(byte) — append raw byte to trace data.
Sourcepub fn append_int(&mut self, value: u32)
pub fn append_int(&mut self, value: u32)
opencoder.py: append_int(value) — append LEB128 value to trace data.
Sourcepub fn append_snapshot_array_data_int(data: &mut Vec<u32>, value: i32)
pub fn append_snapshot_array_data_int(data: &mut Vec<u32>, value: i32)
opencoder.py: append_snapshot_array_data_int(data, value).
Sourcepub fn append_snapshot_data_int(data: &mut Vec<u32>, value: i32)
pub fn append_snapshot_data_int(data: &mut Vec<u32>, value: i32)
opencoder.py: append_snapshot_data_int(data, value).
Sourcepub fn _encode_snapshot(snapshot: &Snapshot) -> Vec<u32>
pub fn _encode_snapshot(snapshot: &Snapshot) -> Vec<u32>
opencoder.py: _encode_snapshot(snapshot) → encoded snapshot payload.
Sourcepub fn create_snapshot(&self, values: Vec<u32>) -> Snapshot
pub fn create_snapshot(&self, values: Vec<u32>) -> Snapshot
opencoder.py: create_snapshot(values) — helper for building a snapshot.
Sourcepub fn snapshot_add_prev(snapshot: &mut Snapshot, prev: Option<usize>)
pub fn snapshot_add_prev(snapshot: &mut Snapshot, prev: Option<usize>)
opencoder.py: snapshot_add_prev(snapshot, prev).
Sourcepub fn record_op0(&mut self, opcode: u16)
pub fn record_op0(&mut self, opcode: u16)
opencoder.py compatibility: record fixed-arity opcodes with explicit argument slots.
Sourcepub fn record_op1(&mut self, opcode: u16, arg0: u32)
pub fn record_op1(&mut self, opcode: u16, arg0: u32)
opencoder.py compatibility: record fixed-arity opcodes with explicit argument slots.
Sourcepub fn record_op2(&mut self, opcode: u16, arg0: u32, arg1: u32)
pub fn record_op2(&mut self, opcode: u16, arg0: u32, arg1: u32)
opencoder.py compatibility: record fixed-arity opcodes with explicit argument slots.
Sourcepub fn record_op3(&mut self, opcode: u16, arg0: u32, arg1: u32, arg2: u32)
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.
Sourcepub fn _list_of_boxes(&self, boxes: &[u32]) -> Vec<u32>
pub fn _list_of_boxes(&self, boxes: &[u32]) -> Vec<u32>
RPython-compatible: encode a boxed value array.
Sourcepub fn _list_of_boxes_virtualizable(&self, boxes: &[u32]) -> Vec<u32>
pub fn _list_of_boxes_virtualizable(&self, boxes: &[u32]) -> Vec<u32>
RPython-compatible: encode boxes for virtualizable state.
Sourcepub fn new_array(&self, items: &[u32]) -> Vec<u32>
pub fn new_array(&self, items: &[u32]) -> Vec<u32>
RPython-compatible helper: return a copied encoded array payload.
Sourcepub fn record_arg(&mut self, value: u32)
pub fn record_arg(&mut self, value: u32)
Record an argument value.
Sourcepub fn cut_point(&mut self)
pub fn cut_point(&mut self)
opencoder.py: cut_point() Mark the current position as a potential bridge entry.
Sourcepub fn overflowed(&self) -> bool
pub fn overflowed(&self) -> bool
Whether the trace overflowed.
Sourcepub fn snapshots(&self) -> &SnapshotStorage
pub fn snapshots(&self) -> &SnapshotStorage
Get the snapshot storage.
Sourcepub fn snapshots_mut(&mut self) -> &mut SnapshotStorage
pub fn snapshots_mut(&mut self) -> &mut SnapshotStorage
Get mutable snapshot storage (for adding snapshots during tracing).
Sourcepub fn capture_resumedata(&mut self, snapshot: Snapshot) -> usize
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).
Sourcepub fn create_top_snapshot(
&mut self,
snapshot: Snapshot,
vable_array_index: Option<usize>,
vref_array_index: Option<usize>,
) -> usize
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.
Sourcepub fn create_empty_top_snapshot(
&mut self,
vable_array_index: Option<usize>,
vref_array_index: Option<usize>,
) -> usize
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).
Sourcepub fn get_live_ranges(&self, ops: &[Op]) -> Vec<usize>
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.
Sourcepub fn data_len(&self) -> usize
pub fn data_len(&self) -> usize
opencoder.py: unpack() Decode the recorded trace into (inputargs, ops). Convenience method for testing and debugging.
Sourcepub fn set_max_size(&mut self, size: usize)
pub fn set_max_size(&mut self, size: usize)
Set the maximum allowed data size.
Sourcepub fn capture_resumedata_framestack(
&mut self,
frame_pcs: &[u64],
frame_slots: &[Vec<u32>],
_virtualizable_boxes: &[u32],
_virtualref_boxes: &[u32],
) -> usize
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.
Sourcepub fn get_dead_ranges(&self, ops: &[Op]) -> Vec<usize>
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.