pub enum Operand {
Unused,
Word(&'static [Repr]),
Value,
}Expand description
Which of a, b and c an opcode uses, and for what.
This is the table ADR 0041 calls the format’s central saving: “every slot is inside the function frame” is not forty-nine rules but one rule over three fields, driven by which of the three an opcode declares live.
Variants§
Unused
The opcode does not use this field, and it must be zero.
Requiring the zero is what makes the encoding canonical: two
encodings of one program are byte-identical, and encode(decode(b))
is b.
Word(&'static [Repr])
One word of the frame, holding one of these Reprs.
ANY is the empty list and means the opcode constrains nothing —
the destination of a call, whose Repr is the head word of whatever
the callee answers, and the operand of an addr.slot, which is any
location at all.
Value
The first slot of a value location whose width comes from the layout in the payload.
The check is the fits one crate::verify makes: slot + width must
be inside the frame, because a run of words copied off the top of a
frame reads or writes the frame above it.
Trait Implementations§
impl Copy for Operand
impl Eq for Operand
impl StructuralPartialEq for Operand
Auto Trait Implementations§
impl Freeze for Operand
impl RefUnwindSafe for Operand
impl Send for Operand
impl Sync for Operand
impl Unpin for Operand
impl UnsafeUnpin for Operand
impl UnwindSafe for Operand
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.