Package com.tonic.util
Enum Opcode
- java.lang.Object
-
- java.lang.Enum<Opcode>
-
- com.tonic.util.Opcode
-
- All Implemented Interfaces:
Serializable,Comparable<Opcode>
public enum Opcode extends Enum<Opcode>
Enum representing all JVM opcodes as per Java 11 Specification.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AALOADPops an array reference and an int index, and pushes the reference element stored there.AASTOREPops an array reference, an int index and a reference value, and stores the value at that index.ACONST_NULLPushes a null reference onto the operand stack.ALOADLoads a reference from the local variable at the given index onto the operand stack.ALOAD_0Loads the reference in local variable 0 onto the operand stack; in an instance method this is the receiver.ALOAD_1Loads the reference in local variable 1 onto the operand stack.ALOAD_2Loads the reference in local variable 2 onto the operand stack.ALOAD_3Loads the reference in local variable 3 onto the operand stack.ANEWARRAYPops an int length and pushes a new null-filled array whose component type is the class named by the two-byte constant pool index.ARETURNPops a reference and returns it to the caller, discarding the rest of the frame.ARRAYLENGTHPops an array reference and pushes its length as an int.ASTOREPops a reference or return address and stores it in the local variable at the given index.ASTORE_0Pops a reference or return address and stores it in local variable 0.ASTORE_1Pops a reference or return address and stores it in local variable 1.ASTORE_2Pops a reference or return address and stores it in local variable 2.ASTORE_3Pops a reference or return address and stores it in local variable 3.ATHROWPops a throwable reference and throws it, transferring control to the matching handler or to the caller.BALOADPops a byte or boolean array reference and an int index, and pushes the element sign-extended to an int.BASTOREPops a byte or boolean array reference, an int index and an int value, and stores the value truncated to a byte.BIPUSHSign-extends the single-byte operand to an int and pushes it onto the operand stack.BREAKPOINTReserved for debugger use inside a JVM implementation; it never appears in a valid class file.CALOADPops a char array reference and an int index, and pushes the element zero-extended to an int.CASTOREPops a char array reference, an int index and an int value, and stores the value truncated to a char.CHECKCASTChecks the reference on top of the stack against the type named by the two-byte constant pool index, leaving it in place or throwing ClassCastException.D2FPops a double and pushes it narrowed to a float, which may lose precision or overflow to an infinity.D2IPops a double and pushes it converted to an int, rounding toward zero; NaN becomes 0 and out-of-range values saturate.D2LPops a double and pushes it converted to a long, rounding toward zero; NaN becomes 0 and out-of-range values saturate.DADDPops two doubles and pushes their IEEE 754 sum.DALOADPops an array reference and an int index, and pushes the double element stored there.DASTOREPops an array reference, an int index and a double value, and stores the value at that index.DCMPGPops two doubles and pushes the int -1, 0 or 1 comparing them, pushing 1 when either operand is NaN.DCMPLPops two doubles and pushes the int -1, 0 or 1 comparing them, pushing -1 when either operand is NaN.DCONST_0Pushes the double constant 0.0 onto the operand stack.DCONST_1Pushes the double constant 1.0 onto the operand stack.DDIVPops two doubles and pushes their IEEE 754 quotient; division by zero yields an infinity or NaN rather than an exception.DLOADLoads a double from the local variable at the given index onto the operand stack.DLOAD_0Loads the double in local variable 0 onto the operand stack.DLOAD_1Loads the double in local variable 1 onto the operand stack.DLOAD_2Loads the double in local variable 2 onto the operand stack.DLOAD_3Loads the double in local variable 3 onto the operand stack.DMULPops two doubles and pushes their IEEE 754 product.DNEGPops a double and pushes it with its sign bit flipped, which also negates zeros and NaN.DREMPops two doubles and pushes the remainder of a truncating division, taking the sign of the dividend.DRETURNPops a double and returns it to the caller, discarding the rest of the frame.DSTOREPops a double and stores it in the local variable at the given index.DSTORE_0Pops a double and stores it in local variable 0.DSTORE_1Pops a double and stores it in local variable 1.DSTORE_2Pops a double and stores it in local variable 2.DSTORE_3Pops a double and stores it in local variable 3.DSUBPops two doubles and pushes the lower one minus the upper one.DUPDuplicates the top value of the operand stack; the value must not be a long or double.DUP_X1Duplicates the top one-word value and inserts the copy beneath the value below it.DUP_X2Duplicates the top one-word value and inserts the copy beneath the next two one-word values, or beneath a single long or double.DUP2Duplicates either the top two one-word values or a single long or double.DUP2_X1Duplicates the top one or two words and inserts the copy beneath the one-word value below them.DUP2_X2Duplicates the top one or two words and inserts the copy beneath the two words below them.F2DPops a float and pushes it widened to a double without loss.F2IPops a float and pushes it converted to an int, rounding toward zero; NaN becomes 0 and out-of-range values saturate.F2LPops a float and pushes it converted to a long, rounding toward zero; NaN becomes 0 and out-of-range values saturate.FADDPops two floats and pushes their IEEE 754 sum.FALOADPops an array reference and an int index, and pushes the float element stored there.FASTOREPops an array reference, an int index and a float value, and stores the value at that index.FCMPGPops two floats and pushes the int -1, 0 or 1 comparing them, pushing 1 when either operand is NaN.FCMPLPops two floats and pushes the int -1, 0 or 1 comparing them, pushing -1 when either operand is NaN.FCONST_0Pushes the float constant 0.0f onto the operand stack.FCONST_1Pushes the float constant 1.0f onto the operand stack.FCONST_2Pushes the float constant 2.0f onto the operand stack.FDIVPops two floats and pushes their IEEE 754 quotient; division by zero yields an infinity or NaN rather than an exception.FLOADLoads a float from the local variable at the given index onto the operand stack.FLOAD_0Loads the float in local variable 0 onto the operand stack.FLOAD_1Loads the float in local variable 1 onto the operand stack.FLOAD_2Loads the float in local variable 2 onto the operand stack.FLOAD_3Loads the float in local variable 3 onto the operand stack.FMULPops two floats and pushes their IEEE 754 product.FNEGPops a float and pushes it with its sign bit flipped, which also negates zeros and NaN.FREMPops two floats and pushes the remainder of a truncating division, taking the sign of the dividend.FRETURNPops a float and returns it to the caller, discarding the rest of the frame.FSTOREPops a float and stores it in the local variable at the given index.FSTORE_0Pops a float and stores it in local variable 0.FSTORE_1Pops a float and stores it in local variable 1.FSTORE_2Pops a float and stores it in local variable 2.FSTORE_3Pops a float and stores it in local variable 3.FSUBPops two floats and pushes the lower one minus the upper one.GETFIELDPops an object reference and pushes the value of the instance field named by the two-byte constant pool index.GETSTATICPushes the current value of the static field named by the two-byte constant pool index.GOTOTransfers control unconditionally by the signed 16-bit offset from this instruction.GOTO_WTransfers control unconditionally by the signed 32-bit offset from this instruction.I2BPops an int, truncates it to eight bits and pushes the sign-extended result as an int.I2CPops an int, truncates it to sixteen bits and pushes the zero-extended result as an int.I2DPops an int and pushes it widened to a double without loss.I2FPops an int and pushes it converted to a float, which may lose precision for large values.I2LPops an int and pushes it widened to a long.I2SPops an int, truncates it to sixteen bits and pushes the sign-extended result as an int.IADDPops two ints and pushes their sum, wrapping around on overflow.IALOADPops an array reference and an int index, and pushes the int element stored there.IANDPops two ints and pushes their bitwise AND.IASTOREPops an array reference, an int index and an int value, and stores the value at that index.ICONST_0Pushes the int constant 0 onto the operand stack.ICONST_1Pushes the int constant 1 onto the operand stack.ICONST_2Pushes the int constant 2 onto the operand stack.ICONST_3Pushes the int constant 3 onto the operand stack.ICONST_4Pushes the int constant 4 onto the operand stack.ICONST_5Pushes the int constant 5 onto the operand stack.ICONST_M1Pushes the int constant -1 onto the operand stack.IDIVPops two ints and pushes the quotient truncated toward zero; throws ArithmeticException if the divisor is zero.IF_ACMPEQPops two references and branches by the signed 16-bit offset if they point to the same object, or are both null.IF_ACMPNEPops two references and branches by the signed 16-bit offset if they do not point to the same object.IF_ICMPEQPops two ints and branches by the signed 16-bit offset if they are equal.IF_ICMPGEPops two ints and branches by the signed 16-bit offset if the lower one is greater than or equal to the upper one.IF_ICMPGTPops two ints and branches by the signed 16-bit offset if the lower one is greater than the upper one.IF_ICMPLEPops two ints and branches by the signed 16-bit offset if the lower one is less than or equal to the upper one.IF_ICMPLTPops two ints and branches by the signed 16-bit offset if the lower one is less than the upper one.IF_ICMPNEPops two ints and branches by the signed 16-bit offset if they differ.IFEQPops an int and branches by the signed 16-bit offset if it is zero.IFGEPops an int and branches by the signed 16-bit offset if it is zero or positive.IFGTPops an int and branches by the signed 16-bit offset if it is positive.IFLEPops an int and branches by the signed 16-bit offset if it is zero or negative.IFLTPops an int and branches by the signed 16-bit offset if it is negative.IFNEPops an int and branches by the signed 16-bit offset if it is not zero.IFNONNULLPops a reference and branches by the signed 16-bit offset if it is not null.IFNULLPops a reference and branches by the signed 16-bit offset if it is null.IINCAdds the signed second operand byte to the int local variable named by the first operand byte, leaving the operand stack untouched.ILOADLoads an int from the local variable at the given index onto the operand stack.ILOAD_0Loads the int in local variable 0 onto the operand stack.ILOAD_1Loads the int in local variable 1 onto the operand stack.ILOAD_2Loads the int in local variable 2 onto the operand stack.ILOAD_3Loads the int in local variable 3 onto the operand stack.IMULPops two ints and pushes their product, wrapping around on overflow.INEGPops an int and pushes its arithmetic negation.INSTANCEOFPops a reference and pushes the int 1 if it is a non-null instance of the type named by the two-byte constant pool index, otherwise 0.INVOKEDYNAMICInvokes the dynamically linked target of a call site, running its bootstrap method on first execution.INVOKEINTERFACEPops the receiver and arguments and invokes an interface method resolved against the receiver's runtime class.INVOKESPECIALPops the receiver and arguments and invokes an instance method without virtual dispatch, as used for constructors, private methods and super calls.INVOKESTATICPops the arguments and invokes the named static method, initializing its class if needed.INVOKEVIRTUALPops the receiver and arguments and invokes an instance method selected by virtual dispatch on the receiver's runtime class.IORPops two ints and pushes their bitwise inclusive OR.IREMPops two ints and pushes the remainder of the division, taking the sign of the dividend; throws ArithmeticException if the divisor is zero.IRETURNPops an int and returns it to the caller, discarding the rest of the frame.ISHLPops an int shift distance and an int value, and pushes the value shifted left by the low five bits of the distance.ISHRPops an int shift distance and an int value, and pushes the value shifted right with sign extension by the low five bits of the distance.ISTOREPops an int and stores it in the local variable at the given index.ISTORE_0Pops an int and stores it in local variable 0.ISTORE_1Pops an int and stores it in local variable 1.ISTORE_2Pops an int and stores it in local variable 2.ISTORE_3Pops an int and stores it in local variable 3.ISUBPops two ints and pushes the lower one minus the upper one.IUSHRPops an int shift distance and an int value, and pushes the value shifted right with zero extension by the low five bits of the distance.IXORPops two ints and pushes their bitwise exclusive OR.JSRPushes the address of the following instruction and branches by the signed 16-bit offset.JSR_WWide form of JSR that branches by a signed 32-bit offset.L2DPops a long and pushes it converted to a double, which may lose precision.L2FPops a long and pushes it converted to a float, which may lose precision.L2IPops a long and pushes its low 32 bits as an int, discarding the high bits.LADDPops two longs and pushes their sum, wrapping around on overflow.LALOADPops an array reference and an int index, and pushes the long element stored there.LANDPops two longs and pushes their bitwise AND.LASTOREPops an array reference, an int index and a long value, and stores the value at that index.LCMPPops two longs and pushes the int -1, 0 or 1 according to whether the lower one is less than, equal to or greater than the upper one.LCONST_0Pushes the long constant 0 onto the operand stack.LCONST_1Pushes the long constant 1 onto the operand stack.LDCPushes a one-word constant - int, float, String, class, method type or method handle - from the constant pool entry named by the one-byte index.LDC_WWide form of LDC using a two-byte constant pool index, reaching entries above index 255.LDC2_WPushes the long or double held in the constant pool entry named by the two-byte index, occupying two operand stack slots.LDIVPops two longs and pushes the quotient truncated toward zero; throws ArithmeticException if the divisor is zero.LLOADLoads a long from the local variable at the given index onto the operand stack.LLOAD_0Loads the long in local variable 0 onto the operand stack.LLOAD_1Loads the long in local variable 1 onto the operand stack.LLOAD_2Loads the long in local variable 2 onto the operand stack.LLOAD_3Loads the long in local variable 3 onto the operand stack.LMULPops two longs and pushes their product, wrapping around on overflow.LNEGPops a long and pushes its arithmetic negation.LOOKUPSWITCHPops an int and branches through a sorted table of key-offset pairs, or to the default offset.LORPops two longs and pushes their bitwise inclusive OR.LREMPops two longs and pushes the remainder of the division, taking the sign of the dividend; throws ArithmeticException if the divisor is zero.LRETURNPops a long and returns it to the caller, discarding the rest of the frame.LSHLPops an int shift distance and a long value, and pushes the value shifted left by the low six bits of the distance.LSHRPops an int shift distance and a long value, and pushes the value shifted right with sign extension by the low six bits of the distance.LSTOREPops a long and stores it in the local variable at the given index.LSTORE_0Pops a long and stores it in local variable 0.LSTORE_1Pops a long and stores it in local variable 1.LSTORE_2Pops a long and stores it in local variable 2.LSTORE_3Pops a long and stores it in local variable 3.LSUBPops two longs and pushes the lower one minus the upper one.LUSHRPops an int shift distance and a long value, and pushes the value shifted right with zero extension by the low six bits of the distance.LXORPops two longs and pushes their bitwise exclusive OR.MONITORENTERPops an object reference and acquires its monitor, blocking until the monitor is available.MONITOREXITPops an object reference and releases one hold on its monitor.MULTIANEWARRAYPops one int length per dimension and pushes a new multidimensional array.NEWAllocates an uninitialized instance of the class named by the two-byte constant pool index and pushes the reference.NEWARRAYPops an int length and pushes a new zero-filled array of the primitive type selected by the one-byte type code.NOPDoes nothing.POPDiscards the top value of the operand stack; the value must not be a long or double.POP2Discards either the top two one-word values or a single long or double.PUTFIELDPops an object reference and a value, and stores the value into the instance field named by the two-byte constant pool index.PUTSTATICPops a value and stores it into the static field named by the two-byte constant pool index.RETResumes execution at the return address held in the local variable at the given index, the counterpart of JSR.RETURN_Returns from a method declared void, producing no value; the trailing underscore avoids the Java keyword.SALOADPops a short array reference and an int index, and pushes the element sign-extended to an int.SASTOREPops a short array reference, an int index and an int value, and stores the value truncated to a short.SIPUSHSign-extends the two-byte operand to an int and pushes it onto the operand stack.SWAPExchanges the top two values on the operand stack; neither may be a long or double.TABLESWITCHPops an int and branches through a table of offsets covering a contiguous key range, or to the default offset.UNKNOWNSentinel returned byfromCode(int)for a byte value that matches no defined opcode.WIDEPrefix that widens the following local variable instruction to a two-byte variable index, or an IINC to a two-byte index and a two-byte signed increment.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OpcodefromCode(int code)Retrieves the Opcode enum constant corresponding to the specified bytecode value.intgetCode()StringgetMnemonic()intgetOperandCount()static OpcodevalueOf(String name)Returns the enum constant of this type with the specified name.static Opcode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
NOP
public static final Opcode NOP
Does nothing.
-
ACONST_NULL
public static final Opcode ACONST_NULL
Pushes a null reference onto the operand stack.
-
ICONST_M1
public static final Opcode ICONST_M1
Pushes the int constant -1 onto the operand stack.
-
ICONST_0
public static final Opcode ICONST_0
Pushes the int constant 0 onto the operand stack.
-
ICONST_1
public static final Opcode ICONST_1
Pushes the int constant 1 onto the operand stack.
-
ICONST_2
public static final Opcode ICONST_2
Pushes the int constant 2 onto the operand stack.
-
ICONST_3
public static final Opcode ICONST_3
Pushes the int constant 3 onto the operand stack.
-
ICONST_4
public static final Opcode ICONST_4
Pushes the int constant 4 onto the operand stack.
-
ICONST_5
public static final Opcode ICONST_5
Pushes the int constant 5 onto the operand stack.
-
LCONST_0
public static final Opcode LCONST_0
Pushes the long constant 0 onto the operand stack.
-
LCONST_1
public static final Opcode LCONST_1
Pushes the long constant 1 onto the operand stack.
-
FCONST_0
public static final Opcode FCONST_0
Pushes the float constant 0.0f onto the operand stack.
-
FCONST_1
public static final Opcode FCONST_1
Pushes the float constant 1.0f onto the operand stack.
-
FCONST_2
public static final Opcode FCONST_2
Pushes the float constant 2.0f onto the operand stack.
-
DCONST_0
public static final Opcode DCONST_0
Pushes the double constant 0.0 onto the operand stack.
-
DCONST_1
public static final Opcode DCONST_1
Pushes the double constant 1.0 onto the operand stack.
-
BIPUSH
public static final Opcode BIPUSH
Sign-extends the single-byte operand to an int and pushes it onto the operand stack.
-
SIPUSH
public static final Opcode SIPUSH
Sign-extends the two-byte operand to an int and pushes it onto the operand stack.
-
LDC
public static final Opcode LDC
Pushes a one-word constant - int, float, String, class, method type or method handle - from the constant pool entry named by the one-byte index.
-
LDC_W
public static final Opcode LDC_W
Wide form of LDC using a two-byte constant pool index, reaching entries above index 255.
-
LDC2_W
public static final Opcode LDC2_W
Pushes the long or double held in the constant pool entry named by the two-byte index, occupying two operand stack slots.
-
ILOAD
public static final Opcode ILOAD
Loads an int from the local variable at the given index onto the operand stack.
-
LLOAD
public static final Opcode LLOAD
Loads a long from the local variable at the given index onto the operand stack.
-
FLOAD
public static final Opcode FLOAD
Loads a float from the local variable at the given index onto the operand stack.
-
DLOAD
public static final Opcode DLOAD
Loads a double from the local variable at the given index onto the operand stack.
-
ALOAD
public static final Opcode ALOAD
Loads a reference from the local variable at the given index onto the operand stack.
-
ILOAD_0
public static final Opcode ILOAD_0
Loads the int in local variable 0 onto the operand stack.
-
ILOAD_1
public static final Opcode ILOAD_1
Loads the int in local variable 1 onto the operand stack.
-
ILOAD_2
public static final Opcode ILOAD_2
Loads the int in local variable 2 onto the operand stack.
-
ILOAD_3
public static final Opcode ILOAD_3
Loads the int in local variable 3 onto the operand stack.
-
LLOAD_0
public static final Opcode LLOAD_0
Loads the long in local variable 0 onto the operand stack.
-
LLOAD_1
public static final Opcode LLOAD_1
Loads the long in local variable 1 onto the operand stack.
-
LLOAD_2
public static final Opcode LLOAD_2
Loads the long in local variable 2 onto the operand stack.
-
LLOAD_3
public static final Opcode LLOAD_3
Loads the long in local variable 3 onto the operand stack.
-
FLOAD_0
public static final Opcode FLOAD_0
Loads the float in local variable 0 onto the operand stack.
-
FLOAD_1
public static final Opcode FLOAD_1
Loads the float in local variable 1 onto the operand stack.
-
FLOAD_2
public static final Opcode FLOAD_2
Loads the float in local variable 2 onto the operand stack.
-
FLOAD_3
public static final Opcode FLOAD_3
Loads the float in local variable 3 onto the operand stack.
-
DLOAD_0
public static final Opcode DLOAD_0
Loads the double in local variable 0 onto the operand stack.
-
DLOAD_1
public static final Opcode DLOAD_1
Loads the double in local variable 1 onto the operand stack.
-
DLOAD_2
public static final Opcode DLOAD_2
Loads the double in local variable 2 onto the operand stack.
-
DLOAD_3
public static final Opcode DLOAD_3
Loads the double in local variable 3 onto the operand stack.
-
ALOAD_0
public static final Opcode ALOAD_0
Loads the reference in local variable 0 onto the operand stack; in an instance method this is the receiver.
-
ALOAD_1
public static final Opcode ALOAD_1
Loads the reference in local variable 1 onto the operand stack.
-
ALOAD_2
public static final Opcode ALOAD_2
Loads the reference in local variable 2 onto the operand stack.
-
ALOAD_3
public static final Opcode ALOAD_3
Loads the reference in local variable 3 onto the operand stack.
-
IALOAD
public static final Opcode IALOAD
Pops an array reference and an int index, and pushes the int element stored there.
-
LALOAD
public static final Opcode LALOAD
Pops an array reference and an int index, and pushes the long element stored there.
-
FALOAD
public static final Opcode FALOAD
Pops an array reference and an int index, and pushes the float element stored there.
-
DALOAD
public static final Opcode DALOAD
Pops an array reference and an int index, and pushes the double element stored there.
-
AALOAD
public static final Opcode AALOAD
Pops an array reference and an int index, and pushes the reference element stored there.
-
BALOAD
public static final Opcode BALOAD
Pops a byte or boolean array reference and an int index, and pushes the element sign-extended to an int.
-
CALOAD
public static final Opcode CALOAD
Pops a char array reference and an int index, and pushes the element zero-extended to an int.
-
SALOAD
public static final Opcode SALOAD
Pops a short array reference and an int index, and pushes the element sign-extended to an int.
-
ISTORE
public static final Opcode ISTORE
Pops an int and stores it in the local variable at the given index.
-
LSTORE
public static final Opcode LSTORE
Pops a long and stores it in the local variable at the given index.
-
FSTORE
public static final Opcode FSTORE
Pops a float and stores it in the local variable at the given index.
-
DSTORE
public static final Opcode DSTORE
Pops a double and stores it in the local variable at the given index.
-
ASTORE
public static final Opcode ASTORE
Pops a reference or return address and stores it in the local variable at the given index.
-
ISTORE_0
public static final Opcode ISTORE_0
Pops an int and stores it in local variable 0.
-
ISTORE_1
public static final Opcode ISTORE_1
Pops an int and stores it in local variable 1.
-
ISTORE_2
public static final Opcode ISTORE_2
Pops an int and stores it in local variable 2.
-
ISTORE_3
public static final Opcode ISTORE_3
Pops an int and stores it in local variable 3.
-
LSTORE_0
public static final Opcode LSTORE_0
Pops a long and stores it in local variable 0.
-
LSTORE_1
public static final Opcode LSTORE_1
Pops a long and stores it in local variable 1.
-
LSTORE_2
public static final Opcode LSTORE_2
Pops a long and stores it in local variable 2.
-
LSTORE_3
public static final Opcode LSTORE_3
Pops a long and stores it in local variable 3.
-
FSTORE_0
public static final Opcode FSTORE_0
Pops a float and stores it in local variable 0.
-
FSTORE_1
public static final Opcode FSTORE_1
Pops a float and stores it in local variable 1.
-
FSTORE_2
public static final Opcode FSTORE_2
Pops a float and stores it in local variable 2.
-
FSTORE_3
public static final Opcode FSTORE_3
Pops a float and stores it in local variable 3.
-
DSTORE_0
public static final Opcode DSTORE_0
Pops a double and stores it in local variable 0.
-
DSTORE_1
public static final Opcode DSTORE_1
Pops a double and stores it in local variable 1.
-
DSTORE_2
public static final Opcode DSTORE_2
Pops a double and stores it in local variable 2.
-
DSTORE_3
public static final Opcode DSTORE_3
Pops a double and stores it in local variable 3.
-
ASTORE_0
public static final Opcode ASTORE_0
Pops a reference or return address and stores it in local variable 0.
-
ASTORE_1
public static final Opcode ASTORE_1
Pops a reference or return address and stores it in local variable 1.
-
ASTORE_2
public static final Opcode ASTORE_2
Pops a reference or return address and stores it in local variable 2.
-
ASTORE_3
public static final Opcode ASTORE_3
Pops a reference or return address and stores it in local variable 3.
-
IASTORE
public static final Opcode IASTORE
Pops an array reference, an int index and an int value, and stores the value at that index.
-
LASTORE
public static final Opcode LASTORE
Pops an array reference, an int index and a long value, and stores the value at that index.
-
FASTORE
public static final Opcode FASTORE
Pops an array reference, an int index and a float value, and stores the value at that index.
-
DASTORE
public static final Opcode DASTORE
Pops an array reference, an int index and a double value, and stores the value at that index.
-
AASTORE
public static final Opcode AASTORE
Pops an array reference, an int index and a reference value, and stores the value at that index.
-
BASTORE
public static final Opcode BASTORE
Pops a byte or boolean array reference, an int index and an int value, and stores the value truncated to a byte.
-
CASTORE
public static final Opcode CASTORE
Pops a char array reference, an int index and an int value, and stores the value truncated to a char.
-
SASTORE
public static final Opcode SASTORE
Pops a short array reference, an int index and an int value, and stores the value truncated to a short.
-
POP
public static final Opcode POP
Discards the top value of the operand stack; the value must not be a long or double.
-
POP2
public static final Opcode POP2
Discards either the top two one-word values or a single long or double.
-
DUP
public static final Opcode DUP
Duplicates the top value of the operand stack; the value must not be a long or double.
-
DUP_X1
public static final Opcode DUP_X1
Duplicates the top one-word value and inserts the copy beneath the value below it.
-
DUP_X2
public static final Opcode DUP_X2
Duplicates the top one-word value and inserts the copy beneath the next two one-word values, or beneath a single long or double.
-
DUP2
public static final Opcode DUP2
Duplicates either the top two one-word values or a single long or double.
-
DUP2_X1
public static final Opcode DUP2_X1
Duplicates the top one or two words and inserts the copy beneath the one-word value below them.
-
DUP2_X2
public static final Opcode DUP2_X2
Duplicates the top one or two words and inserts the copy beneath the two words below them.
-
SWAP
public static final Opcode SWAP
Exchanges the top two values on the operand stack; neither may be a long or double.
-
IADD
public static final Opcode IADD
Pops two ints and pushes their sum, wrapping around on overflow.
-
LADD
public static final Opcode LADD
Pops two longs and pushes their sum, wrapping around on overflow.
-
FADD
public static final Opcode FADD
Pops two floats and pushes their IEEE 754 sum.
-
DADD
public static final Opcode DADD
Pops two doubles and pushes their IEEE 754 sum.
-
ISUB
public static final Opcode ISUB
Pops two ints and pushes the lower one minus the upper one.
-
LSUB
public static final Opcode LSUB
Pops two longs and pushes the lower one minus the upper one.
-
FSUB
public static final Opcode FSUB
Pops two floats and pushes the lower one minus the upper one.
-
DSUB
public static final Opcode DSUB
Pops two doubles and pushes the lower one minus the upper one.
-
IMUL
public static final Opcode IMUL
Pops two ints and pushes their product, wrapping around on overflow.
-
LMUL
public static final Opcode LMUL
Pops two longs and pushes their product, wrapping around on overflow.
-
FMUL
public static final Opcode FMUL
Pops two floats and pushes their IEEE 754 product.
-
DMUL
public static final Opcode DMUL
Pops two doubles and pushes their IEEE 754 product.
-
IDIV
public static final Opcode IDIV
Pops two ints and pushes the quotient truncated toward zero; throws ArithmeticException if the divisor is zero.
-
LDIV
public static final Opcode LDIV
Pops two longs and pushes the quotient truncated toward zero; throws ArithmeticException if the divisor is zero.
-
FDIV
public static final Opcode FDIV
Pops two floats and pushes their IEEE 754 quotient; division by zero yields an infinity or NaN rather than an exception.
-
DDIV
public static final Opcode DDIV
Pops two doubles and pushes their IEEE 754 quotient; division by zero yields an infinity or NaN rather than an exception.
-
IREM
public static final Opcode IREM
Pops two ints and pushes the remainder of the division, taking the sign of the dividend; throws ArithmeticException if the divisor is zero.
-
LREM
public static final Opcode LREM
Pops two longs and pushes the remainder of the division, taking the sign of the dividend; throws ArithmeticException if the divisor is zero.
-
FREM
public static final Opcode FREM
Pops two floats and pushes the remainder of a truncating division, taking the sign of the dividend.
-
DREM
public static final Opcode DREM
Pops two doubles and pushes the remainder of a truncating division, taking the sign of the dividend.
-
INEG
public static final Opcode INEG
Pops an int and pushes its arithmetic negation.
-
LNEG
public static final Opcode LNEG
Pops a long and pushes its arithmetic negation.
-
FNEG
public static final Opcode FNEG
Pops a float and pushes it with its sign bit flipped, which also negates zeros and NaN.
-
DNEG
public static final Opcode DNEG
Pops a double and pushes it with its sign bit flipped, which also negates zeros and NaN.
-
ISHL
public static final Opcode ISHL
Pops an int shift distance and an int value, and pushes the value shifted left by the low five bits of the distance.
-
LSHL
public static final Opcode LSHL
Pops an int shift distance and a long value, and pushes the value shifted left by the low six bits of the distance.
-
ISHR
public static final Opcode ISHR
Pops an int shift distance and an int value, and pushes the value shifted right with sign extension by the low five bits of the distance.
-
LSHR
public static final Opcode LSHR
Pops an int shift distance and a long value, and pushes the value shifted right with sign extension by the low six bits of the distance.
-
IUSHR
public static final Opcode IUSHR
Pops an int shift distance and an int value, and pushes the value shifted right with zero extension by the low five bits of the distance.
-
LUSHR
public static final Opcode LUSHR
Pops an int shift distance and a long value, and pushes the value shifted right with zero extension by the low six bits of the distance.
-
IAND
public static final Opcode IAND
Pops two ints and pushes their bitwise AND.
-
LAND
public static final Opcode LAND
Pops two longs and pushes their bitwise AND.
-
IOR
public static final Opcode IOR
Pops two ints and pushes their bitwise inclusive OR.
-
LOR
public static final Opcode LOR
Pops two longs and pushes their bitwise inclusive OR.
-
IXOR
public static final Opcode IXOR
Pops two ints and pushes their bitwise exclusive OR.
-
LXOR
public static final Opcode LXOR
Pops two longs and pushes their bitwise exclusive OR.
-
IINC
public static final Opcode IINC
Adds the signed second operand byte to the int local variable named by the first operand byte, leaving the operand stack untouched.
-
I2L
public static final Opcode I2L
Pops an int and pushes it widened to a long.
-
I2F
public static final Opcode I2F
Pops an int and pushes it converted to a float, which may lose precision for large values.
-
I2D
public static final Opcode I2D
Pops an int and pushes it widened to a double without loss.
-
L2I
public static final Opcode L2I
Pops a long and pushes its low 32 bits as an int, discarding the high bits.
-
L2F
public static final Opcode L2F
Pops a long and pushes it converted to a float, which may lose precision.
-
L2D
public static final Opcode L2D
Pops a long and pushes it converted to a double, which may lose precision.
-
F2I
public static final Opcode F2I
Pops a float and pushes it converted to an int, rounding toward zero; NaN becomes 0 and out-of-range values saturate.
-
F2L
public static final Opcode F2L
Pops a float and pushes it converted to a long, rounding toward zero; NaN becomes 0 and out-of-range values saturate.
-
F2D
public static final Opcode F2D
Pops a float and pushes it widened to a double without loss.
-
D2I
public static final Opcode D2I
Pops a double and pushes it converted to an int, rounding toward zero; NaN becomes 0 and out-of-range values saturate.
-
D2L
public static final Opcode D2L
Pops a double and pushes it converted to a long, rounding toward zero; NaN becomes 0 and out-of-range values saturate.
-
D2F
public static final Opcode D2F
Pops a double and pushes it narrowed to a float, which may lose precision or overflow to an infinity.
-
I2B
public static final Opcode I2B
Pops an int, truncates it to eight bits and pushes the sign-extended result as an int.
-
I2C
public static final Opcode I2C
Pops an int, truncates it to sixteen bits and pushes the zero-extended result as an int.
-
I2S
public static final Opcode I2S
Pops an int, truncates it to sixteen bits and pushes the sign-extended result as an int.
-
LCMP
public static final Opcode LCMP
Pops two longs and pushes the int -1, 0 or 1 according to whether the lower one is less than, equal to or greater than the upper one.
-
FCMPL
public static final Opcode FCMPL
Pops two floats and pushes the int -1, 0 or 1 comparing them, pushing -1 when either operand is NaN.
-
FCMPG
public static final Opcode FCMPG
Pops two floats and pushes the int -1, 0 or 1 comparing them, pushing 1 when either operand is NaN.
-
DCMPL
public static final Opcode DCMPL
Pops two doubles and pushes the int -1, 0 or 1 comparing them, pushing -1 when either operand is NaN.
-
DCMPG
public static final Opcode DCMPG
Pops two doubles and pushes the int -1, 0 or 1 comparing them, pushing 1 when either operand is NaN.
-
IFEQ
public static final Opcode IFEQ
Pops an int and branches by the signed 16-bit offset if it is zero.
-
IFNE
public static final Opcode IFNE
Pops an int and branches by the signed 16-bit offset if it is not zero.
-
IFLT
public static final Opcode IFLT
Pops an int and branches by the signed 16-bit offset if it is negative.
-
IFGE
public static final Opcode IFGE
Pops an int and branches by the signed 16-bit offset if it is zero or positive.
-
IFGT
public static final Opcode IFGT
Pops an int and branches by the signed 16-bit offset if it is positive.
-
IFLE
public static final Opcode IFLE
Pops an int and branches by the signed 16-bit offset if it is zero or negative.
-
IF_ICMPEQ
public static final Opcode IF_ICMPEQ
Pops two ints and branches by the signed 16-bit offset if they are equal.
-
IF_ICMPNE
public static final Opcode IF_ICMPNE
Pops two ints and branches by the signed 16-bit offset if they differ.
-
IF_ICMPLT
public static final Opcode IF_ICMPLT
Pops two ints and branches by the signed 16-bit offset if the lower one is less than the upper one.
-
IF_ICMPGE
public static final Opcode IF_ICMPGE
Pops two ints and branches by the signed 16-bit offset if the lower one is greater than or equal to the upper one.
-
IF_ICMPGT
public static final Opcode IF_ICMPGT
Pops two ints and branches by the signed 16-bit offset if the lower one is greater than the upper one.
-
IF_ICMPLE
public static final Opcode IF_ICMPLE
Pops two ints and branches by the signed 16-bit offset if the lower one is less than or equal to the upper one.
-
IF_ACMPEQ
public static final Opcode IF_ACMPEQ
Pops two references and branches by the signed 16-bit offset if they point to the same object, or are both null.
-
IF_ACMPNE
public static final Opcode IF_ACMPNE
Pops two references and branches by the signed 16-bit offset if they do not point to the same object.
-
GOTO
public static final Opcode GOTO
Transfers control unconditionally by the signed 16-bit offset from this instruction.
-
JSR
public static final Opcode JSR
Pushes the address of the following instruction and branches by the signed 16-bit offset.
-
RET
public static final Opcode RET
Resumes execution at the return address held in the local variable at the given index, the counterpart of JSR.
-
TABLESWITCH
public static final Opcode TABLESWITCH
Pops an int and branches through a table of offsets covering a contiguous key range, or to the default offset.
-
LOOKUPSWITCH
public static final Opcode LOOKUPSWITCH
Pops an int and branches through a sorted table of key-offset pairs, or to the default offset.
-
IRETURN
public static final Opcode IRETURN
Pops an int and returns it to the caller, discarding the rest of the frame.
-
LRETURN
public static final Opcode LRETURN
Pops a long and returns it to the caller, discarding the rest of the frame.
-
FRETURN
public static final Opcode FRETURN
Pops a float and returns it to the caller, discarding the rest of the frame.
-
DRETURN
public static final Opcode DRETURN
Pops a double and returns it to the caller, discarding the rest of the frame.
-
ARETURN
public static final Opcode ARETURN
Pops a reference and returns it to the caller, discarding the rest of the frame.
-
RETURN_
public static final Opcode RETURN_
Returns from a method declared void, producing no value; the trailing underscore avoids the Java keyword.
-
GETSTATIC
public static final Opcode GETSTATIC
Pushes the current value of the static field named by the two-byte constant pool index.
-
PUTSTATIC
public static final Opcode PUTSTATIC
Pops a value and stores it into the static field named by the two-byte constant pool index.
-
GETFIELD
public static final Opcode GETFIELD
Pops an object reference and pushes the value of the instance field named by the two-byte constant pool index.
-
PUTFIELD
public static final Opcode PUTFIELD
Pops an object reference and a value, and stores the value into the instance field named by the two-byte constant pool index.
-
INVOKEVIRTUAL
public static final Opcode INVOKEVIRTUAL
Pops the receiver and arguments and invokes an instance method selected by virtual dispatch on the receiver's runtime class.
-
INVOKESPECIAL
public static final Opcode INVOKESPECIAL
Pops the receiver and arguments and invokes an instance method without virtual dispatch, as used for constructors, private methods and super calls.
-
INVOKESTATIC
public static final Opcode INVOKESTATIC
Pops the arguments and invokes the named static method, initializing its class if needed.
-
INVOKEINTERFACE
public static final Opcode INVOKEINTERFACE
Pops the receiver and arguments and invokes an interface method resolved against the receiver's runtime class.
-
INVOKEDYNAMIC
public static final Opcode INVOKEDYNAMIC
Invokes the dynamically linked target of a call site, running its bootstrap method on first execution.
-
NEW
public static final Opcode NEW
Allocates an uninitialized instance of the class named by the two-byte constant pool index and pushes the reference.
-
NEWARRAY
public static final Opcode NEWARRAY
Pops an int length and pushes a new zero-filled array of the primitive type selected by the one-byte type code.
-
ANEWARRAY
public static final Opcode ANEWARRAY
Pops an int length and pushes a new null-filled array whose component type is the class named by the two-byte constant pool index.
-
ARRAYLENGTH
public static final Opcode ARRAYLENGTH
Pops an array reference and pushes its length as an int.
-
ATHROW
public static final Opcode ATHROW
Pops a throwable reference and throws it, transferring control to the matching handler or to the caller.
-
CHECKCAST
public static final Opcode CHECKCAST
Checks the reference on top of the stack against the type named by the two-byte constant pool index, leaving it in place or throwing ClassCastException.
-
INSTANCEOF
public static final Opcode INSTANCEOF
Pops a reference and pushes the int 1 if it is a non-null instance of the type named by the two-byte constant pool index, otherwise 0.
-
MONITORENTER
public static final Opcode MONITORENTER
Pops an object reference and acquires its monitor, blocking until the monitor is available.
-
MONITOREXIT
public static final Opcode MONITOREXIT
Pops an object reference and releases one hold on its monitor.
-
WIDE
public static final Opcode WIDE
Prefix that widens the following local variable instruction to a two-byte variable index, or an IINC to a two-byte index and a two-byte signed increment.
-
MULTIANEWARRAY
public static final Opcode MULTIANEWARRAY
Pops one int length per dimension and pushes a new multidimensional array.
-
IFNULL
public static final Opcode IFNULL
Pops a reference and branches by the signed 16-bit offset if it is null.
-
IFNONNULL
public static final Opcode IFNONNULL
Pops a reference and branches by the signed 16-bit offset if it is not null.
-
GOTO_W
public static final Opcode GOTO_W
Transfers control unconditionally by the signed 32-bit offset from this instruction.
-
JSR_W
public static final Opcode JSR_W
Wide form of JSR that branches by a signed 32-bit offset.
-
BREAKPOINT
public static final Opcode BREAKPOINT
Reserved for debugger use inside a JVM implementation; it never appears in a valid class file.
-
UNKNOWN
public static final Opcode UNKNOWN
Sentinel returned byfromCode(int)for a byte value that matches no defined opcode.
-
-
Method Detail
-
values
public static Opcode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Opcode c : Opcode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Opcode valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
getCode
public int getCode()
- Returns:
- the code
-
getMnemonic
public String getMnemonic()
- Returns:
- the mnemonic
-
getOperandCount
public int getOperandCount()
- Returns:
- the operand count
-
fromCode
public static Opcode fromCode(int code)
Retrieves the Opcode enum constant corresponding to the specified bytecode value. Indexes a lookup table, so this is safe to call once per instruction on a dispatch path.- Parameters:
code- the bytecode value- Returns:
- the corresponding Opcode, or UNKNOWN if the value names no opcode
-
-