- All Implemented Interfaces:
Serializable,Comparable<Opcode>,Constable
Describes the opcodes of the JVM instruction set, as described in JVMS .
This includes a few pseudo-opcodes modified by
wide.
An opcode describes the operation of an instruction.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionLoadreferencefrom array.Store intoreferencearray.Pushnull.Loadreferencefrom local variable.Loadreferencefrom local variable slot0.Loadreferencefrom local variable slot1.Loadreferencefrom local variable slot2.Loadreferencefrom local variable slot3.Loadreferencefrom local variable (wide index).Create new array ofreference.Returnreferencefrom method.Get length of array.Storereferenceinto local variable.Storereferenceinto local variable slot0.Storereferenceinto local variable slot1.Storereferenceinto local variable slot2.Storereferenceinto local variable slot3.Storereferenceinto local variable (wide index).Throw exception or error.Loadcharfrom array.Store intochararray.Check whether object is of given type.Adddouble.Loaddoublefrom array.Store intodoublearray.Comparedouble.Comparedouble.Pushdoubleconstant0.0D.Pushdoubleconstant1.0D.Dividedouble.Loaddoublefrom local variable.Loaddoublefrom local variable slot0.Loaddoublefrom local variable slot1.Loaddoublefrom local variable slot2.Loaddoublefrom local variable slot3.Loaddoublefrom local variable (wide index).Multiplydouble.Negatedouble.Remainderdouble.Returndoublefrom method.Storedoubleinto local variable.Storedoubleinto local variable slot0.Storedoubleinto local variable slot1.Storedoubleinto local variable slot2.Storedoubleinto local variable slot3.Storedoubleinto local variable (wide index).Subtractdouble.Duplicate the top operand stack value.Duplicate the top operand stack value and insert two values down.Duplicate the top operand stack value and insert two or three values down.Duplicate the top one or two operand stack values.Duplicate the top one or two operand stack values and insert two or three values down.Duplicate the top one or two operand stack values and insert two, three, or four values down.Addfloat.Loadfloatfrom array.Store intofloatarray.Comparefloat.Comparefloat.Pushfloatconstant0.0F.Pushfloatconstant1.0F.Pushfloatconstant2.0F.Dividefloat.Loadfloatfrom local variable.Loadfloatfrom local variable slot0.Loadfloatfrom local variable slot1.Loadfloatfrom local variable slot2.Loadfloatfrom local variable slot3.Loadfloatfrom local variable (wide index).Multiplyfloat.Negatefloat.Remainderfloat.Returnfloatfrom method.Storefloatinto local variable.Storefloatinto local variable slot0.Storefloatinto local variable slot1.Storefloatinto local variable slot2.Storefloatinto local variable slot3.Storefloatinto local variable (wide index).Subtractfloat.Fetch field from object.Getstaticfield from class.Branch always.Branch always (wide index).Addint.Loadintfrom array.Bitwise ANDint.Store intointarray.Pushintconstant0.Pushintconstant1.Pushintconstant2.Pushintconstant3.Pushintconstant4.Pushintconstant5.Pushintconstant-1.Divideint.Branch ifreferencecomparisonoperand1 == operand2succeeds.Branch ifreferencecomparisonoperand1 != operand2succeeds.Branch ifintcomparisonoperand1 == operand2succeeds.Branch ifintcomparisonoperand1 >= operand2succeeds.Branch ifintcomparisonoperand1 > operand2succeeds.Branch ifintcomparisonoperand1 <= operand2succeeds.Branch ifintcomparisonoperand1 < operand2succeeds.Branch ifintcomparisonoperand1 != operand2succeeds.Branch ifintcomparison== 0succeeds.Branch ifintcomparison>= 0succeeds.Branch ifintcomparison> 0succeeds.Branch ifintcomparison<= 0succeeds.Branch ifintcomparison< 0succeeds.Branch ifintcomparison!= 0succeeds.Branch ifreferenceis notnull.Branch ifreferenceisnull.Incrementintlocal variable by constant.Increment local variable by constant (wide index).Loadintfrom local variable.Loadintfrom local variable slot0.Loadintfrom local variable slot1.Loadintfrom local variable slot2.Loadintfrom local variable slot3.Loadintfrom local variable (wide index).Multiplyint.Negateint.Determine if object is of given type.Invoke a dynamically-computed call site.Invoke interface method.Invoke instance method; direct invocation of instance initialization methods and methods of the current class and its supertypes.Invoke a class (static) method.Invoke instance method; dispatch based on class.Bitwise ORint.Remainderint.Returnintfrom method.Shift leftint.Arithmetic shift rightint.Storeintinto local variable.Storeintinto local variable slot0.Storeintinto local variable slot1.Storeintinto local variable slot2.Storeintinto local variable slot3.Storeintinto local variable (wide index).Subtractint.Logical shift rightint.Bitwise XORint.(Discontinued) Jump subroutine; last used in major version 50.(Discontinued) Jump subroutine (wide index); last used in major version 50.Addlong.Loadlongfrom array.Bitwise ANDlong.Store intolongarray.Comparelong.Pushlongconstant0L.Pushlongconstant1L.Push item from run-time constant pool.Push item from run-time constant pool (wide index).Dividelong.Loadlongfrom local variable.Loadlongfrom local variable slot0.Loadlongfrom local variable slot1.Loadlongfrom local variable slot2.Loadlongfrom local variable slot3.Loadlongfrom local variable (wide index).Multiplylong.Negatelong.Access jump table by key match and jump.Bitwise ORlong.Remainderlong.Returnlongfrom method.Shift leftlong.Arithmetic shift rightlong.Storelonginto local variable.Storelonginto local variable slot0.Storelonginto local variable slot1.Storelonginto local variable slot2.Storelonginto local variable slot3.Storelonginto local variable (wide index).Subtractlong.Logical shift rightlong.Bitwise XORlong.Enter monitor for object.Exit monitor for object.Create new multidimensional array.Create new object.Create new array.Do nothing.Pop the top operand stack value.Pop the top one or two operand stack values.Set field in object.Setstaticfield in class.(Discontinued) Return from subroutine; last used in major version 50.(Discontinued) Return from subroutine (wide index); last used in major version 50.Returnvoidfrom method.Loadshortfrom array.Store intoshortarray.Swap the top two operand stack values.Access jump table by index and jump. -
Method Summary
Modifier and TypeMethodDescriptionintbytecode()Returns the opcode value.booleanisWide()Returns true if this is a pseudo-opcode modified by wide opcode.kind()Returns operation kind.intReturns size of the instruction in bytes if fixed, or -1 otherwise.static OpcodeReturns the enum constant of this class with the specified name.static Opcode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NOP
Do nothing.- See Also:
-
ACONST_NULL
Pushnull.- See Also:
-
ICONST_M1
Pushintconstant-1.- See Also:
-
ICONST_0
Pushintconstant0.- See Also:
-
ICONST_1
Pushintconstant1.- See Also:
-
ICONST_2
Pushintconstant2.- See Also:
-
ICONST_3
Pushintconstant3.- See Also:
-
ICONST_4
Pushintconstant4.- See Also:
-
ICONST_5
Pushintconstant5.- See Also:
-
LCONST_0
Pushlongconstant0L.- See Also:
-
LCONST_1
Pushlongconstant1L.- See Also:
-
FCONST_0
Pushfloatconstant0.0F.- See Also:
-
FCONST_1
Pushfloatconstant1.0F.- See Also:
-
FCONST_2
Pushfloatconstant2.0F.- See Also:
-
DCONST_0
Pushdoubleconstant0.0D.- See Also:
-
DCONST_1
Pushdoubleconstant1.0D.- See Also:
-
BIPUSH
- See Also:
-
SIPUSH
- See Also:
-
LDC
Push item from run-time constant pool.- See Also:
-
LDC_W
Push item from run-time constant pool (wide index).- See Also:
-
LDC2_W
- See Also:
-
ILOAD
Loadintfrom local variable.- See Also:
-
LLOAD
Loadlongfrom local variable.- See Also:
-
FLOAD
Loadfloatfrom local variable.- See Also:
-
DLOAD
Loaddoublefrom local variable.- See Also:
-
ALOAD
Loadreferencefrom local variable.- See Also:
-
ILOAD_0
Loadintfrom local variable slot0.- See Also:
-
ILOAD_1
Loadintfrom local variable slot1.- See Also:
-
ILOAD_2
Loadintfrom local variable slot2.- See Also:
-
ILOAD_3
Loadintfrom local variable slot3.- See Also:
-
LLOAD_0
Loadlongfrom local variable slot0.- See Also:
-
LLOAD_1
Loadlongfrom local variable slot1.- See Also:
-
LLOAD_2
Loadlongfrom local variable slot2.- See Also:
-
LLOAD_3
Loadlongfrom local variable slot3.- See Also:
-
FLOAD_0
Loadfloatfrom local variable slot0.- See Also:
-
FLOAD_1
Loadfloatfrom local variable slot1.- See Also:
-
FLOAD_2
Loadfloatfrom local variable slot2.- See Also:
-
FLOAD_3
Loadfloatfrom local variable slot3.- See Also:
-
DLOAD_0
Loaddoublefrom local variable slot0.- See Also:
-
DLOAD_1
Loaddoublefrom local variable slot1.- See Also:
-
DLOAD_2
Loaddoublefrom local variable slot2.- See Also:
-
DLOAD_3
Loaddoublefrom local variable slot3.- See Also:
-
ALOAD_0
Loadreferencefrom local variable slot0.- See Also:
-
ALOAD_1
Loadreferencefrom local variable slot1.- See Also:
-
ALOAD_2
Loadreferencefrom local variable slot2.- See Also:
-
ALOAD_3
Loadreferencefrom local variable slot3.- See Also:
-
IALOAD
Loadintfrom array.- See Also:
-
LALOAD
Loadlongfrom array.- See Also:
-
FALOAD
Loadfloatfrom array.- See Also:
-
DALOAD
Loaddoublefrom array.- See Also:
-
AALOAD
Loadreferencefrom array.- See Also:
-
BALOAD
- See Also:
-
CALOAD
Loadcharfrom array.- See Also:
-
SALOAD
Loadshortfrom array.- See Also:
-
ISTORE
Storeintinto local variable.- See Also:
-
LSTORE
Storelonginto local variable.- See Also:
-
FSTORE
Storefloatinto local variable.- See Also:
-
DSTORE
Storedoubleinto local variable.- See Also:
-
ASTORE
Storereferenceinto local variable. Can also store thereturnAddresstype.- See Also:
-
ISTORE_0
Storeintinto local variable slot0.- See Also:
-
ISTORE_1
Storeintinto local variable slot1.- See Also:
-
ISTORE_2
Storeintinto local variable slot2.- See Also:
-
ISTORE_3
Storeintinto local variable slot3.- See Also:
-
LSTORE_0
Storelonginto local variable slot0.- See Also:
-
LSTORE_1
Storelonginto local variable slot1.- See Also:
-
LSTORE_2
Storelonginto local variable slot2.- See Also:
-
LSTORE_3
Storelonginto local variable slot3.- See Also:
-
FSTORE_0
Storefloatinto local variable slot0.- See Also:
-
FSTORE_1
Storefloatinto local variable slot1.- See Also:
-
FSTORE_2
Storefloatinto local variable slot2.- See Also:
-
FSTORE_3
Storefloatinto local variable slot3.- See Also:
-
DSTORE_0
Storedoubleinto local variable slot0.- See Also:
-
DSTORE_1
Storedoubleinto local variable slot1.- See Also:
-
DSTORE_2
Storedoubleinto local variable slot2.- See Also:
-
DSTORE_3
Storedoubleinto local variable slot3.- See Also:
-
ASTORE_0
- See Also:
-
ASTORE_1
- See Also:
-
ASTORE_2
- See Also:
-
ASTORE_3
- See Also:
-
IASTORE
Store intointarray.- See Also:
-
LASTORE
Store intolongarray.- See Also:
-
FASTORE
Store intofloatarray.- See Also:
-
DASTORE
Store intodoublearray.- See Also:
-
AASTORE
Store intoreferencearray.- See Also:
-
BASTORE
- See Also:
-
CASTORE
Store intochararray.- See Also:
-
SASTORE
Store intoshortarray.- See Also:
-
POP
Pop the top operand stack value.- See Also:
-
POP2
Pop the top one or two operand stack values.- See Also:
-
DUP
Duplicate the top operand stack value.- See Also:
-
DUP_X1
Duplicate the top operand stack value and insert two values down.- See Also:
-
DUP_X2
Duplicate the top operand stack value and insert two or three values down.- See Also:
-
DUP2
Duplicate the top one or two operand stack values.- See Also:
-
DUP2_X1
Duplicate the top one or two operand stack values and insert two or three values down.- See Also:
-
DUP2_X2
Duplicate the top one or two operand stack values and insert two, three, or four values down.- See Also:
-
SWAP
Swap the top two operand stack values.- See Also:
-
IADD
Addint.- See Also:
-
LADD
Addlong.- See Also:
-
FADD
Addfloat.- See Also:
-
DADD
Adddouble.- See Also:
-
ISUB
Subtractint.- See Also:
-
LSUB
Subtractlong.- See Also:
-
FSUB
Subtractfloat.- See Also:
-
DSUB
Subtractdouble.- See Also:
-
IMUL
Multiplyint.- See Also:
-
LMUL
Multiplylong.- See Also:
-
FMUL
Multiplyfloat.- See Also:
-
DMUL
Multiplydouble.- See Also:
-
IDIV
Divideint.- See Also:
-
LDIV
Dividelong.- See Also:
-
FDIV
Dividefloat.- See Also:
-
DDIV
Dividedouble.- See Also:
-
IREM
Remainderint.- See Also:
-
LREM
Remainderlong.- See Also:
-
FREM
Remainderfloat.- See Also:
-
DREM
Remainderdouble.- See Also:
-
INEG
Negateint.- See Also:
-
LNEG
Negatelong.- See Also:
-
FNEG
Negatefloat.- See Also:
-
DNEG
Negatedouble.- See Also:
-
ISHL
Shift leftint.- See Also:
-
LSHL
Shift leftlong.- See Also:
-
ISHR
Arithmetic shift rightint.- See Also:
-
LSHR
Arithmetic shift rightlong.- See Also:
-
IUSHR
Logical shift rightint.- See Also:
-
LUSHR
Logical shift rightlong.- See Also:
-
IAND
Bitwise ANDint.- API Note:
- This may be used to implement
booleanAND. - See Also:
-
LAND
Bitwise ANDlong.- See Also:
-
IOR
Bitwise ORint.- API Note:
- This may be used to implement
booleanOR. - See Also:
-
LOR
Bitwise ORlong.- See Also:
-
IXOR
Bitwise XORint.- API Note:
- This may be used to implement
booleanXOR. - See Also:
-
LXOR
Bitwise XORlong.- See Also:
-
IINC
Incrementintlocal variable by constant.- See Also:
-
I2L
- See Also:
-
I2F
- See Also:
-
I2D
- See Also:
-
L2I
- See Also:
-
L2F
- See Also:
-
L2D
- See Also:
-
F2I
- See Also:
-
F2L
- See Also:
-
F2D
- See Also:
-
D2I
- See Also:
-
D2L
- See Also:
-
D2F
- See Also:
-
I2B
- See Also:
-
I2C
- See Also:
-
I2S
- See Also:
-
LCMP
Comparelong.- See Also:
-
FCMPL
- See Also:
-
FCMPG
- See Also:
-
DCMPL
- See Also:
-
DCMPG
- See Also:
-
IFEQ
Branch ifintcomparison== 0succeeds.- See Also:
-
IFNE
Branch ifintcomparison!= 0succeeds.- See Also:
-
IFLT
Branch ifintcomparison< 0succeeds.- See Also:
-
IFGE
Branch ifintcomparison>= 0succeeds.- See Also:
-
IFGT
Branch ifintcomparison> 0succeeds.- See Also:
-
IFLE
Branch ifintcomparison<= 0succeeds.- See Also:
-
IF_ICMPEQ
Branch ifintcomparisonoperand1 == operand2succeeds.- See Also:
-
IF_ICMPNE
Branch ifintcomparisonoperand1 != operand2succeeds.- See Also:
-
IF_ICMPLT
Branch ifintcomparisonoperand1 < operand2succeeds.- See Also:
-
IF_ICMPGE
Branch ifintcomparisonoperand1 >= operand2succeeds.- See Also:
-
IF_ICMPGT
Branch ifintcomparisonoperand1 > operand2succeeds.- See Also:
-
IF_ICMPLE
Branch ifintcomparisonoperand1 <= operand2succeeds.- See Also:
-
IF_ACMPEQ
Branch ifreferencecomparisonoperand1 == operand2succeeds.- See Also:
-
IF_ACMPNE
Branch ifreferencecomparisonoperand1 != operand2succeeds.- See Also:
-
GOTO
Branch always.- See Also:
-
JSR
(Discontinued) Jump subroutine; last used in major version 50.- See Also:
-
RET
(Discontinued) Return from subroutine; last used in major version 50.- See Also:
-
TABLESWITCH
Access jump table by index and jump.- See Also:
-
LOOKUPSWITCH
Access jump table by key match and jump.- See Also:
-
IRETURN
Returnintfrom method.- See Also:
-
LRETURN
Returnlongfrom method.- See Also:
-
FRETURN
Returnfloatfrom method.- See Also:
-
DRETURN
Returndoublefrom method.- See Also:
-
ARETURN
Returnreferencefrom method.- See Also:
-
RETURN
Returnvoidfrom method.- See Also:
-
GETSTATIC
Getstaticfield from class.- See Also:
-
PUTSTATIC
Setstaticfield in class.- See Also:
-
GETFIELD
Fetch field from object.- See Also:
-
PUTFIELD
Set field in object.- See Also:
-
INVOKEVIRTUAL
Invoke instance method; dispatch based on class.- See Also:
-
INVOKESPECIAL
Invoke instance method; direct invocation of instance initialization methods and methods of the current class and its supertypes.- See Also:
-
INVOKESTATIC
Invoke a class (static) method.- See Also:
-
INVOKEINTERFACE
Invoke interface method.- See Also:
-
INVOKEDYNAMIC
Invoke a dynamically-computed call site.- See Also:
-
NEW
Create new object.- See Also:
-
NEWARRAY
Create new array.- See Also:
-
ANEWARRAY
Create new array ofreference.- See Also:
-
ARRAYLENGTH
Get length of array.- See Also:
-
ATHROW
Throw exception or error.- See Also:
-
CHECKCAST
Check whether object is of given type.- See Also:
-
INSTANCEOF
Determine if object is of given type.- See Also:
-
MONITORENTER
Enter monitor for object.- See Also:
-
MONITOREXIT
Exit monitor for object.- See Also:
-
MULTIANEWARRAY
Create new multidimensional array.- See Also:
-
IFNULL
Branch ifreferenceisnull.- See Also:
-
IFNONNULL
Branch ifreferenceis notnull.- See Also:
-
GOTO_W
Branch always (wide index).- See Also:
-
JSR_W
(Discontinued) Jump subroutine (wide index); last used in major version 50.- See Also:
-
ILOAD_W
- See Also:
-
LLOAD_W
- See Also:
-
FLOAD_W
- See Also:
-
DLOAD_W
- See Also:
-
ALOAD_W
- See Also:
-
ISTORE_W
- See Also:
-
LSTORE_W
- See Also:
-
FSTORE_W
- See Also:
-
DSTORE_W
- See Also:
-
ASTORE_W
Storereferenceinto local variable (wide index). This is a wide-modified pseudo-opcode. Can also store thereturnAddresstype.- See Also:
-
RET_W
(Discontinued) Return from subroutine (wide index); last used in major version 50. This is a wide-modified pseudo-opcode.- See Also:
-
IINC_W
Increment local variable by constant (wide index). This is a wide-modified pseudo-opcode.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
bytecode
public int bytecode()Returns the opcode value. For wide pseudo-opcodes, returns the first 2 bytes of the instruction, which are the wide opcode196(0xC4) and the functional opcode, as a U2 value.- Returns:
- the opcode value
-
isWide
public boolean isWide()Returns true if this is a pseudo-opcode modified by wide opcode.wideextends local variable index by additional bytes.- Returns:
- true if this is a pseudo-opcode modified by wide opcode
- See Also:
-
sizeIfFixed
public int sizeIfFixed()Returns size of the instruction in bytes if fixed, or -1 otherwise. This size includes the opcode itself.- Returns:
- size of the instruction in bytes if fixed, or -1 otherwise
- See Also:
-
kind
Returns operation kind. Each kind of operation has its own modeling interface to model instructions belonging to that kind.- Returns:
- operation kind
-