1 /*
2  * Copyright (C) 2007 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package dalvik.bytecode;
18 
19 /**
20  * A list of all normal (not implementation-specific) Dalvik opcodes.
21  */
22 public interface Opcodes {
23     /*
24      * IMPORTANT NOTE: The contents of this file are mostly generated
25      * automatically by the opcode-gen tool. Any edits to the generated
26      * sections will get wiped out the next time the tool is run.
27      */
28 
29     // BEGIN(libcore-opcodes); GENERATED AUTOMATICALLY BY opcode-gen
30     int OP_NOP                          = 0x0000;
31     int OP_MOVE                         = 0x0001;
32     int OP_MOVE_FROM16                  = 0x0002;
33     int OP_MOVE_16                      = 0x0003;
34     int OP_MOVE_WIDE                    = 0x0004;
35     int OP_MOVE_WIDE_FROM16             = 0x0005;
36     int OP_MOVE_WIDE_16                 = 0x0006;
37     int OP_MOVE_OBJECT                  = 0x0007;
38     int OP_MOVE_OBJECT_FROM16           = 0x0008;
39     int OP_MOVE_OBJECT_16               = 0x0009;
40     int OP_MOVE_RESULT                  = 0x000a;
41     int OP_MOVE_RESULT_WIDE             = 0x000b;
42     int OP_MOVE_RESULT_OBJECT           = 0x000c;
43     int OP_MOVE_EXCEPTION               = 0x000d;
44     int OP_RETURN_VOID                  = 0x000e;
45     int OP_RETURN                       = 0x000f;
46     int OP_RETURN_WIDE                  = 0x0010;
47     int OP_RETURN_OBJECT                = 0x0011;
48     int OP_CONST_4                      = 0x0012;
49     int OP_CONST_16                     = 0x0013;
50     int OP_CONST                        = 0x0014;
51     int OP_CONST_HIGH16                 = 0x0015;
52     int OP_CONST_WIDE_16                = 0x0016;
53     int OP_CONST_WIDE_32                = 0x0017;
54     int OP_CONST_WIDE                   = 0x0018;
55     int OP_CONST_WIDE_HIGH16            = 0x0019;
56     int OP_CONST_STRING                 = 0x001a;
57     int OP_CONST_STRING_JUMBO           = 0x001b;
58     int OP_CONST_CLASS                  = 0x001c;
59     int OP_MONITOR_ENTER                = 0x001d;
60     int OP_MONITOR_EXIT                 = 0x001e;
61     int OP_CHECK_CAST                   = 0x001f;
62     int OP_INSTANCE_OF                  = 0x0020;
63     int OP_ARRAY_LENGTH                 = 0x0021;
64     int OP_NEW_INSTANCE                 = 0x0022;
65     int OP_NEW_ARRAY                    = 0x0023;
66     int OP_FILLED_NEW_ARRAY             = 0x0024;
67     int OP_FILLED_NEW_ARRAY_RANGE       = 0x0025;
68     int OP_FILL_ARRAY_DATA              = 0x0026;
69     int OP_THROW                        = 0x0027;
70     int OP_GOTO                         = 0x0028;
71     int OP_GOTO_16                      = 0x0029;
72     int OP_GOTO_32                      = 0x002a;
73     int OP_PACKED_SWITCH                = 0x002b;
74     int OP_SPARSE_SWITCH                = 0x002c;
75     int OP_CMPL_FLOAT                   = 0x002d;
76     int OP_CMPG_FLOAT                   = 0x002e;
77     int OP_CMPL_DOUBLE                  = 0x002f;
78     int OP_CMPG_DOUBLE                  = 0x0030;
79     int OP_CMP_LONG                     = 0x0031;
80     int OP_IF_EQ                        = 0x0032;
81     int OP_IF_NE                        = 0x0033;
82     int OP_IF_LT                        = 0x0034;
83     int OP_IF_GE                        = 0x0035;
84     int OP_IF_GT                        = 0x0036;
85     int OP_IF_LE                        = 0x0037;
86     int OP_IF_EQZ                       = 0x0038;
87     int OP_IF_NEZ                       = 0x0039;
88     int OP_IF_LTZ                       = 0x003a;
89     int OP_IF_GEZ                       = 0x003b;
90     int OP_IF_GTZ                       = 0x003c;
91     int OP_IF_LEZ                       = 0x003d;
92     int OP_AGET                         = 0x0044;
93     int OP_AGET_WIDE                    = 0x0045;
94     int OP_AGET_OBJECT                  = 0x0046;
95     int OP_AGET_BOOLEAN                 = 0x0047;
96     int OP_AGET_BYTE                    = 0x0048;
97     int OP_AGET_CHAR                    = 0x0049;
98     int OP_AGET_SHORT                   = 0x004a;
99     int OP_APUT                         = 0x004b;
100     int OP_APUT_WIDE                    = 0x004c;
101     int OP_APUT_OBJECT                  = 0x004d;
102     int OP_APUT_BOOLEAN                 = 0x004e;
103     int OP_APUT_BYTE                    = 0x004f;
104     int OP_APUT_CHAR                    = 0x0050;
105     int OP_APUT_SHORT                   = 0x0051;
106     int OP_IGET                         = 0x0052;
107     int OP_IGET_WIDE                    = 0x0053;
108     int OP_IGET_OBJECT                  = 0x0054;
109     int OP_IGET_BOOLEAN                 = 0x0055;
110     int OP_IGET_BYTE                    = 0x0056;
111     int OP_IGET_CHAR                    = 0x0057;
112     int OP_IGET_SHORT                   = 0x0058;
113     int OP_IPUT                         = 0x0059;
114     int OP_IPUT_WIDE                    = 0x005a;
115     int OP_IPUT_OBJECT                  = 0x005b;
116     int OP_IPUT_BOOLEAN                 = 0x005c;
117     int OP_IPUT_BYTE                    = 0x005d;
118     int OP_IPUT_CHAR                    = 0x005e;
119     int OP_IPUT_SHORT                   = 0x005f;
120     int OP_SGET                         = 0x0060;
121     int OP_SGET_WIDE                    = 0x0061;
122     int OP_SGET_OBJECT                  = 0x0062;
123     int OP_SGET_BOOLEAN                 = 0x0063;
124     int OP_SGET_BYTE                    = 0x0064;
125     int OP_SGET_CHAR                    = 0x0065;
126     int OP_SGET_SHORT                   = 0x0066;
127     int OP_SPUT                         = 0x0067;
128     int OP_SPUT_WIDE                    = 0x0068;
129     int OP_SPUT_OBJECT                  = 0x0069;
130     int OP_SPUT_BOOLEAN                 = 0x006a;
131     int OP_SPUT_BYTE                    = 0x006b;
132     int OP_SPUT_CHAR                    = 0x006c;
133     int OP_SPUT_SHORT                   = 0x006d;
134     int OP_INVOKE_VIRTUAL               = 0x006e;
135     int OP_INVOKE_SUPER                 = 0x006f;
136     int OP_INVOKE_DIRECT                = 0x0070;
137     int OP_INVOKE_STATIC                = 0x0071;
138     int OP_INVOKE_INTERFACE             = 0x0072;
139     int OP_INVOKE_VIRTUAL_RANGE         = 0x0074;
140     int OP_INVOKE_SUPER_RANGE           = 0x0075;
141     int OP_INVOKE_DIRECT_RANGE          = 0x0076;
142     int OP_INVOKE_STATIC_RANGE          = 0x0077;
143     int OP_INVOKE_INTERFACE_RANGE       = 0x0078;
144     int OP_NEG_INT                      = 0x007b;
145     int OP_NOT_INT                      = 0x007c;
146     int OP_NEG_LONG                     = 0x007d;
147     int OP_NOT_LONG                     = 0x007e;
148     int OP_NEG_FLOAT                    = 0x007f;
149     int OP_NEG_DOUBLE                   = 0x0080;
150     int OP_INT_TO_LONG                  = 0x0081;
151     int OP_INT_TO_FLOAT                 = 0x0082;
152     int OP_INT_TO_DOUBLE                = 0x0083;
153     int OP_LONG_TO_INT                  = 0x0084;
154     int OP_LONG_TO_FLOAT                = 0x0085;
155     int OP_LONG_TO_DOUBLE               = 0x0086;
156     int OP_FLOAT_TO_INT                 = 0x0087;
157     int OP_FLOAT_TO_LONG                = 0x0088;
158     int OP_FLOAT_TO_DOUBLE              = 0x0089;
159     int OP_DOUBLE_TO_INT                = 0x008a;
160     int OP_DOUBLE_TO_LONG               = 0x008b;
161     int OP_DOUBLE_TO_FLOAT              = 0x008c;
162     int OP_INT_TO_BYTE                  = 0x008d;
163     int OP_INT_TO_CHAR                  = 0x008e;
164     int OP_INT_TO_SHORT                 = 0x008f;
165     int OP_ADD_INT                      = 0x0090;
166     int OP_SUB_INT                      = 0x0091;
167     int OP_MUL_INT                      = 0x0092;
168     int OP_DIV_INT                      = 0x0093;
169     int OP_REM_INT                      = 0x0094;
170     int OP_AND_INT                      = 0x0095;
171     int OP_OR_INT                       = 0x0096;
172     int OP_XOR_INT                      = 0x0097;
173     int OP_SHL_INT                      = 0x0098;
174     int OP_SHR_INT                      = 0x0099;
175     int OP_USHR_INT                     = 0x009a;
176     int OP_ADD_LONG                     = 0x009b;
177     int OP_SUB_LONG                     = 0x009c;
178     int OP_MUL_LONG                     = 0x009d;
179     int OP_DIV_LONG                     = 0x009e;
180     int OP_REM_LONG                     = 0x009f;
181     int OP_AND_LONG                     = 0x00a0;
182     int OP_OR_LONG                      = 0x00a1;
183     int OP_XOR_LONG                     = 0x00a2;
184     int OP_SHL_LONG                     = 0x00a3;
185     int OP_SHR_LONG                     = 0x00a4;
186     int OP_USHR_LONG                    = 0x00a5;
187     int OP_ADD_FLOAT                    = 0x00a6;
188     int OP_SUB_FLOAT                    = 0x00a7;
189     int OP_MUL_FLOAT                    = 0x00a8;
190     int OP_DIV_FLOAT                    = 0x00a9;
191     int OP_REM_FLOAT                    = 0x00aa;
192     int OP_ADD_DOUBLE                   = 0x00ab;
193     int OP_SUB_DOUBLE                   = 0x00ac;
194     int OP_MUL_DOUBLE                   = 0x00ad;
195     int OP_DIV_DOUBLE                   = 0x00ae;
196     int OP_REM_DOUBLE                   = 0x00af;
197     int OP_ADD_INT_2ADDR                = 0x00b0;
198     int OP_SUB_INT_2ADDR                = 0x00b1;
199     int OP_MUL_INT_2ADDR                = 0x00b2;
200     int OP_DIV_INT_2ADDR                = 0x00b3;
201     int OP_REM_INT_2ADDR                = 0x00b4;
202     int OP_AND_INT_2ADDR                = 0x00b5;
203     int OP_OR_INT_2ADDR                 = 0x00b6;
204     int OP_XOR_INT_2ADDR                = 0x00b7;
205     int OP_SHL_INT_2ADDR                = 0x00b8;
206     int OP_SHR_INT_2ADDR                = 0x00b9;
207     int OP_USHR_INT_2ADDR               = 0x00ba;
208     int OP_ADD_LONG_2ADDR               = 0x00bb;
209     int OP_SUB_LONG_2ADDR               = 0x00bc;
210     int OP_MUL_LONG_2ADDR               = 0x00bd;
211     int OP_DIV_LONG_2ADDR               = 0x00be;
212     int OP_REM_LONG_2ADDR               = 0x00bf;
213     int OP_AND_LONG_2ADDR               = 0x00c0;
214     int OP_OR_LONG_2ADDR                = 0x00c1;
215     int OP_XOR_LONG_2ADDR               = 0x00c2;
216     int OP_SHL_LONG_2ADDR               = 0x00c3;
217     int OP_SHR_LONG_2ADDR               = 0x00c4;
218     int OP_USHR_LONG_2ADDR              = 0x00c5;
219     int OP_ADD_FLOAT_2ADDR              = 0x00c6;
220     int OP_SUB_FLOAT_2ADDR              = 0x00c7;
221     int OP_MUL_FLOAT_2ADDR              = 0x00c8;
222     int OP_DIV_FLOAT_2ADDR              = 0x00c9;
223     int OP_REM_FLOAT_2ADDR              = 0x00ca;
224     int OP_ADD_DOUBLE_2ADDR             = 0x00cb;
225     int OP_SUB_DOUBLE_2ADDR             = 0x00cc;
226     int OP_MUL_DOUBLE_2ADDR             = 0x00cd;
227     int OP_DIV_DOUBLE_2ADDR             = 0x00ce;
228     int OP_REM_DOUBLE_2ADDR             = 0x00cf;
229     int OP_ADD_INT_LIT16                = 0x00d0;
230     int OP_RSUB_INT                     = 0x00d1;
231     int OP_MUL_INT_LIT16                = 0x00d2;
232     int OP_DIV_INT_LIT16                = 0x00d3;
233     int OP_REM_INT_LIT16                = 0x00d4;
234     int OP_AND_INT_LIT16                = 0x00d5;
235     int OP_OR_INT_LIT16                 = 0x00d6;
236     int OP_XOR_INT_LIT16                = 0x00d7;
237     int OP_ADD_INT_LIT8                 = 0x00d8;
238     int OP_RSUB_INT_LIT8                = 0x00d9;
239     int OP_MUL_INT_LIT8                 = 0x00da;
240     int OP_DIV_INT_LIT8                 = 0x00db;
241     int OP_REM_INT_LIT8                 = 0x00dc;
242     int OP_AND_INT_LIT8                 = 0x00dd;
243     int OP_OR_INT_LIT8                  = 0x00de;
244     int OP_XOR_INT_LIT8                 = 0x00df;
245     int OP_SHL_INT_LIT8                 = 0x00e0;
246     int OP_SHR_INT_LIT8                 = 0x00e1;
247     int OP_USHR_INT_LIT8                = 0x00e2;
248     // END(libcore-opcodes)
249 
250     /** Never implemented; do not use. */
251     int OP_CONST_CLASS_JUMBO            = 0x00ff;
252     /** Never implemented; do not use. */
253     int OP_CHECK_CAST_JUMBO             = 0x01ff;
254     /** Never implemented; do not use. */
255     int OP_INSTANCE_OF_JUMBO            = 0x02ff;
256     /** Never implemented; do not use. */
257     int OP_NEW_INSTANCE_JUMBO           = 0x03ff;
258     /** Never implemented; do not use. */
259     int OP_NEW_ARRAY_JUMBO              = 0x04ff;
260     /** Never implemented; do not use. */
261     int OP_FILLED_NEW_ARRAY_JUMBO       = 0x05ff;
262     /** Never implemented; do not use. */
263     int OP_IGET_JUMBO                   = 0x06ff;
264     /** Never implemented; do not use. */
265     int OP_IGET_WIDE_JUMBO              = 0x07ff;
266     /** Never implemented; do not use. */
267     int OP_IGET_OBJECT_JUMBO            = 0x08ff;
268     /** Never implemented; do not use. */
269     int OP_IGET_BOOLEAN_JUMBO           = 0x09ff;
270     /** Never implemented; do not use. */
271     int OP_IGET_BYTE_JUMBO              = 0x0aff;
272     /** Never implemented; do not use. */
273     int OP_IGET_CHAR_JUMBO              = 0x0bff;
274     /** Never implemented; do not use. */
275     int OP_IGET_SHORT_JUMBO             = 0x0cff;
276     /** Never implemented; do not use. */
277     int OP_IPUT_JUMBO                   = 0x0dff;
278     /** Never implemented; do not use. */
279     int OP_IPUT_WIDE_JUMBO              = 0x0eff;
280     /** Never implemented; do not use. */
281     int OP_IPUT_OBJECT_JUMBO            = 0x0fff;
282     /** Never implemented; do not use. */
283     int OP_IPUT_BOOLEAN_JUMBO           = 0x10ff;
284     /** Never implemented; do not use. */
285     int OP_IPUT_BYTE_JUMBO              = 0x11ff;
286     /** Never implemented; do not use. */
287     int OP_IPUT_CHAR_JUMBO              = 0x12ff;
288     /** Never implemented; do not use. */
289     int OP_IPUT_SHORT_JUMBO             = 0x13ff;
290     /** Never implemented; do not use. */
291     int OP_SGET_JUMBO                   = 0x14ff;
292     /** Never implemented; do not use. */
293     int OP_SGET_WIDE_JUMBO              = 0x15ff;
294     /** Never implemented; do not use. */
295     int OP_SGET_OBJECT_JUMBO            = 0x16ff;
296     /** Never implemented; do not use. */
297     int OP_SGET_BOOLEAN_JUMBO           = 0x17ff;
298     /** Never implemented; do not use. */
299     int OP_SGET_BYTE_JUMBO              = 0x18ff;
300     /** Never implemented; do not use. */
301     int OP_SGET_CHAR_JUMBO              = 0x19ff;
302     /** Never implemented; do not use. */
303     int OP_SGET_SHORT_JUMBO             = 0x1aff;
304     /** Never implemented; do not use. */
305     int OP_SPUT_JUMBO                   = 0x1bff;
306     /** Never implemented; do not use. */
307     int OP_SPUT_WIDE_JUMBO              = 0x1cff;
308     /** Never implemented; do not use. */
309     int OP_SPUT_OBJECT_JUMBO            = 0x1dff;
310     /** Never implemented; do not use. */
311     int OP_SPUT_BOOLEAN_JUMBO           = 0x1eff;
312     /** Never implemented; do not use. */
313     int OP_SPUT_BYTE_JUMBO              = 0x1fff;
314     /** Never implemented; do not use. */
315     int OP_SPUT_CHAR_JUMBO              = 0x20ff;
316     /** Never implemented; do not use. */
317     int OP_SPUT_SHORT_JUMBO             = 0x21ff;
318     /** Never implemented; do not use. */
319     int OP_INVOKE_VIRTUAL_JUMBO         = 0x22ff;
320     /** Never implemented; do not use. */
321     int OP_INVOKE_SUPER_JUMBO           = 0x23ff;
322     /** Never implemented; do not use. */
323     int OP_INVOKE_DIRECT_JUMBO          = 0x24ff;
324     /** Never implemented; do not use. */
325     int OP_INVOKE_STATIC_JUMBO          = 0x25ff;
326     /** Never implemented; do not use. */
327     int OP_INVOKE_INTERFACE_JUMBO       = 0x26ff;
328 
329     /*
330      * The rest of these are either generated by dexopt for optimized
331      * code, or inserted by the VM at runtime.  They are never generated
332      * by "dx".
333      *
334      * They are all deprecated and will be removed in a future
335      * release, since these declarations are really of private implementation
336      * details that are subject to change.
337      */
338 
339     /**
340      * Implementation detail.
341      * @deprecated Implementation detail.
342      */
343     @Deprecated int OP_IGET_WIDE_VOLATILE           = 0xe8;
344 
345     /**
346      * Implementation detail.
347      * @deprecated Implementation detail.
348      */
349     @Deprecated int OP_IPUT_WIDE_VOLATILE           = 0xe9;
350 
351     /**
352      * Implementation detail.
353      * @deprecated Implementation detail.
354      */
355     @Deprecated int OP_SGET_WIDE_VOLATILE           = 0xea;
356 
357     /**
358      * Implementation detail.
359      * @deprecated Implementation detail.
360      */
361     @Deprecated int OP_SPUT_WIDE_VOLATILE           = 0xeb;
362 
363     /**
364      * Implementation detail.
365      * @deprecated Implementation detail.
366      */
367     @Deprecated int OP_BREAKPOINT                   = 0xec;
368 
369     /**
370      * Implementation detail.
371      * @deprecated Implementation detail.
372      */
373     @Deprecated int OP_THROW_VERIFICATION_ERROR     = 0xed;
374 
375     /**
376      * Implementation detail.
377      * @deprecated Implementation detail.
378      */
379     @Deprecated int OP_EXECUTE_INLINE               = 0xee;
380 
381     /**
382      * Implementation detail.
383      * @deprecated Implementation detail.
384      */
385     @Deprecated int OP_EXECUTE_INLINE_RANGE         = 0xef;
386 
387     /**
388      * Implementation detail.
389      * @deprecated Implementation detail.
390      */
391     @Deprecated int OP_INVOKE_DIRECT_EMPTY          = 0xf0;
392 
393     /**
394      * Implementation detail.
395      * @deprecated Implementation detail.
396      */
397     @Deprecated int OP_IGET_QUICK                   = 0xf2;
398 
399     /**
400      * Implementation detail.
401      * @deprecated Implementation detail.
402      */
403     @Deprecated int OP_IGET_WIDE_QUICK              = 0xf3;
404 
405     /**
406      * Implementation detail.
407      * @deprecated Implementation detail.
408      */
409     @Deprecated int OP_IGET_OBJECT_QUICK            = 0xf4;
410 
411     /**
412      * Implementation detail.
413      * @deprecated Implementation detail.
414      */
415     @Deprecated int OP_IPUT_QUICK                   = 0xf5;
416 
417     /**
418      * Implementation detail.
419      * @deprecated Implementation detail.
420      */
421     @Deprecated int OP_IPUT_WIDE_QUICK              = 0xf6;
422 
423     /**
424      * Implementation detail.
425      * @deprecated Implementation detail.
426      */
427     @Deprecated int OP_IPUT_OBJECT_QUICK            = 0xf7;
428 
429     /**
430      * Implementation detail.
431      * @deprecated Implementation detail.
432      */
433     @Deprecated int OP_INVOKE_VIRTUAL_QUICK         = 0xf8;
434 
435     /**
436      * Implementation detail.
437      * @deprecated Implementation detail.
438      */
439     @Deprecated int OP_INVOKE_VIRTUAL_QUICK_RANGE   = 0xf9;
440 
441     /**
442      * Implementation detail.
443      * @deprecated Implementation detail.
444      */
445     @Deprecated int OP_INVOKE_SUPER_QUICK           = 0xfa;
446 
447     /**
448      * Implementation detail.
449      * @deprecated Implementation detail.
450      */
451     @Deprecated int OP_INVOKE_SUPER_QUICK_RANGE     = 0xfb;
452 }
453