Enum OpCode
- java.lang.Object
-
- java.lang.Enum<OpCode>
-
- xyz.cofe.trambda.bc.mth.OpCode
-
- All Implemented Interfaces:
Serializable,Comparable<OpCode>
public enum OpCode extends Enum<OpCode>
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AALOADload onto the stack a reference from an arrayAASTOREstore a reference in an arrayACONST_NULLpush a null reference onto the stackALOADload a reference onto the stack from a local variable #indexANEWARRAYcreate a new array of references of length count and component type identified by the class reference index (indexbyte1 << 8 | indexbyte2) in the constant poolARETURNreturn a reference from a methodARRAYLENGTHget the length of an arrayASTOREstore a reference into a local variable #indexASTORE_0store a reference into local variable 0ASTORE_1store a reference into local variable 1ASTORE_2store a reference into local variable 2ASTORE_3store a reference into local variable 3ATHROWthrows an error or exception (notice that the rest of the stack is cleared, leaving only a reference to the Throwable)BALOADload a byte or Boolean value from an arrayBASTOREstore a byte or Boolean value into an arrayBIPUSHpush a byte onto the stack as an integer valueCALOADload a char from an arrayCASTOREstore a char into an arrayCHECKCASTchecks whether an objectref is of a certain type, the class reference of which is in the constant pool at index (indexbyte1 << 8 | indexbyte2)D2Fconvert an double into a floatD2Iconvert an double into a intD2Lconvert an double into a longDADDadd two doublesDALOADload a double from an arrayDASTOREstore a double into an arrayDCMPGcompare two doubles, 1 on NaNDCMPLcompare two doubles, -1 on NaNDCONST_0push 0.0 (double) on the stackDCONST_1push 1.0 (double) on the stackDDIVdivide two doublesDLOADload a double value from a local variable #indexDMULmultiply two doublesDNEGnegate a doubleDREMget the remainder from a division between two doublesDRETURNreturn a double from a methodDSTOREstore a double value into a local variable #indexDSTORE_0store a double into local variable 0DSTORE_1store a double into local variable 1DSTORE_2store a double into local variable 2DSTORE_3store a double into local variable 3DSUBsubtract a double from anotherDUPduplicate the value on top of the stackDUP_X1insert a copy of the top value into the stack two values from the top. value1 and value2 must not be of the type double or long.DUP_X2insert a copy of the top value into the stack two (if value2 is double or long it takes up the entry of value3, too) or three values (if value2 is neither double nor long) from the topDUP2duplicate top two stack words (two values, if value1 is not double nor long; a single value, if value1 is double or long)DUP2_X1duplicate two words and insert beneath third word (see explanation above)DUP2_X2duplicate two words and insert beneath fourth wordF2Dconvert an float into a doubleF2Iconvert an float into a intF2Lconvert an float into a longFADDadd two floatsFALOADload a float from an arrayFASTOREstore a float in an arrayFCMPGcompare two floats, 1 on NaNFCMPLcompare two floats, -1 on NaNFCONST_0push 0.0f on the stackFCONST_1push 1.0f on the stackFCONST_2push 2.0f on the stackFDIVdivide two floatsFLOADload a float value from a local variable #indexFMULmultiply two floatsFNEGnegate a floatFREMget the remainder from a division between two floatsFRETURNreturn a floatFSTOREstore a float value into a local variable #indexFSTORE_0store a float value into local variable 0FSTORE_1store a float value into local variable 1FSTORE_2store a float value into local variable 2FSTORE_3store a float value into local variable 3FSUBsubtract two floatsGETFIELDget a field value of an object objectref, where the field is identified by field reference in the constant pool index (indexbyte1 << 8 | indexbyte2)GETSTATICget a static field value of a class, where the field is identified by field reference in the constant pool index (indexbyte1 << 8 | indexbyte2)GOTOgoes to another instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)GOTO_Wgoes to another instruction at branchoffset (signed int constructed from unsigned bytes branchbyte1 << 24 | branchbyte2 << 16 | branchbyte3 << 8 | branchbyte4)I2Bconvert an int into a byteI2Cconvert an int into a characterI2Dconvert an int into a doubleI2Fconvert an int into a floatI2Lconvert an int into a longI2Sconvert an int into a shortIADDadd two intsIALOADload an int from an arrayIANDperform a bitwise AND on two integersIASTOREstore an int into an arrayICONST_0load the int value 0 onto the stackICONST_1load the int value 1 onto the stackICONST_2load the int value 2 onto the stackICONST_3load the int value 3 onto the stackICONST_4load the int value 4 onto the stackICONST_5load the int value 5 onto the stackICONST_M1load the int value −1 onto the stackIDIVdivide two integersIF_ACMPEQif references are equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IF_ACMPNEif references are not equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IF_ICMPEQif ints are equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IF_ICMPGEif value1 is greater than or equal to value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IF_ICMPGTif value1 is greater than value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IF_ICMPLEif value1 is less than or equal to value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IF_ICMPLTif value1 is less than value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IF_ICMPNEif ints are not equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IFEQif value is 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IFGEif value is greater than or equal to 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IFGTif value is greater than 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IFLEif value is less than or equal to 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IFLTif value is less than 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IFNEif value is not 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IFNONNULLОфициальная дока if value is not null, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IFNULLif value is null, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)IINCincrement local variable #index by signed byte constILOADload an int value from a local variable #indexIMULmultiply two integersINEGnegate intINSTANCEOFdetermines if an object objectref is of a given type, identified by class reference index in constant pool (indexbyte1 << 8 | indexbyte2)INVOKEDYNAMICinvokes a dynamic method and puts the result on the stack (might be void); the method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)INVOKEINTERFACEinvokes an interface method on object objectref and puts the result on the stack (might be void); the interface method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)INVOKESPECIALinvoke instance method on object objectref and puts the result on the stack (might be void); the method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)INVOKESTATICinvoke a static method and puts the result on the stack (might be void); the method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)INVOKEVIRTUALinvoke virtual method on object objectref and puts the result on the stack (might be void); the method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)IORbitwise int ORIREMlogical int remainderIRETURNreturn an integer from a methodISHLint shift leftISHRint arithmetic shift rightISTOREload a reference onto the stack from a local variable #indexISUBint subtractIUSHRint logical shift rightIXORint xorJSRjump to subroutine at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2) and place the return address on the stackL2Dconvert an long into a doubleL2Fconvert an long into a floatL2Iconvert an long into a intLADDadd two longsLALOADload a long from an arrayLANDbitwise AND of two longsLASTOREstore a long to an arrayLCMPpush 0 if the two longs are the same, 1 if value1 is greater than value2, -1 otherwiseLCONST_0push 0L (the number zero with type long) onto the stackLCONST_1push 1L (the number one with type long) onto the stackLDCpush a constant #index from a constant pool (String, int, float, Class, java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, or a dynamically-computed constant) onto the stackLDC_Wpush a constant #index from a constant pool (String, int, float, Class, java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, or a dynamically-computed constant) onto the stack (wide index is constructed as indexbyte1 << 8 | indexbyte2)LDC2_Wpush a constant #index from a constant pool (double, long, or a dynamically-computed constant) onto the stack (wide index is constructed as indexbyte1 << 8 | indexbyte2)LDIVdivide two longsLLOADload a long value from a local variable #indexLMULmultiply two longsLNEGnegate a longLOOKUPSWITCHa target address is looked up from a table using a key and execution continues from the instruction at that addressLORbitwise OR of two longsLREMremainder of division of two longsLRETURNreturn a long valueLSHLbitwise shift left of a long value1 by int value2 positionsLSHRbitwise shift right of a long value1 by int value2 positionsLSTOREstore a long value in a local variable #indexLSTORE_0store a long value in a local variable 0LSTORE_1store a long value in a local variable 1LSTORE_2store a long value in a local variable 2LSTORE_3store a long value in a local variable 3LSUBsubtract two longsLUSHRbitwise shift right of a long value1 by int value2 positions, unsignedLXORbitwise XOR of two longsMONITORENTERenter monitor for object ("grab the lock" – start of synchronized() section)MONITOREXITexit monitor for object ("release the lock" – end of synchronized() section)MULTIANEWARRAYcreate a new array of dimensions dimensions of type identified by class reference in constant pool index (indexbyte1 << 8 | indexbyte2); the sizes of each dimension is identified by count1, [count2, etc.]NEWcreate new object of type identified by class reference in constant pool index (indexbyte1 << 8 | indexbyte2)NEWARRAYcreate new array with count elements of primitive type identified by atypeNOPperform no operationPOPdiscard the top value on the stackPOP2discard the top two values on the stack (or one value, if it is a double or long)PUTFIELDset field to value in an object objectref, where the field is identified by a field reference index in constant pool (indexbyte1 << 8 | indexbyte2)PUTSTATICset static field to value in a class, where the field is identified by a field reference index in constant pool (indexbyte1 << 8 | indexbyte2)RETcontinue execution from address taken from a local variable #index (the asymmetry with jsr is intentional)RETURNreturn void from methodSALOADload short from arraySASTOREstore short to arraySIPUSHpush a short onto the stack as an integer valueSWAPswaps two top words on the stack (note that value1 and value2 must not be double or long)TABLESWITCHcontinue execution from an address in the table at offset index
-
Field Summary
Fields Modifier and Type Field Description intcode
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<OpCode>code(int c)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
perform no operationСтек [No change]
-
ACONST_NULL
public static final OpCode ACONST_NULL
push a null reference onto the stackСтек → null
-
ICONST_M1
public static final OpCode ICONST_M1
load the int value −1 onto the stackСтек → -1
-
ICONST_0
public static final OpCode ICONST_0
load the int value 0 onto the stackСтек → 0
-
ICONST_1
public static final OpCode ICONST_1
load the int value 1 onto the stackСтек → 1
-
ICONST_2
public static final OpCode ICONST_2
load the int value 2 onto the stackСтек → 2
-
ICONST_3
public static final OpCode ICONST_3
load the int value 3 onto the stackСтек → 3
-
ICONST_4
public static final OpCode ICONST_4
load the int value 4 onto the stackСтек → 4
-
ICONST_5
public static final OpCode ICONST_5
load the int value 5 onto the stackСтек → 5
-
LCONST_0
public static final OpCode LCONST_0
push 0L (the number zero with type long) onto the stackСтек → 0
-
LCONST_1
public static final OpCode LCONST_1
push 1L (the number one with type long) onto the stackСтек → 1
-
FCONST_0
public static final OpCode FCONST_0
push 0.0f on the stackСтек → 0f
-
FCONST_1
public static final OpCode FCONST_1
push 1.0f on the stackСтек → 1f
-
FCONST_2
public static final OpCode FCONST_2
push 2.0f on the stackСтек → 2f
-
DCONST_0
public static final OpCode DCONST_0
push 0.0 (double) on the stackСтек → 0.0
-
DCONST_1
public static final OpCode DCONST_1
push 1.0 (double) on the stackСтек → 1.0
-
BIPUSH
public static final OpCode BIPUSH
push a byte onto the stack as an integer valueПараметры 1: byte
Стек → value
-
SIPUSH
public static final OpCode SIPUSH
push a short onto the stack as an integer valueПараметры 2: byte1, byte2
Стек → value
-
LDC
public static final OpCode LDC
push a constant #index from a constant pool (String, int, float, Class, java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, or a dynamically-computed constant) onto the stackПараметры 1: index
Стек → value
-
LDC_W
public static final OpCode LDC_W
push a constant #index from a constant pool (String, int, float, Class, java.lang.invoke.MethodType, java.lang.invoke.MethodHandle, or a dynamically-computed constant) onto the stack (wide index is constructed as indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек → value
-
LDC2_W
public static final OpCode LDC2_W
push a constant #index from a constant pool (double, long, or a dynamically-computed constant) onto the stack (wide index is constructed as indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек → value
-
ILOAD
public static final OpCode ILOAD
load an int value from a local variable #indexПараметры 1: index
Стек → value
-
LLOAD
public static final OpCode LLOAD
load a long value from a local variable #indexПараметры 1: index
Стек → value
-
FLOAD
public static final OpCode FLOAD
load a float value from a local variable #indexПараметры 1: index
Стек → value
-
DLOAD
public static final OpCode DLOAD
load a double value from a local variable #indexПараметры 1: index
Стек → value
-
ALOAD
public static final OpCode ALOAD
load a reference onto the stack from a local variable #indexПараметры 1: index
Стек → objectref
-
IALOAD
public static final OpCode IALOAD
load an int from an arrayСтек arrayref, index → value
-
LALOAD
public static final OpCode LALOAD
load a long from an arrayСтек arrayref, index → value
-
FALOAD
public static final OpCode FALOAD
load a float from an arrayСтек arrayref, index → value
-
DALOAD
public static final OpCode DALOAD
load a double from an arrayСтек arrayref, index → value
-
AALOAD
public static final OpCode AALOAD
load onto the stack a reference from an arrayСтек arrayref, index → value
-
BALOAD
public static final OpCode BALOAD
load a byte or Boolean value from an arrayСтек arrayref, index → value
-
CALOAD
public static final OpCode CALOAD
load a char from an arrayСтек arrayref, index → value
-
SALOAD
public static final OpCode SALOAD
load short from arrayСтек arrayref, index → value
-
ISTORE
public static final OpCode ISTORE
load a reference onto the stack from a local variable #indexПараметры 1: index
Стек → objectref
-
LSTORE
public static final OpCode LSTORE
store a long value in a local variable #indexПараметры 1: index
Стек value →
-
LSTORE_0
public static final OpCode LSTORE_0
store a long value in a local variable 0Стек value →
-
LSTORE_1
public static final OpCode LSTORE_1
store a long value in a local variable 1Стек value →
-
LSTORE_2
public static final OpCode LSTORE_2
store a long value in a local variable 2Стек value →
-
LSTORE_3
public static final OpCode LSTORE_3
store a long value in a local variable 3Стек value →
-
FSTORE
public static final OpCode FSTORE
store a float value into a local variable #indexПараметры 1: index
Стек value →
-
FSTORE_0
public static final OpCode FSTORE_0
store a float value into local variable 0Стек value →
-
FSTORE_1
public static final OpCode FSTORE_1
store a float value into local variable 1Стек value →
-
FSTORE_2
public static final OpCode FSTORE_2
store a float value into local variable 2Стек value →
-
FSTORE_3
public static final OpCode FSTORE_3
store a float value into local variable 3Стек value →
-
DSTORE
public static final OpCode DSTORE
store a double value into a local variable #indexПараметры 1: index
Стек value →
-
DSTORE_0
public static final OpCode DSTORE_0
store a double into local variable 0Параметры 1: index
Стек value →
-
DSTORE_1
public static final OpCode DSTORE_1
store a double into local variable 1Параметры
Стек value →
-
DSTORE_2
public static final OpCode DSTORE_2
store a double into local variable 2Стек value →
-
DSTORE_3
public static final OpCode DSTORE_3
store a double into local variable 3Стек value →
-
ASTORE
public static final OpCode ASTORE
store a reference into a local variable #indexПараметры 1: index
Стек objectref →
-
ASTORE_0
public static final OpCode ASTORE_0
store a reference into local variable 0Стек objectref →
-
ASTORE_1
public static final OpCode ASTORE_1
store a reference into local variable 1Стек objectref →
-
ASTORE_2
public static final OpCode ASTORE_2
store a reference into local variable 2Стек objectref →
-
ASTORE_3
public static final OpCode ASTORE_3
store a reference into local variable 3Стек objectref →
-
IASTORE
public static final OpCode IASTORE
store an int into an arrayСтек arrayref, index, value →
-
LASTORE
public static final OpCode LASTORE
store a long to an arrayСтек arrayref, index, value →
-
FASTORE
public static final OpCode FASTORE
store a float in an arrayСтек arrayref, index, value →
-
DASTORE
public static final OpCode DASTORE
store a double into an arrayСтек arrayref, index, value →
-
AASTORE
public static final OpCode AASTORE
store a reference in an arrayСтек arrayref, index, value →
-
BASTORE
public static final OpCode BASTORE
store a byte or Boolean value into an arrayСтек arrayref, index, value →
-
CASTORE
public static final OpCode CASTORE
store a char into an arrayСтек arrayref, index, value →
-
SASTORE
public static final OpCode SASTORE
store short to arrayСтек arrayref, index, value →
-
POP
public static final OpCode POP
discard the top value on the stackСтек value →
-
POP2
public static final OpCode POP2
discard the top two values on the stack (or one value, if it is a double or long)Стек {value2, value1} →
-
DUP
public static final OpCode DUP
duplicate the value on top of the stackСтек value → value, value
-
DUP_X1
public static final OpCode DUP_X1
insert a copy of the top value into the stack two values from the top. value1 and value2 must not be of the type double or long.Стек value2, value1 → value1, value2, value1
-
DUP_X2
public static final OpCode DUP_X2
insert a copy of the top value into the stack two (if value2 is double or long it takes up the entry of value3, too) or three values (if value2 is neither double nor long) from the topСтек value3, value2, value1 → value1, value3, value2, value1
-
DUP2
public static final OpCode DUP2
duplicate top two stack words (two values, if value1 is not double nor long; a single value, if value1 is double or long)Стек {value2, value1} → {value2, value1}, {value2, value1}
-
DUP2_X1
public static final OpCode DUP2_X1
duplicate two words and insert beneath third word (see explanation above)Стек value3, {value2, value1} → {value2, value1}, value3, {value2, value1}
-
DUP2_X2
public static final OpCode DUP2_X2
duplicate two words and insert beneath fourth wordСтек {value4, value3}, {value2, value1} → {value2, value1}, {value4, value3}, {value2, value1}
-
SWAP
public static final OpCode SWAP
swaps two top words on the stack (note that value1 and value2 must not be double or long)Стек value2, value1 → value1, value2
-
IADD
public static final OpCode IADD
add two intsСтек value1, value2 → result
-
LADD
public static final OpCode LADD
add two longsСтек value1, value2 → result
-
FADD
public static final OpCode FADD
add two floatsСтек value1, value2 → result
-
DADD
public static final OpCode DADD
add two doublesСтек value1, value2 → result
-
ISUB
public static final OpCode ISUB
int subtractСтек value1, value2 → result
-
LSUB
public static final OpCode LSUB
subtract two longsСтек value1, value2 → result
-
FSUB
public static final OpCode FSUB
subtract two floatsСтек value1, value2 → result
-
DSUB
public static final OpCode DSUB
subtract a double from anotherСтек value1, value2 → result
-
IMUL
public static final OpCode IMUL
multiply two integersСтек value1, value2 → result
-
LMUL
public static final OpCode LMUL
multiply two longsСтек value1, value2 → result
-
FMUL
public static final OpCode FMUL
multiply two floatsСтек value1, value2 → result
-
DMUL
public static final OpCode DMUL
multiply two doublesСтек value1, value2 → result
-
IDIV
public static final OpCode IDIV
divide two integersСтек value1, value2 → result
-
LDIV
public static final OpCode LDIV
divide two longsСтек value1, value2 → result
-
FDIV
public static final OpCode FDIV
divide two floatsСтек value1, value2 → result
-
DDIV
public static final OpCode DDIV
divide two doublesСтек value1, value2 → result
-
IREM
public static final OpCode IREM
logical int remainderСтек value1, value2 → result
-
LREM
public static final OpCode LREM
remainder of division of two longsСтек value1, value2 → result
-
FREM
public static final OpCode FREM
get the remainder from a division between two floatsСтек value1, value2 → result
-
DREM
public static final OpCode DREM
get the remainder from a division between two doublesСтек value1, value2 → result
-
INEG
public static final OpCode INEG
negate intСтек value → result
-
LNEG
public static final OpCode LNEG
negate a longСтек value → result
-
FNEG
public static final OpCode FNEG
negate a floatСтек value → result
-
DNEG
public static final OpCode DNEG
negate a doubleСтек value → result
-
ISHL
public static final OpCode ISHL
int shift leftСтек value1, value2 → result
-
LSHL
public static final OpCode LSHL
bitwise shift left of a long value1 by int value2 positionsСтек value1, value2 → result
-
ISHR
public static final OpCode ISHR
int arithmetic shift rightСтек value1, value2 → result
-
LSHR
public static final OpCode LSHR
bitwise shift right of a long value1 by int value2 positionsСтек value1, value2 → result
-
IUSHR
public static final OpCode IUSHR
int logical shift rightСтек value1, value2 → result
-
LUSHR
public static final OpCode LUSHR
bitwise shift right of a long value1 by int value2 positions, unsignedСтек value1, value2 → result
-
IAND
public static final OpCode IAND
perform a bitwise AND on two integersСтек value1, value2 → result
-
LAND
public static final OpCode LAND
bitwise AND of two longsСтек value1, value2 → result
-
IOR
public static final OpCode IOR
bitwise int ORСтек value1, value2 → result
-
LOR
public static final OpCode LOR
bitwise OR of two longsСтек value1, value2 → result
-
IXOR
public static final OpCode IXOR
int xorСтек value1, value2 → result
-
LXOR
public static final OpCode LXOR
bitwise XOR of two longsСтек value1, value2 → result
-
IINC
public static final OpCode IINC
increment local variable #index by signed byte constПараметры 2: index, const
Стек [No change]
-
I2L
public static final OpCode I2L
convert an int into a longСтек value → result
-
I2F
public static final OpCode I2F
convert an int into a floatСтек value → result
-
I2D
public static final OpCode I2D
convert an int into a doubleСтек value → result
-
L2I
public static final OpCode L2I
convert an long into a intСтек value → result
-
L2F
public static final OpCode L2F
convert an long into a floatСтек value → result
-
L2D
public static final OpCode L2D
convert an long into a doubleСтек value → result
-
F2I
public static final OpCode F2I
convert an float into a intСтек value → result
-
F2L
public static final OpCode F2L
convert an float into a longСтек value → result
-
F2D
public static final OpCode F2D
convert an float into a doubleСтек value → result
-
D2I
public static final OpCode D2I
convert an double into a intСтек value → result
-
D2L
public static final OpCode D2L
convert an double into a longСтек value → result
-
D2F
public static final OpCode D2F
convert an double into a floatСтек value → result
-
I2B
public static final OpCode I2B
convert an int into a byteСтек value → result
-
I2C
public static final OpCode I2C
convert an int into a characterСтек value → result
-
I2S
public static final OpCode I2S
convert an int into a shortСтек value → result
-
LCMP
public static final OpCode LCMP
push 0 if the two longs are the same, 1 if value1 is greater than value2, -1 otherwiseСтек value1, value2 → result
-
FCMPL
public static final OpCode FCMPL
compare two floats, -1 on NaNСтек value1, value2 → result
-
FCMPG
public static final OpCode FCMPG
compare two floats, 1 on NaNСтек value1, value2 → result
-
DCMPL
public static final OpCode DCMPL
compare two doubles, -1 on NaNСтек value1, value2 → result
-
DCMPG
public static final OpCode DCMPG
compare two doubles, 1 on NaNСтек value1, value2 → result
-
IFEQ
public static final OpCode IFEQ
if value is 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value →
-
IFNE
public static final OpCode IFNE
if value is not 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value →
-
IFLT
public static final OpCode IFLT
if value is less than 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value →
-
IFGE
public static final OpCode IFGE
if value is greater than or equal to 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value →
-
IFGT
public static final OpCode IFGT
if value is greater than 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value →
-
IFLE
public static final OpCode IFLE
if value is less than or equal to 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value →
-
IF_ICMPEQ
public static final OpCode IF_ICMPEQ
if ints are equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value1, value2 →
-
IF_ICMPNE
public static final OpCode IF_ICMPNE
if ints are not equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value1, value2 →
-
IF_ICMPLT
public static final OpCode IF_ICMPLT
if value1 is less than value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value1, value2 →
-
IF_ICMPGE
public static final OpCode IF_ICMPGE
if value1 is greater than or equal to value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value1, value2 →
-
IF_ICMPGT
public static final OpCode IF_ICMPGT
if value1 is greater than value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value1, value2 →
-
IF_ICMPLE
public static final OpCode IF_ICMPLE
if value1 is less than or equal to value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value1, value2 →
-
IF_ACMPEQ
public static final OpCode IF_ACMPEQ
if references are equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value1, value2 →
-
IF_ACMPNE
public static final OpCode IF_ACMPNE
if references are not equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value1, value2 →
-
GOTO
public static final OpCode GOTO
goes to another instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек [no change]
-
GOTO_W
public static final OpCode GOTO_W
goes to another instruction at branchoffset (signed int constructed from unsigned bytes branchbyte1 << 24 | branchbyte2 << 16 | branchbyte3 << 8 | branchbyte4)Параметры 4: branchbyte1, branchbyte2, branchbyte3, branchbyte4
Стек [no change]
-
JSR
public static final OpCode JSR
jump to subroutine at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2) and place the return address on the stackПараметры 2: branchbyte1, branchbyte2
Стек → address
DescriptionThe address of the opcode of the instruction immediately following this jsr instruction is pushed onto the operand stack as a value of type returnAddress. The unsigned branchbyte1 and branchbyte2 are used to construct a signed 16-bit offset, where the offset is (branchbyte1 << 8) | branchbyte2. Execution proceeds at that offset from the address of this jsr instruction. The target address must be that of an opcode of an instruction within the method that contains this jsr instruction.
Notes
Note that jsr pushes the address onto the operand stack and ret (§ret) gets it out of a local variable. This asymmetry is intentional.
In Oracle's implementation of a compiler for the Java programming language prior to Java SE 6, the jsr instruction was used with the ret instruction in the implementation of the finally clause (§3.13, §4.10.2.5).
ОписаниеАдрес кода операции инструкции, следующей сразу за этой инструкцией jsr, помещается в стек операндов как значение типа returnAddress. Беззнаковые branchbyte1 и branchbyte2 используются для создания подписанного 16-битного смещения, где смещение равно (branchbyte1 << 8) | branchbyte2. Выполнение продолжается с этого смещения от адреса этой инструкции jsr. Целевой адрес должен соответствовать коду операции инструкции в методе, который содержит эту инструкцию jsr.
Примечания
Обратите внимание, что jsr помещает адрес в стек операндов, а ret (§ret) получает его из локальной переменной. Эта асимметрия преднамеренная.
В реализации Oracle компилятора для языка программирования Java до Java SE 6 инструкция jsr использовалась с инструкцией ret в реализации предложения finally (§3.13, §4.10.2.5).
-
RET
public static final OpCode RET
continue execution from address taken from a local variable #index (the asymmetry with jsr is intentional)Параметры 1: index
Стек [No change]
Обратите внимание, что jsr (§jsr) помещает адрес в стек операндов, а ret получает его из локальной переменной. Эта асимметрия преднамеренная.В реализации Oracle компилятора для языка программирования Java до Java SE 6 инструкция ret использовалась с инструкциями jsr и jsr_w (§jsr, §jsr_w) в реализации предложения finally (§3.13, §4.10.2.5) ).
Инструкцию ret не следует путать с инструкцией return (§return). Команда возврата возвращает управление от метода вызывающей стороне, не передавая никакого значения обратно вызывающей стороне.
Код операции ret может использоваться вместе с инструкцией wide (§wide) для доступа к локальной переменной с использованием двухбайтового беззнакового индекса.
-
TABLESWITCH
public static final OpCode TABLESWITCH
continue execution from an address in the table at offset indexПараметры 16+: [0–3 bytes padding], defaultbyte1, defaultbyte2, defaultbyte3, defaultbyte4, lowbyte1, lowbyte2, lowbyte3, lowbyte4, highbyte1, highbyte2, highbyte3, highbyte4, jump offsets...
Стек index →
-
LOOKUPSWITCH
public static final OpCode LOOKUPSWITCH
a target address is looked up from a table using a key and execution continues from the instruction at that addressПараметры 8+: <0 - 3 bytes padding>, defaultbyte1, defaultbyte2, defaultbyte3, defaultbyte4, npairs1, npairs2, npairs3, npairs4, match-offset pairs...
Стек key →
-
IRETURN
public static final OpCode IRETURN
return an integer from a methodСтек value → [empty]
-
LRETURN
public static final OpCode LRETURN
return a long valueСтек value → [empty]
-
FRETURN
public static final OpCode FRETURN
return a floatСтек value → [empty]
-
DRETURN
public static final OpCode DRETURN
return a double from a methodСтек value → [empty]
-
ARETURN
public static final OpCode ARETURN
return a reference from a methodСтек objectref → [empty]
-
RETURN
public static final OpCode RETURN
return void from methodСтек → [empty]
-
GETSTATIC
public static final OpCode GETSTATIC
get a static field value of a class, where the field is identified by field reference in the constant pool index (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек → value
-
PUTSTATIC
public static final OpCode PUTSTATIC
set static field to value in a class, where the field is identified by a field reference index in constant pool (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек value →
-
GETFIELD
public static final OpCode GETFIELD
get a field value of an object objectref, where the field is identified by field reference in the constant pool index (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек objectref → value
-
PUTFIELD
public static final OpCode PUTFIELD
set field to value in an object objectref, where the field is identified by a field reference index in constant pool (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек objectref, value →
-
INVOKEVIRTUAL
public static final OpCode INVOKEVIRTUAL
invoke virtual method on object objectref and puts the result on the stack (might be void); the method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек objectref, [arg1, arg2, ...] → result
-
INVOKESPECIAL
public static final OpCode INVOKESPECIAL
invoke instance method on object objectref and puts the result on the stack (might be void); the method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек objectref, [arg1, arg2, ...] → result
-
INVOKESTATIC
public static final OpCode INVOKESTATIC
invoke a static method and puts the result on the stack (might be void); the method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек [arg1, arg2, ...] → result
-
INVOKEINTERFACE
public static final OpCode INVOKEINTERFACE
invokes an interface method on object objectref and puts the result on the stack (might be void); the interface method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)Параметры 4: indexbyte1, indexbyte2, count, 0
Стек objectref, [arg1, arg2, ...] → result
-
INVOKEDYNAMIC
public static final OpCode INVOKEDYNAMIC
invokes a dynamic method and puts the result on the stack (might be void); the method is identified by method reference index in constant pool (indexbyte1 << 8 | indexbyte2)Параметры 4: indexbyte1, indexbyte2, 0, 0
Стек [arg1, arg2, ...] → result
-
NEW
public static final OpCode NEW
create new object of type identified by class reference in constant pool index (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек → objectref
-
NEWARRAY
public static final OpCode NEWARRAY
create new array with count elements of primitive type identified by atypeПараметры 1: atype
Стек count → arrayref
-
ANEWARRAY
public static final OpCode ANEWARRAY
create a new array of references of length count and component type identified by the class reference index (indexbyte1 << 8 | indexbyte2) in the constant poolПараметры 2: indexbyte1, indexbyte2
Стек count → arrayref
-
ARRAYLENGTH
public static final OpCode ARRAYLENGTH
get the length of an arrayСтек arrayref → length
-
ATHROW
public static final OpCode ATHROW
throws an error or exception (notice that the rest of the stack is cleared, leaving only a reference to the Throwable)Стек objectref → [empty], objectref
-
CHECKCAST
public static final OpCode CHECKCAST
checks whether an objectref is of a certain type, the class reference of which is in the constant pool at index (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек objectref → objectref
-
INSTANCEOF
public static final OpCode INSTANCEOF
determines if an object objectref is of a given type, identified by class reference index in constant pool (indexbyte1 << 8 | indexbyte2)Параметры 2: indexbyte1, indexbyte2
Стек objectref → result
-
MONITORENTER
public static final OpCode MONITORENTER
enter monitor for object ("grab the lock" – start of synchronized() section)Стек objectref →
-
MONITOREXIT
public static final OpCode MONITOREXIT
exit monitor for object ("release the lock" – end of synchronized() section)Стек objectref →
-
MULTIANEWARRAY
public static final OpCode MULTIANEWARRAY
create a new array of dimensions dimensions of type identified by class reference in constant pool index (indexbyte1 << 8 | indexbyte2); the sizes of each dimension is identified by count1, [count2, etc.]Параметры 3: indexbyte1, indexbyte2, dimensions
Стек count1, [count2,...] → arrayref
Из оф доки Format
multianewarray indexbyte1 indexbyte2 dimensions
Formsmultianewarray = 197 (0xc5)
Operand Stack.., count1, [count2, ...] → .., arrayref
DescriptionThe dimensions operand is an unsigned byte that must be greater than or equal to 1. It represents the number of dimensions of the array to be created. The operand stack must contain dimensions values. Each such value represents the number of components in a dimension of the array to be created, must be of type int, and must be non-negative. The count1 is the desired length in the first dimension, count2 in the second, etc.
All of the count values are popped off the operand stack. The unsigned indexbyte1 and indexbyte2 are used to construct an index into the run-time constant pool of the current class (§2.6), where the value of the index is (indexbyte1 << 8) | indexbyte2. The run-time constant pool item at the index must be a symbolic reference to a class, array, or interface type. The named class, array, or interface type is resolved (§5.4.3.1). The resulting entry must be an array class type of dimensionality greater than or equal to dimensions.
A new multidimensional array of the array type is allocated from the garbage-collected heap. If any count value is zero, no subsequent dimensions are allocated. The components of the array in the first dimension are initialized to subarrays of the type of the second dimension, and so on. The components of the last allocated dimension of the array are initialized to the default initial value (§2.3, §2.4) for the element type of the array type. A reference arrayref to the new array is pushed onto the operand stack.
Linking Exceptions
During resolution of the symbolic reference to the class, array, or interface type, any of the exceptions documented in §5.4.3.1 can be thrown.
Otherwise, if the current class does not have permission to access the element type of the resolved array class, multianewarray throws an IllegalAccessError.
Run-time Exception
Otherwise, if any of the dimensions values on the operand stack are less than zero, the multianewarray instruction throws a NegativeArraySizeException.
Notes
It may be more efficient to use newarray or anewarray (§newarray, §anewarray) when creating an array of a single dimension.
The array class referenced via the run-time constant pool may have more dimensions than the dimensions operand of the multianewarray instruction. In that case, only the first dimensions of the dimensions of the array are created.
-
IFNULL
public static final OpCode IFNULL
if value is null, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value →
Из оф доки Description
The value must of type reference. It is popped from the operand stack. If value is null, the unsigned branchbyte1 and branchbyte2 are used to construct a signed 16-bit offset, where the offset is calculated to be (branchbyte1 << 8) | branchbyte2. Execution then proceeds at that offset from the address of the opcode of this ifnull instruction. The target address must be that of an opcode of an instruction within the method that contains this ifnull instruction.
Otherwise, execution proceeds at the address of the instruction following this ifnull instruction.
-
IFNONNULL
public static final OpCode IFNONNULL
Официальная дока if value is not null, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 | branchbyte2)Параметры 2: branchbyte1, branchbyte2
Стек value →
Description
The value must be of type reference. It is popped from the operand stack. If value is not null, the unsigned branchbyte1 and branchbyte2 are used to construct a signed 16-bit offset, where the offset is calculated to be (branchbyte1 << 8) | branchbyte2. Execution then proceeds at that offset from the address of the opcode of this ifnonnull instruction. The target address must be that of an opcode of an instruction within the method that contains this ifnonnull instruction.
Otherwise, execution proceeds at the address of the instruction following this ifnonnull instruction.
-
-
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
-
-