pub struct FrameMarker(/* private fields */);Expand description
A 64-bit packed activation record marker that lives in the value
stack slot base-1 of any Lua frame (LJ_FR2 model). Carries the
frame kind (lower 3 bits) + PC-or-delta payload (upper 61 bits).
Construction goes through FrameMarker::new_lua /
FrameMarker::new_cont which encode their args correctly;
destruction goes through FrameMarker::kind / FrameMarker::payload.
Internally a u64 so it round-trips through Value::Int(i64) safely
without losing bits — luna’s Value::Int is a full i64 (no NaN
boxing), so the bit pattern survives the stack store/load cleanly.
Implementations§
Source§impl FrameMarker
impl FrameMarker
Sourcepub fn new_lua(pc: u32) -> Self
pub fn new_lua(pc: u32) -> Self
Build a FrameKind::Lua marker with the given PC. PC must fit
in 61 bits (a u32 always does). Panics in debug mode on
overflow; production code is expected to pass a u32.
Sourcepub fn new_cont(delta: u32) -> Self
pub fn new_cont(delta: u32) -> Self
Build a FrameKind::Cont marker with the given frame delta
(slots between this frame’s base and the previous frame’s base).
Delta must fit in 61 bits.
Sourcepub fn payload(self) -> u32
pub fn payload(self) -> u32
Read the PC/delta payload (upper 61 bits, shifted down). For Lua frames this is the bytecode PC; for Cont frames the caller-base delta.
Sourcepub fn to_raw(self) -> i64
pub fn to_raw(self) -> i64
Raw bits, suitable for storing in a Value::Int(i64) slot.
The reverse direction is FrameMarker::from_raw.
Trait Implementations§
Source§impl Clone for FrameMarker
impl Clone for FrameMarker
Source§fn clone(&self) -> FrameMarker
fn clone(&self) -> FrameMarker
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FrameMarker
Source§impl Debug for FrameMarker
impl Debug for FrameMarker
impl Eq for FrameMarker
Source§impl PartialEq for FrameMarker
impl PartialEq for FrameMarker
Source§fn eq(&self, other: &FrameMarker) -> bool
fn eq(&self, other: &FrameMarker) -> bool
self and other values to be equal, and is used by ==.