Java字节码指令列表

来源:互联网 发布:淘宝服装展示架 编辑:程序博客网 时间:2024/05/16 12:02
MnemonicOpcode
(in hex)Other bytesStack
[before]→[after]Descriptionaaload32 arrayref, index → valueload onto the stack a reference from an arrayaastore53 arrayref, index, value →store into a reference in an arrayaconst_null01 → nullpush a null reference onto the stackaload191: index→ objectrefload a reference onto the stack from a local variable #indexaload_02a → objectrefload a reference onto the stack from local variable 0aload_12b → objectrefload a reference onto the stack from local variable 1aload_22c → objectrefload a reference onto the stack from local variable 2aload_32d → objectrefload a reference onto the stack from local variable 3anewarraybd2: indexbyte1, indexbyte2count → arrayrefcreate a new array of references of length count and component type identified by the class referenceindex (indexbyte1 << 8 + indexbyte2) in the constant poolareturnb0 objectref → [empty]return a reference from a methodarraylengthbe arrayref → lengthget the length of an arrayastore3a1: indexobjectref →store a reference into a local variable #indexastore_04b objectref →store a reference into local variable 0astore_14c objectref →store a reference into local variable 1astore_24d objectref →store a reference into local variable 2astore_34e objectref →store a reference into local variable 3athrowbf objectref → [empty], objectrefthrows an error or exception (notice that the rest of the stack is cleared, leaving only a reference to the Throwable)baload33 arrayref, index → valueload a byte or Boolean value from an arraybastore54 arrayref, index, value →store a byte or Boolean value into an arraybipush101: byte→ valuepush a byte onto the stack as an integer valuebreakpointca  reserved for breakpoints in Java debuggers; should not appear in any class filecaload34 arrayref, index → valueload a char from an arraycastore55 arrayref, index, value →store a char into an arraycheckcastc02: indexbyte1, indexbyte2objectref → objectrefchecks whether an objectref is of a certain type, the class reference of which is in the constant pool at index (indexbyte1 << 8 + indexbyte2)d2f90 value → resultconvert a double to a floatd2i8e value → resultconvert a double to an intd2l8f value → resultconvert a double to a longdadd63 value1, value2 → resultadd two doublesdaload31 arrayref, index → valueload a double from an arraydastore52 arrayref, index, value →store a double into an arraydcmpg98 value1, value2 → resultcompare two doublesdcmpl97 value1, value2 → resultcompare two doublesdconst_00e → 0.0push the constant 0.0 onto the stackdconst_10f → 1.0push the constant 1.0 onto the stackddiv6f value1, value2 → resultdivide two doublesdload181: index→ valueload a double value from a local variable #indexdload_026 → valueload a double from local variable 0dload_127 → valueload a double from local variable 1dload_228 → valueload a double from local variable 2dload_329 → valueload a double from local variable 3dmul6b value1, value2 → resultmultiply two doublesdneg77 value → resultnegate a doubledrem73 value1, value2 → resultget the remainder from a division between two doublesdreturnaf value → [empty]return a double from a methoddstore391: indexvalue →store a double value into a local variable #indexdstore_047 value →store a double into local variable 0dstore_148 value →store a double into local variable 1dstore_249 value →store a double into local variable 2dstore_34a value →store a double into local variable 3dsub67 value1, value2 → resultsubtract a double from anotherdup59 value → value, valueduplicate the value on top of the stackdup_x15a value2, value1 → value1, value2, value1insert 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_x25b value3, value2, value1 → value1, value3, value2, value1insert 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 topdup25c {value2, value1} → {value2, value1}, {value2, value1}duplicate top two stack words (two values, if value1 is not double nor long; a single value, if value1 is double or long)dup2_x15d value3, {value2, value1} → {value2, value1}, value3, {value2, value1}duplicate two words and insert beneath third word (see explanation above)dup2_x25e {value4, value3}, {value2, value1} → {value2, value1}, {value4, value3}, {value2, value1}duplicate two words and insert beneath fourth wordf2d8d value → resultconvert a float to a doublef2i8b value → resultconvert a float to an intf2l8c value → resultconvert a float to a longfadd62 value1, value2 → resultadd two floatsfaload30 arrayref, index → valueload a float from an arrayfastore51 arrayref, index, value →store a float in an arrayfcmpg96 value1, value2 → resultcompare two floatsfcmpl95 value1, value2 → resultcompare two floatsfconst_00b → 0.0fpush 0.0f on the stackfconst_10c → 1.0fpush 1.0f on the stackfconst_20d → 2.0fpush 2.0f on the stackfdiv6e value1, value2 → resultdivide two floatsfload171: index→ valueload a float value from a local variable #indexfload_022 → valueload a float value from local variable 0fload_123 → valueload a float value from local variable 1fload_224 → valueload a float value from local variable 2fload_325 → valueload a float value from local variable 3fmul6a value1, value2 → resultmultiply two floatsfneg76 value → resultnegate a floatfrem72 value1, value2 → resultget the remainder from a division between two floatsfreturnae value → [empty]return a floatfstore381: indexvalue →store a float value into a local variable #indexfstore_043 value →store a float value into local variable 0fstore_144 value →store a float value into local variable 1fstore_245 value →store a float value into local variable 2fstore_346 value →store a float value into local variable 3fsub66 value1, value2 → resultsubtract two floatsgetfieldb42: index1, index2objectref → valueget a field value of an object objectref, where the field is identified by field reference in the constant pool index (index1 << 8 + index2)getstaticb22: index1, index2→ valueget a static field value of a class, where the field is identified by field reference in the constant pool index (index1 << 8 + index2)gotoa72: branchbyte1, branchbyte2[no change]goes to another instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)goto_wc84: branchbyte1, branchbyte2, branchbyte3, branchbyte4[no change]goes to another instruction at branchoffset (signed int constructed from unsigned bytes branchbyte1 << 24 + branchbyte2 << 16 + branchbyte3 << 8 + branchbyte4)i2b91 value → resultconvert an int into a bytei2c92 value → resultconvert an int into a characteri2d87 value → resultconvert an int into a doublei2f86 value → resultconvert an int into a floati2l85 value → resultconvert an int into a longi2s93 value → resultconvert an int into a shortiadd60 value1, value2 → resultadd two intsiaload2e arrayref, index → valueload an int from an arrayiand7e value1, value2 → resultperform a bitwise and on two integersiastore4f arrayref, index, value →store an int into an arrayiconst_m102 → -1load the int value -1 onto the stackiconst_003 → 0load the int value 0 onto the stackiconst_104 → 1load the int value 1 onto the stackiconst_205 → 2load the int value 2 onto the stackiconst_306 → 3load the int value 3 onto the stackiconst_407 → 4load the int value 4 onto the stackiconst_508 → 5load the int value 5 onto the stackidiv6c value1, value2 → resultdivide two integersif_acmpeqa52: branchbyte1, branchbyte2value1, value2 →if references are equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)if_acmpnea62: branchbyte1, branchbyte2value1, value2 →if references are not equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)if_icmpeq9f2: branchbyte1, branchbyte2value1, value2 →if ints are equal, branch to instruction at branchoffset (signed short constructed from unsigned bytesbranchbyte1 << 8 + branchbyte2)if_icmpgea22: branchbyte1, branchbyte2value1, value2 →if value1 is greater than or equal to value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)if_icmpgta32: branchbyte1, branchbyte2value1, value2 →if value1 is greater than value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)if_icmplea42: branchbyte1, branchbyte2value1, value2 →if value1 is less than or equal to value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)if_icmplta12: branchbyte1, branchbyte2value1, value2 →if value1 is less than value2, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)if_icmpnea02: branchbyte1, branchbyte2value1, value2 →if ints are not equal, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)ifeq992: branchbyte1, branchbyte2value →if value is 0, branch to instruction at branchoffset (signed short constructed from unsigned bytesbranchbyte1 << 8 + branchbyte2)ifge9c2: branchbyte1, branchbyte2value →if value is greater than or equal to 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)ifgt9d2: branchbyte1, branchbyte2value →if value is greater than 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)ifle9e2: branchbyte1, branchbyte2value →if value is less than or equal to 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)iflt9b2: branchbyte1, branchbyte2value →if value is less than 0, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)ifne9a2: branchbyte1, branchbyte2value →if value is not 0, branch to instruction at branchoffset (signed short constructed from unsigned bytesbranchbyte1 << 8 + branchbyte2)ifnonnullc72: branchbyte1, branchbyte2value →if value is not null, branch to instruction at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2)ifnullc62: branchbyte1, branchbyte2value →if value is null, branch to instruction at branchoffset (signed short constructed from unsigned bytesbranchbyte1 << 8 + branchbyte2)iinc842: index, const[No change]increment local variable #index by signed byte constiload151: index→ valueload an int value from a local variable #indexiload_01a → valueload an int value from local variable 0iload_11b → valueload an int value from local variable 1iload_21c → valueload an int value from local variable 2iload_31d → valueload an int value from local variable 3impdep1fe  reserved for implementation-dependent operations within debuggers; should not appear in any class fileimpdep2ff  reserved for implementation-dependent operations within debuggers; should not appear in any class fileimul68 value1, value2 → resultmultiply two integersineg74 value → resultnegate intinstanceofc12: indexbyte1, indexbyte2objectref → resultdetermines if an object objectref is of a given type, identified by class reference index in constant pool (indexbyte1 << 8 + indexbyte2)invokedynamicba4: indexbyte1, indexbyte2, 0, 0[arg1, [arg2 ...]] →invokes a dynamic method identified by method reference index in constant pool (indexbyte1 << 8 + indexbyte2)invokeinterfaceb94: indexbyte1, indexbyte2, count, 0objectref, [arg1, arg2, ...] →invokes an interface method on object objectref, where the interface method is identified by method reference index in constant pool (indexbyte1 << 8 + indexbyte2)invokespecialb72: indexbyte1, indexbyte2objectref, [arg1, arg2, ...] →invoke instance method on object objectref, where the method is identified by method reference indexin constant pool (indexbyte1 << 8 + indexbyte2)invokestaticb82: indexbyte1, indexbyte2[arg1, arg2, ...] →invoke a static method, where the method is identified by method reference index in constant pool (indexbyte1 << 8 + indexbyte2)invokevirtualb62: indexbyte1, indexbyte2objectref, [arg1, arg2, ...] →invoke virtual method on object objectref, where the method is identified by method reference index in constant pool (indexbyte1 << 8 + indexbyte2)ior80 value1, value2 → resultbitwise int orirem70 value1, value2 → resultlogical int remainderireturnac value → [empty]return an integer from a methodishl78 value1, value2 → resultint shift leftishr7a value1, value2 → resultint arithmetic shift rightistore361: indexvalue →store int value into variable #indexistore_03b value →store int value into variable 0istore_13c value →store int value into variable 1istore_23d value →store int value into variable 2istore_33e value →store int value into variable 3isub64 value1, value2 → resultint subtractiushr7c value1, value2 → resultint logical shift rightixor82 value1, value2 → resultint xorjsra82: branchbyte1, branchbyte2→ addressjump to subroutine at branchoffset (signed short constructed from unsigned bytes branchbyte1 << 8 + branchbyte2) and place the return address on the stackjsr_wc94: branchbyte1, branchbyte2, branchbyte3, branchbyte4→ addressjump to subroutine at branchoffset (signed int constructed from unsigned bytes branchbyte1 << 24 + branchbyte2 << 16 + branchbyte3 << 8 + branchbyte4) and place the return address on the stackl2d8a value → resultconvert a long to a doublel2f89 value → resultconvert a long to a floatl2i88 value → resultconvert a long to a intladd61 value1, value2 → resultadd two longslaload2f arrayref, index → valueload a long from an arrayland7f value1, value2 → resultbitwise and of two longslastore50 arrayref, index, value →store a long to an arraylcmp94 value1, value2 → resultcompare two longs valueslconst_009 → 0Lpush the long 0 onto the stacklconst_10a → 1Lpush the long 1 onto the stackldc121: index→ valuepush a constant #index from a constant pool (String, int or float) onto the stackldc_w132: indexbyte1, indexbyte2→ valuepush a constant #index from a constant pool (String, int or float) onto the stack (wide index is constructed as indexbyte1 << 8 + indexbyte2)ldc2_w142: indexbyte1, indexbyte2→ valuepush a constant #index from a constant pool (double or long) onto the stack (wide index is constructed as indexbyte1 << 8 + indexbyte2)ldiv6d value1, value2 → resultdivide two longslload161: index→ valueload a long value from a local variable #indexlload_01e → valueload a long value from a local variable 0lload_11f → valueload a long value from a local variable 1lload_220 → valueload a long value from a local variable 2lload_321 → valueload a long value from a local variable 3lmul69 value1, value2 → resultmultiply two longslneg75 value → resultnegate a longlookupswitchab4+: <0-3 bytes padding>, defaultbyte1, defaultbyte2, defaultbyte3, defaultbyte4, npairs1, npairs2, npairs3, npairs4, match-offset pairs...key →a target address is looked up from a table using a key and execution continues from the instruction at that addresslor81 value1, value2 → resultbitwise or of two longslrem71 value1, value2 → resultremainder of division of two longslreturnad value → [empty]return a long valuelshl79 value1, value2 → resultbitwise shift left of a long value1 by value2 positionslshr7b value1, value2 → resultbitwise shift right of a long value1 by value2 positionslstore371: indexvalue →store a long value in a local variable #indexlstore_03f value →store a long value in a local variable 0lstore_140 value →store a long value in a local variable 1lstore_241 value →store a long value in a local variable 2lstore_342 value →store a long value in a local variable 3lsub65 value1, value2 → resultsubtract two longslushr7d value1, value2 → resultbitwise shift right of a long value1 by value2 positions, unsignedlxor83 value1, value2 → resultbitwise exclusive or of two longsmonitorenterc2 objectref →enter monitor for object ("grab the lock" - start of synchronized() section)monitorexitc3 objectref →exit monitor for object ("release the lock" - end of synchronized() section)multianewarrayc53: indexbyte1, indexbyte2, dimensionscount1, [count2,...] → arrayrefcreate a new array of dimensions dimensions with elements of type identified by class reference in constant pool index (indexbyte1 << 8 + indexbyte2); the sizes of each dimension is identified bycount1, [count2, etc.]newbb2: indexbyte1, indexbyte2→ objectrefcreate new object of type identified by class reference in constant pool index (indexbyte1 << 8 + indexbyte2)newarraybc1: atypecount → arrayrefcreate new array with count elements of primitive type identified by atypenop00 [No change]perform no operationpop57 value →discard the top value on the stackpop258 {value2, value1} →discard the top two values on the stack (or one value, if it is a double or long)putfieldb52: indexbyte1, indexbyte2objectref, value →set field to value in an object objectref, where the field is identified by a field reference index in constant pool (indexbyte1 << 8 + indexbyte2)putstaticb32: indexbyte1, indexbyte2value →set static field to value in a class, where the field is identified by a field reference index in constant pool (indexbyte1 << 8 + indexbyte2)reta91: index[No change]continue execution from address taken from a local variable #index (the asymmetry with jsr is intentional)returnb1 → [empty]return void from methodsaload35 arrayref, index → valueload short from arraysastore56 arrayref, index, value →store short to arraysipush112: byte1, byte2→ valuepush a short onto the stackswap5f value2, value1 → value1, value2swaps two top words on the stack (note that value1 and value2 must not be double or long)tableswitchaa4+: [0-3 bytes padding], defaultbyte1, defaultbyte2, defaultbyte3, defaultbyte4, lowbyte1, lowbyte2, lowbyte3, lowbyte4, highbyte1, highbyte2, highbyte3, highbyte4, jump offsets...index →continue execution from an address in the table at offset indexwidec43/5: opcode, indexbyte1, indexbyte2
or
iinc, indexbyte1, indexbyte2, countbyte1, countbyte2[same as for corresponding instructions]execute opcode, where opcode is either iload, fload, aload, lload, dload, istore, fstore, astore, lstore, dstore, or ret, but assume the index is 16 bit; or execute iinc, where the index is 16 bits and the constant to increment by is a signed 16 bit short(no name)cb-fd  these values are currently unassigned for opcodes and are reserved for future use

原文出处:http://en.wikipedia.org/wiki/Java_bytecode_instruction_listings


0 0
原创粉丝点击