Skip to main content

PinElem

Enum PinElem 

Source
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 Clone for PinElem

Source§

fn clone(&self) -> PinElem

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PinElem

Source§

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

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

impl<'de> Deserialize<'de> for PinElem

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for PinElem

Source§

fn eq(&self, other: &PinElem) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PinElem

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for PinElem

Source§

impl Eq for PinElem

Source§

impl StructuralPartialEq for PinElem

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,