pub struct LabelTarget(/* private fields */);Expand description
A 32-bit value encoding a label’s arity, jump address, and stack truncation information
[arity:2][depth:8][offset:22]
Arity is the result type needed by the target block we are jumping to: arity == 0 (no result) arity == 1 (I32 / F32) arity == 2 (I64 / F64) arity == 3 (unused/invalid)
Depth is the 32-bit width truncation of the stack to perform during this jump.
offset is the pc offset (signed) from the current PC. For forward jumps this will be 0 by default to mark the ‘sentinel’ jump target.
Implementations§
Source§impl LabelTarget
impl LabelTarget
pub fn with_jump(self, offset: JumpOffset) -> LabelTarget
Sourcepub fn jump(&self) -> JumpOffset
pub fn jump(&self) -> JumpOffset
Extract the jump target from the encoded label target
Sourcepub fn is_sentinel(&self) -> bool
pub fn is_sentinel(&self) -> bool
A jump offset of exactly 0 is the reserved chain-terminator sentinel
(see JumpOffset::sentinel). It can never collide with a real jump:
forward jumps are strictly positive, loop back-edges strictly negative,
and a backpatch chain node never points at itself (offset 0).
Sourcepub fn arity(&self) -> LabelArity
pub fn arity(&self) -> LabelArity
Number of 32-bit values to move from the current stack to the result stack
Trait Implementations§
Source§impl Clone for LabelTarget
impl Clone for LabelTarget
Source§fn clone(&self) -> LabelTarget
fn clone(&self) -> LabelTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more