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).
Putfield
Set instance field value (putfield).
Getstatic
Get static field value (getstatic).
Putstatic
Set static field value (putstatic).
Invokevirtual
Invoke instance method (invokevirtual).
Invokeinterface
Invoke interface method (invokeinterface).
Invokespecial
Invoke a special (constructor / private / super) method (invokespecial).
Invokestatic
Invoke a static method (invokestatic).
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).