1 # Copyright 1994-2007 Sun Microsystems, Inc. All Rights Reserved. |
|
2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
3 # |
|
4 # This code is free software; you can redistribute it and/or modify it |
|
5 # under the terms of the GNU General Public License version 2 only, as |
|
6 # published by the Free Software Foundation. Sun designates this |
|
7 # particular file as subject to the "Classpath" exception as provided |
|
8 # by Sun in the LICENSE file that accompanied this code. |
|
9 # |
|
10 # This code is distributed in the hope that it will be useful, but WITHOUT |
|
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 # version 2 for more details (a copy is included in the LICENSE file that |
|
14 # accompanied this code). |
|
15 # |
|
16 # You should have received a copy of the GNU General Public License version |
|
17 # 2 along with this work; if not, write to the Free Software Foundation, |
|
18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
19 # |
|
20 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
|
21 # CA 95054 USA or visit www.sun.com if you need additional information or |
|
22 # have any questions. |
|
23 # |
|
24 |
|
25 # Any line that doesn't have a-z in the 1st column is a comment. |
|
26 # |
|
27 # The first column is the name of the opcodes. The second column is the |
|
28 # total length of the instruction. We use 99 for tableswitch and |
|
29 # tablelookup, which must always be treated as special cases. |
|
30 # |
|
31 # The third and fourth colum give what the opcode pops off the stack, and |
|
32 # what it then pushes back onto the stack |
|
33 # - <no effect on stack> |
|
34 # I integer |
|
35 # L long integer |
|
36 # F float |
|
37 # D double float |
|
38 # A address [array or object] |
|
39 # O object only |
|
40 # R return address (for jsr) |
|
41 # a integer, array, or object |
|
42 # ? unknown |
|
43 # [I], [L], [F], [D], [A], [B], [C], [?] |
|
44 # array of integer, long, float, double, address, bytes, |
|
45 # chars, or anything |
|
46 # 1,2,3,4,+ used by stack duplicating/popping routines. |
|
47 # |
|
48 # 1,2,3,4 represent >>any<< stack type except long or double. Two numbers |
|
49 # separated by a + (in the third column) indicate that the two, together, can |
|
50 # be used for a double or long. (Or they can represent two non-long items). |
|
51 # |
|
52 # The fifth column provides an *approximate* relative cost of executing the |
|
53 # opcode. It is used by the instruction profiler. See profiler.h for |
|
54 # blurb. |
|
55 |
|
56 nop 1 - - 1 /* nop */ |
|
57 aconst_null 1 - A 1 /* push null object */ |
|
58 iconst_m1 1 - I 1 /* push integer constant -1 */ |
|
59 iconst_0 1 - I 1 /* push integer constant 0 */ |
|
60 iconst_1 1 - I 1 /* push integer constant 1 */ |
|
61 iconst_2 1 - I 1 /* push integer constant 2 */ |
|
62 iconst_3 1 - I 1 /* push integer constant 3 */ |
|
63 iconst_4 1 - I 1 /* push integer constant 4 */ |
|
64 iconst_5 1 - I 1 /* push integer constant 5 */ |
|
65 lconst_0 1 - L 1 /* push long 0L */ |
|
66 lconst_1 1 - L 1 /* push long 1L */ |
|
67 fconst_0 1 - F 1 /* push float constant 0.0 */ |
|
68 fconst_1 1 - F 1 /* push float constant 1.0 */ |
|
69 fconst_2 1 - F 1 /* push float constant 2.0 */ |
|
70 dconst_0 1 - D 1 /* push double float constant 0.0d */ |
|
71 dconst_1 1 - D 1 /* push double float constant 1.0d */ |
|
72 bipush 2 - I 1 /* push byte-sized value */ |
|
73 sipush 3 - I 1 /* push two-byte value */ |
|
74 ldc 2 - ? 1 /* load a const from constant table */ |
|
75 ldc_w 3 - ? 1 |
|
76 ldc2_w 3 - ? 1 /* load a 2-word constant . . . */ |
|
77 iload 2 - I 1 /* load local integer variable */ |
|
78 lload 2 - L 1 /* load local long variable */ |
|
79 fload 2 - F 1 /* load local floating variable */ |
|
80 dload 2 - D 1 /* load local double variable */ |
|
81 aload 2 - A 1 /* load local object variable */ |
|
82 iload_0 1 - I 1 /* load local integer variable #0 */ |
|
83 iload_1 1 - I 1 /* load local integer variable #1 */ |
|
84 iload_2 1 - I 1 /* load local integer variable #2 */ |
|
85 iload_3 1 - I 1 /* load local integer variable #3 */ |
|
86 lload_0 1 - L 1 /* load local long variable #0 */ |
|
87 lload_1 1 - L 1 /* load local long variable #1 */ |
|
88 lload_2 1 - L 1 /* load local long variable #2 */ |
|
89 lload_3 1 - L 1 /* load local long variable #3 */ |
|
90 fload_0 1 - F 1 /* load local float variable #0 */ |
|
91 fload_1 1 - F 1 /* load local float variable #1 */ |
|
92 fload_2 1 - F 1 /* load local float variable #2 */ |
|
93 fload_3 1 - F 1 /* load local float variable #3 */ |
|
94 dload_0 1 - D 1 /* load lcl double float variable #0 */ |
|
95 dload_1 1 - D 1 /* load lcl double float variable #1 */ |
|
96 dload_2 1 - D 1 /* load lcl double float variable #2 */ |
|
97 dload_3 1 - D 1 /* load lcl double float variable #3 */ |
|
98 aload_0 1 - A 1 /* load local object variable #0 */ |
|
99 aload_1 1 - A 1 /* load local object variable #1 */ |
|
100 aload_2 1 - A 1 /* load local object variable #2 */ |
|
101 aload_3 1 - A 1 /* load local object variable #3 */ |
|
102 iaload 1 [I]I I 1 /* load from array of integer */ |
|
103 laload 1 [L]I L 1 /* load from array of long */ |
|
104 faload 1 [F]I F 1 /* load from array of float */ |
|
105 daload 1 [D]I D 1 /* load from array of double */ |
|
106 aaload 1 [A]I A 1 /* load from array of object */ |
|
107 baload 1 [B]I I 1 /* load from array of (signed) bytes */ |
|
108 caload 1 [C]I I 1 /* load from array of chars */ |
|
109 saload 1 [S]I I 1 /* load from array of (signed) shorts */ |
|
110 istore 2 I - 1 /* store local integer variable */ |
|
111 lstore 2 L - 1 /* store local long variable */ |
|
112 fstore 2 F - 1 /* store local float variable */ |
|
113 dstore 2 D - 1 /* store local double variable */ |
|
114 astore 2 A - 1 /* store local object variable */ |
|
115 istore_0 1 I - 1 /* store local integer variable #0 */ |
|
116 istore_1 1 I - 1 /* store local integer variable #1 */ |
|
117 istore_2 1 I - 1 /* store local integer variable #2 */ |
|
118 istore_3 1 I - 1 /* store local integer variable #3 */ |
|
119 lstore_0 1 L - 1 /* store local long variable #0 */ |
|
120 lstore_1 1 L - 1 /* store local long variable #1 */ |
|
121 lstore_2 1 L - 1 /* store local long variable #2 */ |
|
122 lstore_3 1 L - 1 /* store local long variable #3 */ |
|
123 fstore_0 1 F - 1 /* store local float variable #0 */ |
|
124 fstore_1 1 F - 1 /* store local float variable #1 */ |
|
125 fstore_2 1 F - 1 /* store local float variable #2 */ |
|
126 fstore_3 1 F - 1 /* store local float variable #3 */ |
|
127 dstore_0 1 D - 1 /* store lcl double float variable #0 */ |
|
128 dstore_1 1 D - 1 /* store lcl double float variable #1 */ |
|
129 dstore_2 1 D - 1 /* store lcl double float variable #2 */ |
|
130 dstore_3 1 D - 1 /* store lcl double float variable #3 */ |
|
131 astore_0 1 A - 1 /* store local object variable #0 */ |
|
132 astore_1 1 A - 1 /* store local object variable #1 */ |
|
133 astore_2 1 A - 1 /* store local object variable #2 */ |
|
134 astore_3 1 A - 1 /* store local object variable #3 */ |
|
135 iastore 1 [I]II - 1 /* store into array of int */ |
|
136 lastore 1 [L]IL - 1 /* store into array of long */ |
|
137 fastore 1 [F]IF - 1 /* store into array of float */ |
|
138 dastore 1 [D]ID - 1 /* store into array of double float */ |
|
139 aastore 1 [A]IA - 1 /* store into array of object */ |
|
140 bastore 1 [B]II - 1 /* store into array of (signed) bytes */ |
|
141 castore 1 [C]II - 1 /* store into array of chars */ |
|
142 sastore 1 [S]II - 1 /* store into array of (signed) shorts*/ |
|
143 pop 1 1 - 1 /* pop top element */ |
|
144 pop2 1 2+1 - 1 /* pop top two elements */ |
|
145 dup 1 1 11 1 /* dup top element */ |
|
146 dup_x1 1 21 121 1 /* dup top element. Skip one */ |
|
147 dup_x2 1 3+21 1321 1 /* dup top element. Skip two */ |
|
148 dup2 1 2+1 2121 1 /* dup top two elements. */ |
|
149 dup2_x1 1 32+1 21321 1 /* dup top two elements. Skip one */ |
|
150 dup2_x2 1 4+32+1 214321 1 /* dup top two elements. Skip two */ |
|
151 swap 1 21 12 1 /* swap top two elements of stack. */ |
|
152 iadd 1 II I 1 /* integer add */ |
|
153 ladd 1 LL L 1 /* long add */ |
|
154 fadd 1 FF F 1 /* floating add */ |
|
155 dadd 1 DD D 1 /* double float add */ |
|
156 isub 1 II I 1 /* integer subtract */ |
|
157 lsub 1 LL L 1 /* long subtract */ |
|
158 fsub 1 FF F 1 /* floating subtract */ |
|
159 dsub 1 DD D 1 /* floating double subtract */ |
|
160 imul 1 II I 1 /* integer multiply */ |
|
161 lmul 1 LL L 1 /* long multiply */ |
|
162 fmul 1 FF F 1 /* floating multiply */ |
|
163 dmul 1 DD D 1 /* double float multiply */ |
|
164 idiv 1 II I 1 /* integer divide */ |
|
165 ldiv 1 LL L 1 /* long divide */ |
|
166 fdiv 1 FF F 1 /* floating divide */ |
|
167 ddiv 1 DD D 1 /* double float divide */ |
|
168 irem 1 II I 1 /* integer mod */ |
|
169 lrem 1 LL L 1 /* long mod */ |
|
170 frem 1 FF F 1 /* floating mod */ |
|
171 drem 1 DD D 1 /* double float mod */ |
|
172 ineg 1 I I 1 /* integer negate */ |
|
173 lneg 1 L L 1 /* long negate */ |
|
174 fneg 1 F F 1 /* floating negate */ |
|
175 dneg 1 D D 1 /* double float negate */ |
|
176 ishl 1 II I 1 /* shift left */ |
|
177 lshl 1 LI L 1 /* long shift left */ |
|
178 ishr 1 II I 1 /* shift right */ |
|
179 lshr 1 LI L 1 /* long shift right */ |
|
180 iushr 1 II I 1 /* unsigned shift right */ |
|
181 lushr 1 LI L 1 /* long unsigned shift right */ |
|
182 iand 1 II I 1 /* boolean and */ |
|
183 land 1 LL L 1 /* long boolean and */ |
|
184 ior 1 II I 1 /* boolean or */ |
|
185 lor 1 LL L 1 /* long boolean or */ |
|
186 ixor 1 II I 1 /* boolean xor */ |
|
187 lxor 1 LL L 1 /* long boolean xor */ |
|
188 iinc 3 - - 1 /* increment lcl variable by constant */ |
|
189 i2l 1 I L 1 /* integer to long */ |
|
190 i2f 1 I F 1 /* integer to float */ |
|
191 i2d 1 I D 1 /* integer to double */ |
|
192 l2i 1 L I 1 /* long to integer */ |
|
193 l2f 1 L F 1 /* long to float */ |
|
194 l2d 1 L D 1 /* long to double */ |
|
195 f2i 1 F I 1 /* float to integer */ |
|
196 f2l 1 F L 1 /* float to long */ |
|
197 f2d 1 F D 1 /* float to double */ |
|
198 d2i 1 D I 1 /* double to integer */ |
|
199 d2l 1 D L 1 /* double to long */ |
|
200 d2f 1 D F 1 /* double to float */ |
|
201 i2b 1 I I 1 /* integer to byte */ |
|
202 i2c 1 I I 1 /* integer to character */ |
|
203 i2s 1 I I 1 /* integer to signed short */ |
|
204 lcmp 1 LL I 1 /* long compare */ |
|
205 fcmpl 1 FF I 1 /* float compare. -1 on incomparable */ |
|
206 fcmpg 1 FF I 1 /* float compare. 1 on incomparable */ |
|
207 dcmpl 1 DD I 1 /* dbl floating cmp. -1 on incomp */ |
|
208 dcmpg 1 DD I 1 /* dbl floating cmp. 1 on incomp */ |
|
209 ifeq 3 I - 1 /* goto if equal */ |
|
210 ifne 3 I - 1 /* goto if not equal */ |
|
211 iflt 3 I - 1 /* goto if less than */ |
|
212 ifge 3 I - 1 /* goto if greater than or equal */ |
|
213 ifgt 3 I - 1 /* goto if greater than */ |
|
214 ifle 3 I - 1 /* goto if less than or equal */ |
|
215 if_icmpeq 3 II - 1 /* compare top two elements of stack */ |
|
216 if_icmpne 3 II - 1 /* compare top two elements of stack */ |
|
217 if_icmplt 3 II - 1 /* compare top two elements of stack */ |
|
218 if_icmpge 3 II - 1 /* compare top two elements of stack */ |
|
219 if_icmpgt 3 II - 1 /* compare top two elements of stack */ |
|
220 if_icmple 3 II - 1 /* compare top two elements of stack */ |
|
221 if_acmpeq 3 AA - 1 /* compare top two objects of stack */ |
|
222 if_acmpne 3 AA - 1 /* compare top two objects of stack */ |
|
223 goto 3 - - 1 /* unconditional goto */ |
|
224 jsr 3 - R 1 /* jump subroutine */ |
|
225 ret 2 - - 1 /* return from subroutine */ |
|
226 tableswitch 99 I - 1 /* goto (case) */ |
|
227 lookupswitch 99 I - 1 /* goto (case) */ |
|
228 ireturn 1 I - 1 /* return integer from procedure */ |
|
229 lreturn 1 L - 1 /* return long from procedure */ |
|
230 freturn 1 F - 1 /* return float from procedure */ |
|
231 dreturn 1 D - 1 /* return double from procedure */ |
|
232 areturn 1 A - 1 /* return object from procedure */ |
|
233 return 1 - - 1 /* return (void) from procedure */ |
|
234 getstatic 3 - ? 1 /* get static field value. */ |
|
235 putstatic 3 ? - 1 /* assign static field value */ |
|
236 getfield 3 A ? 1 /* get field value from object. */ |
|
237 putfield 3 ? - 1 /* assign field value to object. */ |
|
238 invokevirtual 3 ? ? 1 /* call method, based on object. */ |
|
239 invokespecial 3 ? ? 1 /* call method, not based on object. */ |
|
240 invokestatic 3 ? ? 1 /* call a static method. */ |
|
241 invokeinterface 5 ? ? 1 /* call an interface method */ |
|
242 xxxunusedxxx 0 ? ? 1 /* was newfromname */ |
|
243 new 3 - A 1 /* Create a new object */ |
|
244 newarray 2 I A 1 /* Create a new array of non-objects*/ |
|
245 anewarray 3 I A 1 /* Create a new array of objects */ |
|
246 arraylength 1 [?] I 1 /* get length of array */ |
|
247 athrow 1 O - 1 /* throw an exception */ |
|
248 checkcast 3 A A 1 /* error if object not of given type */ |
|
249 instanceof 3 A I 1 /* is object of given type? */ |
|
250 monitorenter 1 A - 1 /* enter a monitored region of code */ |
|
251 monitorexit 1 A - 1 /* exit a monitored region of code */ |
|
252 wide 0 - - 1 /* prefix operation. */ |
|
253 multianewarray 4 ? A 1 /* create multidimensional array */ |
|
254 ifnull 3 A - 1 /* goto if null */ |
|
255 ifnonnull 3 A - 1 /* goto if not null */ |
|
256 |
|
257 # The following instructions are "long" versions. They allow access to |
|
258 # variables with index greater than 255. |
|
259 |
|
260 goto_w 5 - - 1 /* unconditional goto. 4byte offset */ |
|
261 jsr_w 5 - R 1 /* jump subroutine. 4byte offset */ |
|
262 |
|
263 breakpoint 1 - - 1 /* call breakpoint handler */ |
|
264 |
|
265 # The compiler will not generate any of the following instructions. That |
|
266 # are created by the interpreter from the non _quick versions of the |
|
267 # instructions. |
|
268 |
|
269 ldc_quick 2 - ? 1 |
|
270 ldc_w_quick 3 - ? 1 |
|
271 ldc2_w_quick 3 - ? 1 |
|
272 getfield_quick 3 A ? 1 |
|
273 putfield_quick 3 ? - 1 |
|
274 getfield2_quick 3 A ? 1 |
|
275 putfield2_quick 3 ? - 1 |
|
276 getstatic_quick 3 - ? 1 |
|
277 putstatic_quick 3 ? - 1 |
|
278 getstatic2_quick 3 - ? 1 |
|
279 putstatic2_quick 3 ? _ 1 |
|
280 invokevirtual_quick 3 ? ? 1 |
|
281 invokenonvirtual_quick 3 ? ? 1 |
|
282 invokesuper_quick 3 ? ? 1 |
|
283 invokestatic_quick 3 ? ? 1 |
|
284 invokeinterface_quick 5 ? ? 1 |
|
285 invokevirtualobject_quick 3 ? ? 1 |
|
286 invokeignored_quick 3 ? ? 1 |
|
287 new_quick 3 - A 1 |
|
288 anewarray_quick 3 I A 1 |
|
289 multianewarray_quick 4 ? A 1 |
|
290 checkcast_quick 3 A A 1 |
|
291 instanceof_quick 3 A I 1 |
|
292 |
|
293 # The following are generated when the offset is bigger than 255 |
|
294 |
|
295 invokevirtual_quick_w 3 ? ? 1 |
|
296 getfield_quick_w 3 A ? 1 |
|
297 putfield_quick_w 3 ? - 1 |
|
298 |
|
299 # used for simplification |
|
300 |
|
301 nonnull_quick 1 A - 1 /* throw exception if stacktop null */ |
|