Skip to main content

InstructionOperand

Enum InstructionOperand 

Source
pub enum InstructionOperand<'a> {
Show 13 variants None, Immediate(i32), Local(u16), ConstantPool(ConstantPoolIndex), Member(MemberReference<'a>), InvokeInterface { method: ConstantPoolIndex, count: u8, }, InvokeDynamic { call_site: ConstantPoolIndex, }, Branch { relative: i32, target: i32, }, Ldc(LdcValueRef<'a>), Increment { local: u16, amount: i16, }, TableSwitch { default: SwitchTarget, low: i32, high: i32, targets: &'a [i32], base_offset: ByteOffset, }, LookupSwitch { default: SwitchTarget, pairs: &'a [(i32, i32)], base_offset: ByteOffset, }, MultiArray { class: ConstantPoolIndex, dimensions: u8, },
}
Expand description

A decoded JVM instruction operand.

Variants expose the operand representation used by the class file. In particular, indices are not rewritten into source-level names and switch targets retain their relative offsets.

Variants§

§

None

An instruction with no explicit operand.

§

Immediate(i32)

A signed immediate operand.

§

Local(u16)

A local-variable slot index.

§

ConstantPool(ConstantPoolIndex)

A direct constant-pool index.

§

Member(MemberReference<'a>)

A field or method reference.

§

InvokeInterface

An invokeinterface method index and its encoded argument count.

Fields

§method: ConstantPoolIndex

Index of the interface method reference.

§count: u8

Encoded argument count byte.

§

InvokeDynamic

An invokedynamic call-site index.

Fields

§call_site: ConstantPoolIndex

Index of the invokedynamic constant-pool entry.

§

Branch

A branch displacement and its calculated target offset.

Fields

§relative: i32

Signed displacement encoded by the instruction.

§target: i32

Offset obtained by adding relative to the instruction offset.

§

Ldc(LdcValueRef<'a>)

A value loaded by an ldc, ldc_w, or ldc2_w instruction.

§

Increment

A local-variable increment.

Fields

§local: u16

Local-variable slot index.

§amount: i16

Signed increment amount.

§

TableSwitch

A tableswitch operand.

Fields

§default: SwitchTarget

Default target displacement and absolute target.

§low: i32

Lowest matching key.

§high: i32

Highest matching key.

§targets: &'a [i32]

Relative target offsets in key order.

§base_offset: ByteOffset

Offset of the tableswitch instruction.

§

LookupSwitch

A lookupswitch operand.

Fields

§default: SwitchTarget

Default target displacement and absolute target.

§pairs: &'a [(i32, i32)]

Match-key and relative-target pairs in class-file order.

§base_offset: ByteOffset

Offset of the lookupswitch instruction.

§

MultiArray

A multianewarray class reference and dimension count.

Fields

§class: ConstantPoolIndex

Index of the array class entry.

§dimensions: u8

Number of dimensions to allocate.

Trait Implementations§

Source§

impl<'a> Clone for InstructionOperand<'a>

Source§

fn clone(&self) -> InstructionOperand<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for InstructionOperand<'a>

Source§

impl<'a> Debug for InstructionOperand<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.