| # Copyright 1994-2007 Sun Microsystems, Inc. All Rights Reserved. |
| # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| # |
| # This code is free software; you can redistribute it and/or modify it |
| # under the terms of the GNU General Public License version 2 only, as |
| # published by the Free Software Foundation. Sun designates this |
| # particular file as subject to the "Classpath" exception as provided |
| # by Sun in the LICENSE file that accompanied this code. |
| # |
| # This code is distributed in the hope that it will be useful, but WITHOUT |
| # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| # version 2 for more details (a copy is included in the LICENSE file that |
| # accompanied this code). |
| # |
| # You should have received a copy of the GNU General Public License version |
| # 2 along with this work; if not, write to the Free Software Foundation, |
| # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| # |
| # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| # CA 95054 USA or visit www.sun.com if you need additional information or |
| # have any questions. |
| # |
| |
| # Any line that doesn't have a-z in the 1st column is a comment. |
| # |
| # The first column is the name of the opcodes. The second column is the |
| # total length of the instruction. We use 99 for tableswitch and |
| # tablelookup, which must always be treated as special cases. |
| # |
| # The third and fourth colum give what the opcode pops off the stack, and |
| # what it then pushes back onto the stack |
| # - <no effect on stack> |
| # I integer |
| # L long integer |
| # F float |
| # D double float |
| # A address [array or object] |
| # O object only |
| # R return address (for jsr) |
| # a integer, array, or object |
| # ? unknown |
| # [I], [L], [F], [D], [A], [B], [C], [?] |
| # array of integer, long, float, double, address, bytes, |
| # chars, or anything |
| # 1,2,3,4,+ used by stack duplicating/popping routines. |
| # |
| # 1,2,3,4 represent >>any<< stack type except long or double. Two numbers |
| # separated by a + (in the third column) indicate that the two, together, can |
| # be used for a double or long. (Or they can represent two non-long items). |
| # |
| # The fifth column provides an *approximate* relative cost of executing the |
| # opcode. It is used by the instruction profiler. See profiler.h for |
| # blurb. |
| |
| nop 1 - - 1 /* nop */ |
| aconst_null 1 - A 1 /* push null object */ |
| iconst_m1 1 - I 1 /* push integer constant -1 */ |
| iconst_0 1 - I 1 /* push integer constant 0 */ |
| iconst_1 1 - I 1 /* push integer constant 1 */ |
| iconst_2 1 - I 1 /* push integer constant 2 */ |
| iconst_3 1 - I 1 /* push integer constant 3 */ |
| iconst_4 1 - I 1 /* push integer constant 4 */ |
| iconst_5 1 - I 1 /* push integer constant 5 */ |
| lconst_0 1 - L 1 /* push long 0L */ |
| lconst_1 1 - L 1 /* push long 1L */ |
| fconst_0 1 - F 1 /* push float constant 0.0 */ |
| fconst_1 1 - F 1 /* push float constant 1.0 */ |
| fconst_2 1 - F 1 /* push float constant 2.0 */ |
| dconst_0 1 - D 1 /* push double float constant 0.0d */ |
| dconst_1 1 - D 1 /* push double float constant 1.0d */ |
| bipush 2 - I 1 /* push byte-sized value */ |
| sipush 3 - I 1 /* push two-byte value */ |
| ldc 2 - ? 1 /* load a const from constant table */ |
| ldc_w 3 - ? 1 |
| ldc2_w 3 - ? 1 /* load a 2-word constant . . . */ |
| iload 2 - I 1 /* load local integer variable */ |
| lload 2 - L 1 /* load local long variable */ |
| fload 2 - F 1 /* load local floating variable */ |
| dload 2 - D 1 /* load local double variable */ |
| aload 2 - A 1 /* load local object variable */ |
| iload_0 1 - I 1 /* load local integer variable #0 */ |
| iload_1 1 - I 1 /* load local integer variable #1 */ |
| iload_2 1 - I 1 /* load local integer variable #2 */ |
| iload_3 1 - I 1 /* load local integer variable #3 */ |
| lload_0 1 - L 1 /* load local long variable #0 */ |
| lload_1 1 - L 1 /* load local long variable #1 */ |
| lload_2 1 - L 1 /* load local long variable #2 */ |
| lload_3 1 - L 1 /* load local long variable #3 */ |
| fload_0 1 - F 1 /* load local float variable #0 */ |
| fload_1 1 - F 1 /* load local float variable #1 */ |
| fload_2 1 - F 1 /* load local float variable #2 */ |
| fload_3 1 - F 1 /* load local float variable #3 */ |
| dload_0 1 - D 1 /* load lcl double float variable #0 */ |
| dload_1 1 - D 1 /* load lcl double float variable #1 */ |
| dload_2 1 - D 1 /* load lcl double float variable #2 */ |
| dload_3 1 - D 1 /* load lcl double float variable #3 */ |
| aload_0 1 - A 1 /* load local object variable #0 */ |
| aload_1 1 - A 1 /* load local object variable #1 */ |
| aload_2 1 - A 1 /* load local object variable #2 */ |
| aload_3 1 - A 1 /* load local object variable #3 */ |
| iaload 1 [I]I I 1 /* load from array of integer */ |
| laload 1 [L]I L 1 /* load from array of long */ |
| faload 1 [F]I F 1 /* load from array of float */ |
| daload 1 [D]I D 1 /* load from array of double */ |
| aaload 1 [A]I A 1 /* load from array of object */ |
| baload 1 [B]I I 1 /* load from array of (signed) bytes */ |
| caload 1 [C]I I 1 /* load from array of chars */ |
| saload 1 [S]I I 1 /* load from array of (signed) shorts */ |
| istore 2 I - 1 /* store local integer variable */ |
| lstore 2 L - 1 /* store local long variable */ |
| fstore 2 F - 1 /* store local float variable */ |
| dstore 2 D - 1 /* store local double variable */ |
| astore 2 A - 1 /* store local object variable */ |
| istore_0 1 I - 1 /* store local integer variable #0 */ |
| istore_1 1 I - 1 /* store local integer variable #1 */ |
| istore_2 1 I - 1 /* store local integer variable #2 */ |
| istore_3 1 I - 1 /* store local integer variable #3 */ |
| lstore_0 1 L - 1 /* store local long variable #0 */ |
| lstore_1 1 L - 1 /* store local long variable #1 */ |
| lstore_2 1 L - 1 /* store local long variable #2 */ |
| lstore_3 1 L - 1 /* store local long variable #3 */ |
| fstore_0 1 F - 1 /* store local float variable #0 */ |
| fstore_1 1 F - 1 /* store local float variable #1 */ |
| fstore_2 1 F - 1 /* store local float variable #2 */ |
| fstore_3 1 F - 1 /* store local float variable #3 */ |
| dstore_0 1 D - 1 /* store lcl double float variable #0 */ |
| dstore_1 1 D - 1 /* store lcl double float variable #1 */ |
| dstore_2 1 D - 1 /* store lcl double float variable #2 */ |
| dstore_3 1 D - 1 /* store lcl double float variable #3 */ |
| astore_0 1 A - 1 /* store local object variable #0 */ |
| astore_1 1 A - 1 /* store local object variable #1 */ |
| astore_2 1 A - 1 /* store local object variable #2 */ |
| astore_3 1 A - 1 /* store local object variable #3 */ |
| iastore 1 [I]II - 1 /* store into array of int */ |
| lastore 1 [L]IL - 1 /* store into array of long */ |
| fastore 1 [F]IF - 1 /* store into array of float */ |
| dastore 1 [D]ID - 1 /* store into array of double float */ |
| aastore 1 [A]IA - 1 /* store into array of object */ |
| bastore 1 [B]II - 1 /* store into array of (signed) bytes */ |
| castore 1 [C]II - 1 /* store into array of chars */ |
| sastore 1 [S]II - 1 /* store into array of (signed) shorts*/ |
| pop 1 1 - 1 /* pop top element */ |
| pop2 1 2+1 - 1 /* pop top two elements */ |
| dup 1 1 11 1 /* dup top element */ |
| dup_x1 1 21 121 1 /* dup top element. Skip one */ |
| dup_x2 1 3+21 1321 1 /* dup top element. Skip two */ |
| dup2 1 2+1 2121 1 /* dup top two elements. */ |
| dup2_x1 1 32+1 21321 1 /* dup top two elements. Skip one */ |
| dup2_x2 1 4+32+1 214321 1 /* dup top two elements. Skip two */ |
| swap 1 21 12 1 /* swap top two elements of stack. */ |
| iadd 1 II I 1 /* integer add */ |
| ladd 1 LL L 1 /* long add */ |
| fadd 1 FF F 1 /* floating add */ |
| dadd 1 DD D 1 /* double float add */ |
| isub 1 II I 1 /* integer subtract */ |
| lsub 1 LL L 1 /* long subtract */ |
| fsub 1 FF F 1 /* floating subtract */ |
| dsub 1 DD D 1 /* floating double subtract */ |
| imul 1 II I 1 /* integer multiply */ |
| lmul 1 LL L 1 /* long multiply */ |
| fmul 1 FF F 1 /* floating multiply */ |
| dmul 1 DD D 1 /* double float multiply */ |
| idiv 1 II I 1 /* integer divide */ |
| ldiv 1 LL L 1 /* long divide */ |
| fdiv 1 FF F 1 /* floating divide */ |
| ddiv 1 DD D 1 /* double float divide */ |
| irem 1 II I 1 /* integer mod */ |
| lrem 1 LL L 1 /* long mod */ |
| frem 1 FF F 1 /* floating mod */ |
| drem 1 DD D 1 /* double float mod */ |
| ineg 1 I I 1 /* integer negate */ |
| lneg 1 L L 1 /* long negate */ |
| fneg 1 F F 1 /* floating negate */ |
| dneg 1 D D 1 /* double float negate */ |
| ishl 1 II I 1 /* shift left */ |
| lshl 1 LI L 1 /* long shift left */ |
| ishr 1 II I 1 /* shift right */ |
| lshr 1 LI L 1 /* long shift right */ |
| iushr 1 II I 1 /* unsigned shift right */ |
| lushr 1 LI L 1 /* long unsigned shift right */ |
| iand 1 II I 1 /* boolean and */ |
| land 1 LL L 1 /* long boolean and */ |
| ior 1 II I 1 /* boolean or */ |
| lor 1 LL L 1 /* long boolean or */ |
| ixor 1 II I 1 /* boolean xor */ |
| lxor 1 LL L 1 /* long boolean xor */ |
| iinc 3 - - 1 /* increment lcl variable by constant */ |
| i2l 1 I L 1 /* integer to long */ |
| i2f 1 I F 1 /* integer to float */ |
| i2d 1 I D 1 /* integer to double */ |
| l2i 1 L I 1 /* long to integer */ |
| l2f 1 L F 1 /* long to float */ |
| l2d 1 L D 1 /* long to double */ |
| f2i 1 F I 1 /* float to integer */ |
| f2l 1 F L 1 /* float to long */ |
| f2d 1 F D 1 /* float to double */ |
| d2i 1 D I 1 /* double to integer */ |
| d2l 1 D L 1 /* double to long */ |
| d2f 1 D F 1 /* double to float */ |
| i2b 1 I I 1 /* integer to byte */ |
| i2c 1 I I 1 /* integer to character */ |
| i2s 1 I I 1 /* integer to signed short */ |
| lcmp 1 LL I 1 /* long compare */ |
| fcmpl 1 FF I 1 /* float compare. -1 on incomparable */ |
| fcmpg 1 FF I 1 /* float compare. 1 on incomparable */ |
| dcmpl 1 DD I 1 /* dbl floating cmp. -1 on incomp */ |
| dcmpg 1 DD I 1 /* dbl floating cmp. 1 on incomp */ |
| ifeq 3 I - 1 /* goto if equal */ |
| ifne 3 I - 1 /* goto if not equal */ |
| iflt 3 I - 1 /* goto if less than */ |
| ifge 3 I - 1 /* goto if greater than or equal */ |
| ifgt 3 I - 1 /* goto if greater than */ |
| ifle 3 I - 1 /* goto if less than or equal */ |
| if_icmpeq 3 II - 1 /* compare top two elements of stack */ |
| if_icmpne 3 II - 1 /* compare top two elements of stack */ |
| if_icmplt 3 II - 1 /* compare top two elements of stack */ |
| if_icmpge 3 II - 1 /* compare top two elements of stack */ |
| if_icmpgt 3 II - 1 /* compare top two elements of stack */ |
| if_icmple 3 II - 1 /* compare top two elements of stack */ |
| if_acmpeq 3 AA - 1 /* compare top two objects of stack */ |
| if_acmpne 3 AA - 1 /* compare top two objects of stack */ |
| goto 3 - - 1 /* unconditional goto */ |
| jsr 3 - R 1 /* jump subroutine */ |
| ret 2 - - 1 /* return from subroutine */ |
| tableswitch 99 I - 1 /* goto (case) */ |
| lookupswitch 99 I - 1 /* goto (case) */ |
| ireturn 1 I - 1 /* return integer from procedure */ |
| lreturn 1 L - 1 /* return long from procedure */ |
| freturn 1 F - 1 /* return float from procedure */ |
| dreturn 1 D - 1 /* return double from procedure */ |
| areturn 1 A - 1 /* return object from procedure */ |
| return 1 - - 1 /* return (void) from procedure */ |
| getstatic 3 - ? 1 /* get static field value. */ |
| putstatic 3 ? - 1 /* assign static field value */ |
| getfield 3 A ? 1 /* get field value from object. */ |
| putfield 3 ? - 1 /* assign field value to object. */ |
| invokevirtual 3 ? ? 1 /* call method, based on object. */ |
| invokespecial 3 ? ? 1 /* call method, not based on object. */ |
| invokestatic 3 ? ? 1 /* call a static method. */ |
| invokeinterface 5 ? ? 1 /* call an interface method */ |
| xxxunusedxxx 0 ? ? 1 /* was newfromname */ |
| new 3 - A 1 /* Create a new object */ |
| newarray 2 I A 1 /* Create a new array of non-objects*/ |
| anewarray 3 I A 1 /* Create a new array of objects */ |
| arraylength 1 [?] I 1 /* get length of array */ |
| athrow 1 O - 1 /* throw an exception */ |
| checkcast 3 A A 1 /* error if object not of given type */ |
| instanceof 3 A I 1 /* is object of given type? */ |
| monitorenter 1 A - 1 /* enter a monitored region of code */ |
| monitorexit 1 A - 1 /* exit a monitored region of code */ |
| wide 0 - - 1 /* prefix operation. */ |
| multianewarray 4 ? A 1 /* create multidimensional array */ |
| ifnull 3 A - 1 /* goto if null */ |
| ifnonnull 3 A - 1 /* goto if not null */ |
| |
| # The following instructions are "long" versions. They allow access to |
| # variables with index greater than 255. |
| |
| goto_w 5 - - 1 /* unconditional goto. 4byte offset */ |
| jsr_w 5 - R 1 /* jump subroutine. 4byte offset */ |
| |
| breakpoint 1 - - 1 /* call breakpoint handler */ |
| |
| # The compiler will not generate any of the following instructions. That |
| # are created by the interpreter from the non _quick versions of the |
| # instructions. |
| |
| ldc_quick 2 - ? 1 |
| ldc_w_quick 3 - ? 1 |
| ldc2_w_quick 3 - ? 1 |
| getfield_quick 3 A ? 1 |
| putfield_quick 3 ? - 1 |
| getfield2_quick 3 A ? 1 |
| putfield2_quick 3 ? - 1 |
| getstatic_quick 3 - ? 1 |
| putstatic_quick 3 ? - 1 |
| getstatic2_quick 3 - ? 1 |
| putstatic2_quick 3 ? _ 1 |
| invokevirtual_quick 3 ? ? 1 |
| invokenonvirtual_quick 3 ? ? 1 |
| invokesuper_quick 3 ? ? 1 |
| invokestatic_quick 3 ? ? 1 |
| invokeinterface_quick 5 ? ? 1 |
| invokevirtualobject_quick 3 ? ? 1 |
| invokeignored_quick 3 ? ? 1 |
| new_quick 3 - A 1 |
| anewarray_quick 3 I A 1 |
| multianewarray_quick 4 ? A 1 |
| checkcast_quick 3 A A 1 |
| instanceof_quick 3 A I 1 |
| |
| # The following are generated when the offset is bigger than 255 |
| |
| invokevirtual_quick_w 3 ? ? 1 |
| getfield_quick_w 3 A ? 1 |
| putfield_quick_w 3 ? - 1 |
| |
| # used for simplification |
| |
| nonnull_quick 1 A - 1 /* throw exception if stacktop null */ |