pub enum Instruction {
Show 53 variants
Drop(ValueType),
Dup,
Swap,
LoadParameter(usize),
StoreParameter(usize),
PushLiteral(LiteralValue),
Return,
ReturnVoid,
ReturnDefault(ValueType),
BinaryOp(BinaryOperator),
LoadState(usize),
StoreState(usize),
LoadStorageDynamic,
LoadLocal(usize),
StoreLocal(usize),
LoadMappingElement {
state_index: usize,
key_types: Vec<ValueType>,
},
StoreMappingElement {
state_index: usize,
key_types: Vec<ValueType>,
},
StoreArrayDeepCopy {
state_index: usize,
key_types: Vec<ValueType>,
},
LoadStructField {
state_index: usize,
key_types: Vec<ValueType>,
field_keys: Vec<[u8; 32]>,
field_type: ValueType,
},
StoreStructField {
state_index: usize,
key_types: Vec<ValueType>,
field_keys: Vec<[u8; 32]>,
field_type: ValueType,
},
LoadStructArrayElement {
state_index: usize,
key_types: Vec<ValueType>,
field_keys: Vec<[u8; 32]>,
element_type: ValueType,
},
StoreStructArrayElement {
state_index: usize,
key_types: Vec<ValueType>,
field_keys: Vec<[u8; 32]>,
element_type: ValueType,
},
LoadStructFieldMappingElement {
state_index: usize,
key_types: Vec<ValueType>,
field_keys: Vec<[u8; 32]>,
trailing_key_types: Vec<ValueType>,
value_type: ValueType,
},
StoreStructFieldMappingElement {
state_index: usize,
key_types: Vec<ValueType>,
field_keys: Vec<[u8; 32]>,
trailing_key_types: Vec<ValueType>,
},
LoadRuntimeValue(RuntimeValue),
GetSize,
CallFunction {
name: String,
arg_count: usize,
},
PushFunctionOffset {
name: String,
},
CallIndirect {
arg_count: usize,
has_return: bool,
},
CallBuiltin {
builtin: BuiltinCall,
arg_count: usize,
},
EmitEvent {
event_index: usize,
arg_count: usize,
},
EmitEventByName {
name: String,
arg_count: usize,
},
Convert {
target: ConvertTarget,
},
IsType {
target: ConvertTarget,
},
NewBuffer,
NewArray {
element_type: ValueType,
},
NewMap,
ArrayGet,
ArraySet,
HasKey,
MemCpy,
Substr,
ReverseItems,
BitwiseNot,
LogicalNot,
Try {
catch_target: usize,
},
EndTry {
target: usize,
},
Jump {
target: usize,
},
JumpIf {
target: usize,
},
Label(usize),
Throw,
AbortMsg,
Abort,
}Variants§
Drop(ValueType)
Dup
NeoVM DUP - duplicate the top stack item
Swap
NeoVM SWAP - swap the top two stack items
LoadParameter(usize)
StoreParameter(usize)
PushLiteral(LiteralValue)
Return
ReturnVoid
ReturnDefault(ValueType)
BinaryOp(BinaryOperator)
LoadState(usize)
StoreState(usize)
LoadStorageDynamic
LoadLocal(usize)
StoreLocal(usize)
LoadMappingElement
StoreMappingElement
StoreArrayDeepCopy
Task #205 — store a dynamic-array value into storage using the same
layout the read side expects: length at the base slot and elements at
keccak256(serialize(i) || slot).
LoadStructField
StoreStructField
LoadStructArrayElement
Fields
StoreStructArrayElement
Fields
LoadStructFieldMappingElement
Fields
StoreStructFieldMappingElement
Fields
LoadRuntimeValue(RuntimeValue)
GetSize
CallFunction
PushFunctionOffset
Task #186 — push an internal function’s bytecode offset as an integer
literal. Emitted when a function name is evaluated as a value (e.g.
passed as an argument of function-pointer type). The bytecode emitter
fixes up the placeholder with the function’s actual method.offset
once all methods have been laid out.
CallIndirect
Task #186 — indirect call through a function pointer (internal
function(...) internal returns (...) passed as a parameter). Pops
arg_count argument values and then the function-offset value, reverses
the argument order so the callee’s INITSLOT binds them left-to-right,
then emits CALLA (0x36) which jumps to the target offset.
CallBuiltin
EmitEvent
EmitEventByName
Convert
NeoVM CONVERT opcode. Converts the top stack item to a different StackItemType.
Fields
target: ConvertTargetIsType
NeoVM ISTYPE opcode. Checks whether the top stack item matches a StackItemType and pushes a boolean.
Fields
target: ConvertTargetNewBuffer
Allocate a new mutable buffer (NeoVM NEWBUFFER) whose length is taken from the stack.
Used to implement Solidity new bytes(n) / new string(n) allocations.
NewArray
NewMap
Allocate a new empty map (NeoVM NEWMAP). Used by Task #100 yul
tstore/tload lowering to back __yul_transient with an in-memory
key-value store that lives for the duration of the current invocation.
ArrayGet
ArraySet
HasKey
NeoVM HASKEY opcode: pops [collection, key], pushes Boolean — true
if the key exists in the collection (Array index in range or Map key
present). Used by Task #100 tload to return 0 for unset slots instead
of raising PICKITEM: key not found.
MemCpy
NeoVM MEMCPY opcode: copy a slice of bytes into a buffer. Stack order (bottom -> top): [dst, dst_offset, src, src_offset, count]
Substr
NeoVM SUBSTR opcode: pop count and index, then a ByteString,
push the substring bytes[index .. index + count] as a ByteString.
Stack order (bottom -> top): [bytes, index, count] -> [bytes_substr].
Used to implement contiguous bytes memory/bytes calldata slicing
so b[a:b] returns a raw ByteString rather than an Array of bytes.
ReverseItems
NeoVM REVERSEITEMS opcode: reverse an Array/Buffer in place. Note: consumes one reference and does not push it back.
BitwiseNot
LogicalNot
NeoVM NOT (0xAA) — logical boolean negation.
Pops one value, pushes !value.is_truthy().
Correctly handles null (returns true), unlike PUSHF + EQUAL.
Try
EndTry
Jump
JumpIf
Label(usize)
Throw
NeoVM THROW - raises a catchable exception using the value on the stack.
AbortMsg
Abort
Trait Implementations§
Source§impl Clone for Instruction
impl Clone for Instruction
Source§fn clone(&self) -> Instruction
fn clone(&self) -> Instruction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Instruction
impl Debug for Instruction
impl Eq for Instruction
Source§impl PartialEq for Instruction
impl PartialEq for Instruction
Source§fn eq(&self, other: &Instruction) -> bool
fn eq(&self, other: &Instruction) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for Instruction
Auto Trait Implementations§
impl Freeze for Instruction
impl RefUnwindSafe for Instruction
impl Send for Instruction
impl Sync for Instruction
impl Unpin for Instruction
impl UnsafeUnpin for Instruction
impl UnwindSafe for Instruction
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<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.