pub enum SlotKind {
Show 26 variants
Float64,
NullableFloat64,
Int8,
NullableInt8,
UInt8,
NullableUInt8,
Int16,
NullableInt16,
UInt16,
NullableUInt16,
Int32,
NullableInt32,
UInt32,
NullableUInt32,
Int64,
NullableInt64,
UInt64,
NullableUInt64,
IntSize,
NullableIntSize,
UIntSize,
NullableUIntSize,
Bool,
String,
NanBoxed,
Unknown,
}Expand description
Describes the storage kind for a single local/parameter slot in a frame.
Used by the JIT and VM to generate more efficient code by knowing the actual storage representation at compile time.
This was previously named StorageHint; the alias is kept for
backwards compatibility.
Variants§
Float64
Plain f64 value (direct float operations)
NullableFloat64
Nullable f64 using NaN sentinel (Option
Int8
Plain i8 value
NullableInt8
Nullable i8 value
UInt8
Plain u8 value
NullableUInt8
Nullable u8 value
Int16
Plain i16 value
NullableInt16
Nullable i16 value
UInt16
Plain u16 value
NullableUInt16
Nullable u16 value
Int32
Plain i32 value
NullableInt32
Nullable i32 value
UInt32
Plain u32 value
NullableUInt32
Nullable u32 value
Int64
Plain i64 value
NullableInt64
Nullable i64 value
UInt64
Plain u64 value
NullableUInt64
Nullable u64 value
IntSize
Plain isize value
NullableIntSize
Nullable isize value
UIntSize
Plain usize value
NullableUIntSize
Nullable usize value
Bool
Boolean value
String
String reference
NanBoxed
NaN-boxed value: the raw u64 bits are a valid NaN-boxed interpreter value. Used for boxed locals and operand stack entries in precise deopt metadata. The VM unmarshals these via direct transmute (zero-cost passthrough).
Unknown
Type not determined at compile time (falls back to NaN-boxed dispatch). Should NOT appear in precise deopt metadata — use NanBoxed instead. Reserved for truly uninitialized/unresolved slots.
Implementations§
Source§impl SlotKind
impl SlotKind
Sourcepub fn from_storage_type(st: &StorageType) -> Self
pub fn from_storage_type(st: &StorageType) -> Self
Convert from runtime StorageType
Maps semantic storage types to JIT optimization hints:
- Primitive types map directly
- NullableFloat64 enables NaN sentinel optimization
- Complex types fall back to boxed representation
pub fn is_integer(self) -> bool
pub fn is_nullable_integer(self) -> bool
pub fn is_integer_family(self) -> bool
pub fn is_default_int_family(self) -> bool
pub fn is_float_family(self) -> bool
pub fn is_numeric_family(self) -> bool
pub fn is_pointer_sized_integer(self) -> bool
pub fn is_signed_integer(self) -> Option<bool>
pub fn integer_bit_width(self) -> Option<u16>
pub fn non_nullable(self) -> Self
pub fn with_nullability(self, nullable: bool) -> Self
pub fn combine_integer_hints(lhs: Self, rhs: Self) -> Option<Self>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SlotKind
impl<'de> Deserialize<'de> for SlotKind
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 From<StorageType> for SlotKind
impl From<StorageType> for SlotKind
Source§fn from(st: StorageType) -> Self
fn from(st: StorageType) -> Self
Convert from runtime StorageType to JIT StorageHint
impl Copy for SlotKind
impl Eq for SlotKind
impl StructuralPartialEq for SlotKind
Auto Trait Implementations§
impl Freeze for SlotKind
impl RefUnwindSafe for SlotKind
impl Send for SlotKind
impl Sync for SlotKind
impl Unpin for SlotKind
impl UnsafeUnpin for SlotKind
impl UnwindSafe for SlotKind
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