pub struct FrameDescriptor {
pub slots: Vec<SlotKind>,
pub return_kind: SlotKind,
}Expand description
Typed frame layout metadata.
A FrameDescriptor describes the storage layout for every local slot
(parameters + locals) in a single function or top-level frame. The JIT
and VM use this to allocate registers / stack space with correct widths
and to skip NaN-boxing for slots whose type is statically known.
This is the canonical replacement for the loose Vec<StorageHint> arrays
that were previously threaded through BytecodeProgram and Function.
Fields§
§slots: Vec<SlotKind>One entry per local slot (index 0 = first param or local).
A Boxed entry means the slot stores a generic NaN-boxed value.
return_kind: SlotKindReturn type kind for the function.
When present and not Unknown, the JIT boundary ABI uses this to
unmarshal the return value from JIT-compiled code back into the
correct ValueWord representation.
Implementations§
Source§impl FrameDescriptor
impl FrameDescriptor
Sourcepub fn with_unknown_slots(n: usize) -> Self
pub fn with_unknown_slots(n: usize) -> Self
Create a descriptor with n slots, all initialised to SlotKind::Unknown.
Sourcepub fn from_slots(slots: Vec<SlotKind>) -> Self
pub fn from_slots(slots: Vec<SlotKind>) -> Self
Build a descriptor from an existing Vec<SlotKind> (or Vec<StorageHint>).
Sourcepub fn slot(&self, index: usize) -> SlotKind
pub fn slot(&self, index: usize) -> SlotKind
Get the kind of a specific slot. Returns Boxed for out-of-range indices.
Sourcepub fn is_all_unknown(&self) -> bool
pub fn is_all_unknown(&self) -> bool
Returns true if every slot is Unknown (i.e. no specialization).
Trait Implementations§
Source§impl Clone for FrameDescriptor
impl Clone for FrameDescriptor
Source§fn clone(&self) -> FrameDescriptor
fn clone(&self) -> FrameDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FrameDescriptor
impl Debug for FrameDescriptor
Source§impl Default for FrameDescriptor
impl Default for FrameDescriptor
Source§fn default() -> FrameDescriptor
fn default() -> FrameDescriptor
Source§impl<'de> Deserialize<'de> for FrameDescriptor
impl<'de> Deserialize<'de> for FrameDescriptor
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>,
Source§impl PartialEq for FrameDescriptor
impl PartialEq for FrameDescriptor
Source§impl Serialize for FrameDescriptor
impl Serialize for FrameDescriptor
impl Eq for FrameDescriptor
impl StructuralPartialEq for FrameDescriptor
Auto Trait Implementations§
impl Freeze for FrameDescriptor
impl RefUnwindSafe for FrameDescriptor
impl Send for FrameDescriptor
impl Sync for FrameDescriptor
impl Unpin for FrameDescriptor
impl UnsafeUnpin for FrameDescriptor
impl UnwindSafe for FrameDescriptor
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more