Skip to main content

JvmOpcode

Enum JvmOpcode 

Source
pub enum JvmOpcode {
Show 79 variants AconstNull, Iconst(i32), Lconst(i64), Fconst(f32), Dconst(f64), Bipush(i8), Sipush(i16), Ldc(u16), Iload(u16), Lload(u16), Fload(u16), Dload(u16), Aload(u16), Istore(u16), Lstore(u16), Fstore(u16), Dstore(u16), Astore(u16), Iaload, Aaload, Iastore, Aastore, Pop, Pop2, Dup, Swap, Iadd, Isub, Imul, Idiv, Irem, Ineg, Ladd, Lsub, Lmul, Ldiv, Dadd, Dsub, Dmul, Ddiv, I2l, I2d, L2i, D2i, IfIcmpeq(i16), IfIcmpne(i16), IfIcmplt(i16), IfIcmpge(i16), IfIcmpgt(i16), IfIcmple(i16), Ifnull(i16), Ifnonnull(i16), Ifeq(i16), Ifne(i16), Lcmp, Goto(i16), Return_, Ireturn, Lreturn, Freturn, Dreturn, Areturn, Athrow, Getfield { class: String, name: String, descriptor: String, }, Putfield { class: String, name: String, descriptor: String, }, Getstatic { class: String, name: String, descriptor: String, }, Putstatic { class: String, name: String, descriptor: String, }, Invokevirtual { class: String, name: String, descriptor: String, }, Invokeinterface { class: String, name: String, descriptor: String, count: u8, }, Invokespecial { class: String, name: String, descriptor: String, }, Invokestatic { class: String, name: String, descriptor: String, }, New(String), Newarray(JvmType), Anewarray(String), Arraylength, Instanceof(String), Checkcast(String), Label(String), Iinc { index: u16, constant: i16, },
}
Expand description

A representative subset of JVM bytecode opcodes.

Names follow the JVM specification closely, with _ appended where the mnemonic is a Rust keyword (e.g. Return_).

Variants§

§

AconstNull

Push null reference onto the operand stack.

§

Iconst(i32)

Push int constant −1 through 5 (iconst_<i>).

§

Lconst(i64)

Push long constant 0 or 1 (lconst_<l>).

§

Fconst(f32)

Push float constant 0.0, 1.0, or 2.0 (fconst_<f>).

§

Dconst(f64)

Push double constant 0.0 or 1.0 (dconst_<d>).

§

Bipush(i8)

Push byte immediate as int (bipush).

§

Sipush(i16)

Push short immediate as int (sipush).

§

Ldc(u16)

Load constant from constant pool (ldc / ldc_w / ldc2_w).

§

Iload(u16)

Load int from local variable n (iload).

§

Lload(u16)

Load long from local variable n (lload).

§

Fload(u16)

Load float from local variable n (fload).

§

Dload(u16)

Load double from local variable n (dload).

§

Aload(u16)

Load reference from local variable n (aload).

§

Istore(u16)

Store int to local variable n (istore).

§

Lstore(u16)

Store long to local variable n (lstore).

§

Fstore(u16)

Store float to local variable n (fstore).

§

Dstore(u16)

Store double to local variable n (dstore).

§

Astore(u16)

Store reference to local variable n (astore).

§

Iaload

Load int from array (iaload).

§

Aaload

Load reference from array (aaload).

§

Iastore

Store int into array (iastore).

§

Aastore

Store reference into array (aastore).

§

Pop

Discard top value (pop).

§

Pop2

Discard top one or two values (pop2).

§

Dup

Duplicate the top value (dup).

§

Swap

Swap the two top values (swap).

§

Iadd

Add two int values (iadd).

§

Isub

Subtract two int values (isub).

§

Imul

Multiply two int values (imul).

§

Idiv

Divide two int values (idiv).

§

Irem

int remainder (irem).

§

Ineg

Negate int (ineg).

§

Ladd

Add two long values (ladd).

§

Lsub

Subtract two long values (lsub).

§

Lmul

Multiply two long values (lmul).

§

Ldiv

Divide two long values (ldiv).

§

Dadd

Add two double values (dadd).

§

Dsub

Subtract two double values (dsub).

§

Dmul

Multiply two double values (dmul).

§

Ddiv

Divide two double values (ddiv).

§

I2l

Convert int to long (i2l).

§

I2d

Convert int to double (i2d).

§

L2i

Convert long to int (l2i).

§

D2i

Convert double to int (d2i).

§

IfIcmpeq(i16)

Compare two int values and branch if equal (if_icmpeq).

§

IfIcmpne(i16)

Compare two int values and branch if not equal (if_icmpne).

§

IfIcmplt(i16)

Compare two int values and branch if less than (if_icmplt).

§

IfIcmpge(i16)

Compare two int values and branch if greater than or equal (if_icmpge).

§

IfIcmpgt(i16)

Compare two int values and branch if greater than (if_icmpgt).

§

IfIcmple(i16)

Compare two int values and branch if less than or equal (if_icmple).

§

Ifnull(i16)

Branch if reference is null (ifnull).

§

Ifnonnull(i16)

Branch if reference is not null (ifnonnull).

§

Ifeq(i16)

Branch if int is zero (ifeq).

§

Ifne(i16)

Branch if int is non-zero (ifne).

§

Lcmp

Compare two long values; push −1, 0, or 1 (lcmp).

§

Goto(i16)

Unconditional branch (goto).

§

Return_

Return void from method (return).

§

Ireturn

Return int from method (ireturn).

§

Lreturn

Return long from method (lreturn).

§

Freturn

Return float from method (freturn).

§

Dreturn

Return double from method (dreturn).

§

Areturn

Return reference from method (areturn).

§

Athrow

Throw an exception (athrow).

§

Getfield

Get instance field value (getfield).

Fields

§class: String
§name: String
§descriptor: String
§

Putfield

Set instance field value (putfield).

Fields

§class: String
§name: String
§descriptor: String
§

Getstatic

Get static field value (getstatic).

Fields

§class: String
§name: String
§descriptor: String
§

Putstatic

Set static field value (putstatic).

Fields

§class: String
§name: String
§descriptor: String
§

Invokevirtual

Invoke instance method (invokevirtual).

Fields

§class: String
§name: String
§descriptor: String
§

Invokeinterface

Invoke interface method (invokeinterface).

Fields

§class: String
§name: String
§descriptor: String
§count: u8
§

Invokespecial

Invoke a special (constructor / private / super) method (invokespecial).

Fields

§class: String
§name: String
§descriptor: String
§

Invokestatic

Invoke a static method (invokestatic).

Fields

§class: String
§name: String
§descriptor: String
§

New(String)

Create new object (new).

§

Newarray(JvmType)

Create new array of primitive type (newarray).

§

Anewarray(String)

Create new array of reference type (anewarray).

§

Arraylength

Get array length (arraylength).

§

Instanceof(String)

Check whether object is instance of class (instanceof).

§

Checkcast(String)

Cast object to class, throwing if incompatible (checkcast).

§

Label(String)

Label pseudo-instruction used for branch target resolution.

§

Iinc

Increment local variable by constant (iinc).

Fields

§index: u16
§constant: i16

Trait Implementations§

Source§

impl Clone for JvmOpcode

Source§

fn clone(&self) -> JvmOpcode

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for JvmOpcode

Source§

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

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

impl PartialEq for JvmOpcode

Source§

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

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

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 StructuralPartialEq for JvmOpcode

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.