Struct zksync_vm2::Instruction
source · pub struct Instruction<T, W> { /* private fields */ }
Expand description
Implementations§
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
Instructions for binary operations.
sourcepub fn from_add(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
set_flags: bool,
) -> Self
pub fn from_add( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, set_flags: bool, ) -> Self
Creates Add
instruction with the provided params.
sourcepub fn from_sub(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
set_flags: bool,
) -> Self
pub fn from_sub( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, set_flags: bool, ) -> Self
Creates Sub
instruction with the provided params.
sourcepub fn from_and(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
set_flags: bool,
) -> Self
pub fn from_and( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, set_flags: bool, ) -> Self
Creates And
instruction with the provided params.
sourcepub fn from_or(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
set_flags: bool,
) -> Self
pub fn from_or( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, set_flags: bool, ) -> Self
Creates Or
instruction with the provided params.
sourcepub fn from_xor(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
set_flags: bool,
) -> Self
pub fn from_xor( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, set_flags: bool, ) -> Self
Creates Xor
instruction with the provided params.
sourcepub fn from_shift_left(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
set_flags: bool,
) -> Self
pub fn from_shift_left( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, set_flags: bool, ) -> Self
Creates ShiftLeft
instruction with the provided params.
sourcepub fn from_shift_right(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
set_flags: bool,
) -> Self
pub fn from_shift_right( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, set_flags: bool, ) -> Self
Creates ShiftRight
instruction with the provided params.
sourcepub fn from_rotate_left(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
set_flags: bool,
) -> Self
pub fn from_rotate_left( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, set_flags: bool, ) -> Self
Creates RotateLeft
instruction with the provided params.
sourcepub fn from_rotate_right(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
set_flags: bool,
) -> Self
pub fn from_rotate_right( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, set_flags: bool, ) -> Self
Creates RotateRight
instruction with the provided params.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
Context-related instructions.
sourcepub fn from_this(out: Register1, arguments: Arguments) -> Self
pub fn from_this(out: Register1, arguments: Arguments) -> Self
Creates a This
instruction with the provided params.
sourcepub fn from_caller(out: Register1, arguments: Arguments) -> Self
pub fn from_caller(out: Register1, arguments: Arguments) -> Self
Creates a Caller
instruction with the provided params.
sourcepub fn from_code_address(out: Register1, arguments: Arguments) -> Self
pub fn from_code_address(out: Register1, arguments: Arguments) -> Self
Creates a CodeAddress
instruction with the provided params.
sourcepub fn from_ergs_left(out: Register1, arguments: Arguments) -> Self
pub fn from_ergs_left(out: Register1, arguments: Arguments) -> Self
Creates an ErgsLeft
instruction with the provided params.
sourcepub fn from_context_u128(out: Register1, arguments: Arguments) -> Self
pub fn from_context_u128(out: Register1, arguments: Arguments) -> Self
Creates a ContextU128
instruction with the provided params.
sourcepub fn from_context_sp(out: Register1, arguments: Arguments) -> Self
pub fn from_context_sp(out: Register1, arguments: Arguments) -> Self
Creates an SP
instruction with the provided params.
sourcepub fn from_context_meta(out: Register1, arguments: Arguments) -> Self
pub fn from_context_meta(out: Register1, arguments: Arguments) -> Self
Creates a ContextMeta
instruction with the provided params.
sourcepub fn from_set_context_u128(src: Register1, arguments: Arguments) -> Self
pub fn from_set_context_u128(src: Register1, arguments: Arguments) -> Self
Creates a SetContextU128
instruction with the provided params.
sourcepub fn from_increment_tx_number(arguments: Arguments) -> Self
pub fn from_increment_tx_number(arguments: Arguments) -> Self
Creates an IncrementTxNumber
instruction with the provided params.
sourcepub fn from_aux_mutating(arguments: Arguments) -> Self
pub fn from_aux_mutating(arguments: Arguments) -> Self
Creates an AuxMutating0
instruction with the provided params.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
sourcepub fn from_event(
key: Register1,
value: Register2,
is_first: bool,
arguments: Arguments,
) -> Self
pub fn from_event( key: Register1, value: Register2, is_first: bool, arguments: Arguments, ) -> Self
Creates an Event
instruction with the provided params.
sourcepub fn from_l2_to_l1_message(
key: Register1,
value: Register2,
is_service: bool,
arguments: Arguments,
) -> Self
pub fn from_l2_to_l1_message( key: Register1, value: Register2, is_service: bool, arguments: Arguments, ) -> Self
Creates an L2ToL1Message
instruction with the provided params.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
sourcepub fn from_far_call<M: TypeLevelCallingMode>(
src1: Register1,
src2: Register2,
error_handler: Immediate1,
is_static: bool,
is_shard: bool,
arguments: Arguments,
) -> Self
pub fn from_far_call<M: TypeLevelCallingMode>( src1: Register1, src2: Register2, error_handler: Immediate1, is_static: bool, is_shard: bool, arguments: Arguments, ) -> Self
Creates a FarCall
instruction with the provided mode and params.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
sourcepub fn from_heap_read(
src: RegisterOrImmediate,
out: Register1,
incremented_out: Option<Register2>,
arguments: Arguments,
) -> Self
pub fn from_heap_read( src: RegisterOrImmediate, out: Register1, incremented_out: Option<Register2>, arguments: Arguments, ) -> Self
Creates a HeapRead
instruction with the provided params.
sourcepub fn from_aux_heap_read(
src: RegisterOrImmediate,
out: Register1,
incremented_out: Option<Register2>,
arguments: Arguments,
) -> Self
pub fn from_aux_heap_read( src: RegisterOrImmediate, out: Register1, incremented_out: Option<Register2>, arguments: Arguments, ) -> Self
Creates an AuxHeapRead
instruction with the provided params.
sourcepub fn from_heap_write(
src1: RegisterOrImmediate,
src2: Register2,
incremented_out: Option<Register1>,
arguments: Arguments,
should_hook: bool,
) -> Self
pub fn from_heap_write( src1: RegisterOrImmediate, src2: Register2, incremented_out: Option<Register1>, arguments: Arguments, should_hook: bool, ) -> Self
Creates a HeapWrite
instruction with the provided params.
sourcepub fn from_aux_heap_store(
src1: RegisterOrImmediate,
src2: Register2,
incremented_out: Option<Register1>,
arguments: Arguments,
) -> Self
pub fn from_aux_heap_store( src1: RegisterOrImmediate, src2: Register2, incremented_out: Option<Register1>, arguments: Arguments, ) -> Self
Creates an AuxHeapWrite
instruction with the provided params.
sourcepub fn from_pointer_read(
src: Register1,
out: Register1,
incremented_out: Option<Register2>,
arguments: Arguments,
) -> Self
pub fn from_pointer_read( src: Register1, out: Register1, incremented_out: Option<Register2>, arguments: Arguments, ) -> Self
Creates an PointerRead
instruction with the provided params.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
sourcepub fn from_near_call(
gas: Register1,
destination: Immediate1,
error_handler: Immediate2,
arguments: Arguments,
) -> Self
pub fn from_near_call( gas: Register1, destination: Immediate1, error_handler: Immediate2, arguments: Arguments, ) -> Self
Creates a NearCall
instruction with the provided params.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
sourcepub fn from_nop(
pop: AdvanceStackPointer,
push: AdvanceStackPointer,
arguments: Arguments,
) -> Self
pub fn from_nop( pop: AdvanceStackPointer, push: AdvanceStackPointer, arguments: Arguments, ) -> Self
Creates a Nop
instruction with the provided params.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
Pointer-related instructions.
sourcepub fn from_pointer_add(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
) -> Self
pub fn from_pointer_add( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, ) -> Self
Creates a PointerAdd
instruction with the provided params.
sourcepub fn from_pointer_sub(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
) -> Self
pub fn from_pointer_sub( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, ) -> Self
Creates a PointerSub
instruction with the provided params.
sourcepub fn from_pointer_pack(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
) -> Self
pub fn from_pointer_pack( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, ) -> Self
Creates a PointerPack
instruction with the provided params.
sourcepub fn from_pointer_shrink(
src1: AnySource,
src2: Register2,
out: AnyDestination,
arguments: Arguments,
swap: bool,
) -> Self
pub fn from_pointer_shrink( src1: AnySource, src2: Register2, out: AnyDestination, arguments: Arguments, swap: bool, ) -> Self
Creates a PointerShrink
instruction with the provided params.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
sourcepub fn from_precompile_call(
abi: Register1,
burn: Register2,
out: Register1,
arguments: Arguments,
) -> Self
pub fn from_precompile_call( abi: Register1, burn: Register2, out: Register1, arguments: Arguments, ) -> Self
Creates a PrecompileCall
instruction with the provided params.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
Variations of Ret
instructions.
sourcepub fn from_ret(
src1: Register1,
label: Option<Immediate1>,
arguments: Arguments,
) -> Self
pub fn from_ret( src1: Register1, label: Option<Immediate1>, arguments: Arguments, ) -> Self
Creates a normal Ret
instruction with the provided params.
sourcepub fn from_revert(
src1: Register1,
label: Option<Immediate1>,
arguments: Arguments,
) -> Self
pub fn from_revert( src1: Register1, label: Option<Immediate1>, arguments: Arguments, ) -> Self
Creates a revert Ret
instruction with the provided params.
sourcepub fn from_panic(label: Option<Immediate1>, arguments: Arguments) -> Self
pub fn from_panic(label: Option<Immediate1>, arguments: Arguments) -> Self
Creates a panic Ret
instruction with the provided params.
sourcepub const fn from_invalid() -> Self
pub const fn from_invalid() -> Self
Creates a invalid instruction that will panic by draining all gas.
source§impl<T: Tracer, W: World<T>> Instruction<T, W>
impl<T: Tracer, W: World<T>> Instruction<T, W>
sourcepub fn from_storage_write(
src1: Register1,
src2: Register2,
arguments: Arguments,
) -> Self
pub fn from_storage_write( src1: Register1, src2: Register2, arguments: Arguments, ) -> Self
Creates a StorageWrite
instruction with the provided params.
sourcepub fn from_transient_storage_write(
src1: Register1,
src2: Register2,
arguments: Arguments,
) -> Self
pub fn from_transient_storage_write( src1: Register1, src2: Register2, arguments: Arguments, ) -> Self
Creates a TransientStorageWrite
instruction with the provided params.
sourcepub fn from_storage_read(
src: Register1,
dst: Register1,
arguments: Arguments,
) -> Self
pub fn from_storage_read( src: Register1, dst: Register1, arguments: Arguments, ) -> Self
Creates a StorageRead
instruction with the provided params.
sourcepub fn from_transient_storage_read(
src: Register1,
dst: Register1,
arguments: Arguments,
) -> Self
pub fn from_transient_storage_read( src: Register1, dst: Register1, arguments: Arguments, ) -> Self
Creates a TransientStorageRead
instruction with the provided params.