pub enum PinElem {
Int,
IntI32,
Float,
Bool,
Map,
TextBytes,
TextMut,
}Expand description
One pinned array for a region run: the register holding the list, the
frame slots that receive its buffer pointer and length at entry, and the
element kind the region speculated on. The VM borrows each DISTINCT
Rc<RefCell<…>> exactly once for the whole native run (aliased registers
resolve to the same buffer, so native writes through one name are visible
through every other — and there is zero refcount or borrow traffic inside
the loop). Arrays mutate IN PLACE: no write-back, and the deopt replay is
sound by prefix-idempotence (the replay recomputes exactly the values the
native prefix already wrote).
Element kind of a pinned buffer (decides the stencil’s access width:
8-byte for Int/Float bits, 1-byte for Bool).
Variants§
Int
IntI32
A pinned half-width Int buffer (ListRepr::IntsI32 = Vec<i32>): the
stencil/regalloc access width is 4 bytes — loads sign-extend (movsxd),
stores truncate the low 4 bytes. The narrowing proof guarantees every
stored value fits i32, so truncation is lossless; a region-entry pin
only admits an IntsI32 buffer for this lane.
Float
Bool
Map
A pinned MAP: vec_slot carries &mut MapStorage as *mut _;
the ptr/len slots are unused. Get/set/contains go through pure
helpers against the kernel’s own storage (iteration order is
untouched by construction).
TextBytes
A pinned ASCII Text carried AS BYTES: ptr_slot receives the string’s
byte buffer pointer (Rc<String>::as_bytes().as_ptr()) and len_slot
its BYTE length (== char count for ASCII). Read-only — the Rc<String>
is never mutated in place, so no snapshot/rollback applies; the entry
pin RE-CHECKS ASCII and declines (deopt) on a non-ASCII Text.
TextMut
A pinned MUTABLE Text accumulator (Set text to text + ch): vec_slot
receives a *mut Value pointing AT THE VM REGISTER CELL (the cell is
stable for the whole native run, even though the Rc<String> inside it
reallocs/COWs on append). The ptr_slot/len_slot are unused. The
logos_rt_str_append helper grows the accumulator THROUGH this pointer
with EXACTLY the VM’s add_assign semantics — in place when the
Rc<String> is sole-owned, copy-on-write (a fresh Rc written back into
the cell, the alias untouched) otherwise — so the tiered run is
bit-identical to the tree-walker for every alias case. The entry pin
declines (deopt to bytecode) if the observed value is not a Text. A
classic replay-from-head Deopt is NOT replay-idempotent over an
already-grown accumulator (it would double-append), so the VM SNAPSHOTS
the register’s Value on entry and restores it before a classic replay
(see ArrayPin::mutated); a precise region resumes at the faulting op
and keeps the live grown value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PinElem
impl<'de> Deserialize<'de> for PinElem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Copy for PinElem
impl Eq for PinElem
impl StructuralPartialEq for PinElem
Auto Trait Implementations§
impl Freeze for PinElem
impl RefUnwindSafe for PinElem
impl Send for PinElem
impl Sync for PinElem
impl Unpin for PinElem
impl UnsafeUnpin for PinElem
impl UnwindSafe for PinElem
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.