pub struct FrameDescriptor {
pub slots: Vec<NativeKind>,
pub return_kind: Option<NativeKind>,
}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.
§Wire-format binding (ADR-006 §2.7.5.1)
FrameDescriptor is #[derive(Serialize, Deserialize)] and lives
inside FunctionBlob, the content-hash unit for distributed
bytecode. Per §2.7.5.1, slots: Vec<NativeKind> is post-proof — no
Vec<Option<NativeKind>> wrap, no NativeKind::Unknown placeholder
(both deleted by the bulldozer). By the time a FrameDescriptor
reaches FunctionBlob construction, every slot’s NativeKind is
proven; an unproven slot is a compile error per CLAUDE.md type-system
rules.
return_kind: Option<NativeKind> is the single-slot field carrying
the function’s return-value kind, or None for “no return value /
kind not yet stamped”. The single-slot Option<NativeKind> shape is
the §2.7.8 / Q10 cell-storage pattern (single-slot fields take
Option<NativeKind>); §2.7.5.1’s “no Option<NativeKind> wrapping”
rule targets the bulk slots Vec, not single-slot fields where
None distinguishes “no return value” from “return value of kind X”.
Fields§
§slots: Vec<NativeKind>One entry per local slot (index 0 = first param or local).
Every slot’s kind is proven at FunctionBlob construction time
per ADR-006 §2.7.5.1 — NativeKind::Unknown was deleted from the
enum and is never re-introduced under any name.
return_kind: Option<NativeKind>Return type kind for the function, or None for “no return
value / kind not stamped”. Some(kind) means the JIT boundary
ABI uses kind to unmarshal the return value from JIT-compiled
code; None means the host boundary has no return-kind to
unmarshal (e.g. top-level program with no terminal expression).
Implementations§
Source§impl FrameDescriptor
impl FrameDescriptor
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an empty descriptor with no slots and an unset return
kind. Callers stamp return_kind to Some(kind) once the
function’s return type is proven.
Sourcepub fn from_slots(slots: Vec<NativeKind>) -> Self
pub fn from_slots(slots: Vec<NativeKind>) -> Self
Build a descriptor from an existing Vec<NativeKind> of proven
slot kinds. return_kind is left None for the caller to stamp.
Sourcepub fn slot(&self, index: usize) -> Option<NativeKind>
pub fn slot(&self, index: usize) -> Option<NativeKind>
Get the kind of a specific slot, or None for out-of-range
indices. Note: a present slot always has a proven NativeKind
(no Unknown sentinel post-bulldozer).
Trait Implementations§
Source§impl Clone for FrameDescriptor
impl Clone for FrameDescriptor
Source§impl Debug for FrameDescriptor
impl Debug for FrameDescriptor
Source§impl Default for FrameDescriptor
impl Default for 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>,
impl Eq for FrameDescriptor
Source§impl PartialEq for FrameDescriptor
impl PartialEq for FrameDescriptor
Source§impl Serialize for FrameDescriptor
impl Serialize 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§
impl<T> Allocation for T
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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