InstructionData

Enum InstructionData 

Source
pub enum InstructionData {
Show 40 variants AtomicCas { opcode: Opcode, args: [Value; 3], flags: MemFlags, }, AtomicRmw { opcode: Opcode, args: [Value; 2], flags: MemFlags, op: AtomicRmwOp, }, Binary { opcode: Opcode, args: [Value; 2], }, BinaryImm64 { opcode: Opcode, arg: Value, imm: Imm64, }, BinaryImm8 { opcode: Opcode, arg: Value, imm: Uimm8, }, BranchTable { opcode: Opcode, arg: Value, table: JumpTable, }, Brif { opcode: Opcode, arg: Value, blocks: [BlockCall; 2], }, Call { opcode: Opcode, args: ValueList, func_ref: FuncRef, }, CallIndirect { opcode: Opcode, args: ValueList, sig_ref: SigRef, }, CondTrap { opcode: Opcode, arg: Value, code: TrapCode, }, DynamicStackLoad { opcode: Opcode, dynamic_stack_slot: DynamicStackSlot, }, DynamicStackStore { opcode: Opcode, arg: Value, dynamic_stack_slot: DynamicStackSlot, }, ExceptionHandlerAddress { opcode: Opcode, block: Block, imm: Imm64, }, FloatCompare { opcode: Opcode, args: [Value; 2], cond: FloatCC, }, FuncAddr { opcode: Opcode, func_ref: FuncRef, }, IntAddTrap { opcode: Opcode, args: [Value; 2], code: TrapCode, }, IntCompare { opcode: Opcode, args: [Value; 2], cond: IntCC, }, IntCompareImm { opcode: Opcode, arg: Value, cond: IntCC, imm: Imm64, }, Jump { opcode: Opcode, destination: BlockCall, }, Load { opcode: Opcode, arg: Value, flags: MemFlags, offset: Offset32, }, LoadNoOffset { opcode: Opcode, arg: Value, flags: MemFlags, }, MultiAry { opcode: Opcode, args: ValueList, }, NullAry { opcode: Opcode, }, Shuffle { opcode: Opcode, args: [Value; 2], imm: Immediate, }, StackLoad { opcode: Opcode, stack_slot: StackSlot, offset: Offset32, }, StackStore { opcode: Opcode, arg: Value, stack_slot: StackSlot, offset: Offset32, }, Store { opcode: Opcode, args: [Value; 2], flags: MemFlags, offset: Offset32, }, StoreNoOffset { opcode: Opcode, args: [Value; 2], flags: MemFlags, }, Ternary { opcode: Opcode, args: [Value; 3], }, TernaryImm8 { opcode: Opcode, args: [Value; 2], imm: Uimm8, }, Trap { opcode: Opcode, code: TrapCode, }, TryCall { opcode: Opcode, args: ValueList, func_ref: FuncRef, exception: ExceptionTable, }, TryCallIndirect { opcode: Opcode, args: ValueList, exception: ExceptionTable, }, Unary { opcode: Opcode, arg: Value, }, UnaryConst { opcode: Opcode, constant_handle: Constant, }, UnaryGlobalValue { opcode: Opcode, global_value: GlobalValue, }, UnaryIeee16 { opcode: Opcode, imm: Ieee16, }, UnaryIeee32 { opcode: Opcode, imm: Ieee32, }, UnaryIeee64 { opcode: Opcode, imm: Ieee64, }, UnaryImm { opcode: Opcode, imm: Imm64, },
}

Variants§

§

AtomicCas

Fields

§opcode: Opcode
§args: [Value; 3]
§flags: MemFlags
§

AtomicRmw

Fields

§opcode: Opcode
§args: [Value; 2]
§flags: MemFlags
§

Binary

Fields

§opcode: Opcode
§args: [Value; 2]
§

BinaryImm64

Fields

§opcode: Opcode
§arg: Value
§imm: Imm64
§

BinaryImm8

Fields

§opcode: Opcode
§arg: Value
§imm: Uimm8
§

BranchTable

Fields

§opcode: Opcode
§arg: Value
§

Brif

Fields

§opcode: Opcode
§arg: Value
§blocks: [BlockCall; 2]
§

Call

Fields

§opcode: Opcode
§func_ref: FuncRef
§

CallIndirect

Fields

§opcode: Opcode
§sig_ref: SigRef
§

CondTrap

Fields

§opcode: Opcode
§arg: Value
§

DynamicStackLoad

Fields

§opcode: Opcode
§dynamic_stack_slot: DynamicStackSlot
§

DynamicStackStore

Fields

§opcode: Opcode
§arg: Value
§dynamic_stack_slot: DynamicStackSlot
§

ExceptionHandlerAddress

Fields

§opcode: Opcode
§block: Block
§imm: Imm64
§

FloatCompare

Fields

§opcode: Opcode
§args: [Value; 2]
§cond: FloatCC
§

FuncAddr

Fields

§opcode: Opcode
§func_ref: FuncRef
§

IntAddTrap

Fields

§opcode: Opcode
§args: [Value; 2]
§

IntCompare

Fields

§opcode: Opcode
§args: [Value; 2]
§cond: IntCC
§

IntCompareImm

Fields

§opcode: Opcode
§arg: Value
§cond: IntCC
§imm: Imm64
§

Jump

Fields

§opcode: Opcode
§destination: BlockCall
§

Load

Fields

§opcode: Opcode
§arg: Value
§flags: MemFlags
§offset: Offset32
§

LoadNoOffset

Fields

§opcode: Opcode
§arg: Value
§flags: MemFlags
§

MultiAry

Fields

§opcode: Opcode
§

NullAry

Fields

§opcode: Opcode
§

Shuffle

Fields

§opcode: Opcode
§args: [Value; 2]
§

StackLoad

Fields

§opcode: Opcode
§stack_slot: StackSlot
§offset: Offset32
§

StackStore

Fields

§opcode: Opcode
§arg: Value
§stack_slot: StackSlot
§offset: Offset32
§

Store

Fields

§opcode: Opcode
§args: [Value; 2]
§flags: MemFlags
§offset: Offset32
§

StoreNoOffset

Fields

§opcode: Opcode
§args: [Value; 2]
§flags: MemFlags
§

Ternary

Fields

§opcode: Opcode
§args: [Value; 3]
§

TernaryImm8

Fields

§opcode: Opcode
§args: [Value; 2]
§imm: Uimm8
§

Trap

Fields

§opcode: Opcode
§

TryCall

Fields

§opcode: Opcode
§func_ref: FuncRef
§exception: ExceptionTable
§

TryCallIndirect

Fields

§opcode: Opcode
§exception: ExceptionTable
§

Unary

Fields

§opcode: Opcode
§arg: Value
§

UnaryConst

Fields

§opcode: Opcode
§constant_handle: Constant
§

UnaryGlobalValue

Fields

§opcode: Opcode
§global_value: GlobalValue
§

UnaryIeee16

Fields

§opcode: Opcode
§

UnaryIeee32

Fields

§opcode: Opcode
§

UnaryIeee64

Fields

§opcode: Opcode
§

UnaryImm

Fields

§opcode: Opcode
§imm: Imm64

Implementations§

Source§

impl InstructionData

Source

pub fn opcode(&self) -> Opcode

Get the opcode of this instruction.

Source

pub fn typevar_operand(&self, pool: &ValueListPool) -> Option<Value>

Get the controlling type variable operand.

Source

pub fn arguments<'a>(&'a self, pool: &'a ValueListPool) -> &'a [Value]

Get the value arguments to this instruction.

Source

pub fn arguments_mut<'a>( &'a mut self, pool: &'a mut ValueListPool, ) -> &'a mut [Value]

Get mutable references to the value arguments to this instruction.

Source

pub fn eq(&self, other: &Self, pool: &ValueListPool) -> bool

Compare two InstructionData for equality.

This operation requires a reference to a ValueListPool to determine if the contents of any ValueLists are equal.

This operation takes a closure that is allowed to map each argument value to some other value before the instructions are compared. This allows various forms of canonicalization.

Source

pub fn hash<H: Hasher>(&self, state: &mut H, pool: &ValueListPool)

Hash an InstructionData.

This operation requires a reference to a ValueListPool to hash the contents of any ValueLists.

This operation takes a closure that is allowed to map each argument value to some other value before it is hashed. This allows various forms of canonicalization.

Source

pub fn deep_clone(&self, pool: &mut ValueListPool) -> Self

Deep-clone an InstructionData, including any referenced lists.

This operation requires a reference to a ValueListPool to clone the ValueLists.

Source

pub fn map(&self, mapper: impl InstructionMapper) -> Self

Map some functions, described by the given InstructionMapper, over each of the entities within this instruction, producing a new InstructionData.

Source§

impl InstructionData

Analyzing an instruction.

Avoid large matches on instruction formats by using the methods defined here to examine instructions.

Source

pub fn branch_destination<'a>( &'a self, jump_tables: &'a JumpTables, exception_tables: &'a ExceptionTables, ) -> &'a [BlockCall]

Get the destinations of this instruction, if it’s a branch.

br_table returns the empty slice.

Source

pub fn branch_destination_mut<'a>( &'a mut self, jump_tables: &'a mut JumpTables, exception_tables: &'a mut ExceptionTables, ) -> &'a mut [BlockCall]

Get a mutable slice of the destinations of this instruction, if it’s a branch.

br_table returns the empty slice.

Source

pub fn map_values( &mut self, pool: &mut ValueListPool, jump_tables: &mut JumpTables, exception_tables: &mut ExceptionTables, f: impl FnMut(Value) -> Value, )

Replace the values used in this instruction according to the given function.

Source

pub fn trap_code(&self) -> Option<TrapCode>

If this is a trapping instruction, get its trap code. Otherwise, return None.

Source

pub fn cond_code(&self) -> Option<IntCC>

If this is a control-flow instruction depending on an integer condition, gets its condition. Otherwise, return None.

Source

pub fn fp_cond_code(&self) -> Option<FloatCC>

If this is a control-flow instruction depending on a floating-point condition, gets its condition. Otherwise, return None.

Source

pub fn trap_code_mut(&mut self) -> Option<&mut TrapCode>

If this is a trapping instruction, get an exclusive reference to its trap code. Otherwise, return None.

Source

pub fn atomic_rmw_op(&self) -> Option<AtomicRmwOp>

If this is an atomic read/modify/write instruction, return its subopcode.

Source

pub fn load_store_offset(&self) -> Option<i32>

If this is a load/store instruction, returns its immediate offset.

Source

pub fn memflags(&self) -> Option<MemFlags>

If this is a load/store instruction, return its memory flags.

Source

pub fn stack_slot(&self) -> Option<StackSlot>

If this instruction references a stack slot, return it

Source

pub fn analyze_call<'a>( &'a self, pool: &'a ValueListPool, exception_tables: &ExceptionTables, ) -> CallInfo<'a>

Return information about a call instruction.

Any instruction that can call another function reveals its call signature here.

Source

pub fn exception_table(&self) -> Option<ExceptionTable>

Get the exception table, if any, associated with this instruction.

Trait Implementations§

Source§

impl Clone for InstructionData

Source§

fn clone(&self) -> InstructionData

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InstructionData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InstructionData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a> From<&'a InstructionData> for InstructionFormat

Source§

fn from(inst: &'a InstructionData) -> Self

Converts to this type from the input type.
Source§

impl Hash for InstructionData

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for InstructionData

Source§

fn eq(&self, other: &InstructionData) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for InstructionData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Copy for InstructionData

Source§

impl Eq for InstructionData

Source§

impl StructuralPartialEq for InstructionData

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,