1/*
2 * ProGuard -- shrinking, optimization, obfuscation, and preverification
3 *             of Java bytecode.
4 *
5 * Copyright (c) 2002-2014 Eric Lafortune (eric@graphics.cornell.edu)
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the Free
9 * Software Foundation; either version 2 of the License, or (at your option)
10 * any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
15 * more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21package proguard.classfile.instruction;
22
23/**
24 * Representation of an instruction.
25 *
26 * @author Eric Lafortune
27 */
28public interface InstructionConstants
29{
30    public static final byte OP_NOP             = 0;
31    public static final byte OP_ACONST_NULL     = 1;
32    public static final byte OP_ICONST_M1       = 2;
33    public static final byte OP_ICONST_0        = 3;
34    public static final byte OP_ICONST_1        = 4;
35    public static final byte OP_ICONST_2        = 5;
36    public static final byte OP_ICONST_3        = 6;
37    public static final byte OP_ICONST_4        = 7;
38    public static final byte OP_ICONST_5        = 8;
39    public static final byte OP_LCONST_0        = 9;
40    public static final byte OP_LCONST_1        = 10;
41    public static final byte OP_FCONST_0        = 11;
42    public static final byte OP_FCONST_1        = 12;
43    public static final byte OP_FCONST_2        = 13;
44    public static final byte OP_DCONST_0        = 14;
45    public static final byte OP_DCONST_1        = 15;
46    public static final byte OP_BIPUSH          = 16;
47    public static final byte OP_SIPUSH          = 17;
48    public static final byte OP_LDC             = 18;
49    public static final byte OP_LDC_W           = 19;
50    public static final byte OP_LDC2_W          = 20;
51    public static final byte OP_ILOAD           = 21;
52    public static final byte OP_LLOAD           = 22;
53    public static final byte OP_FLOAD           = 23;
54    public static final byte OP_DLOAD           = 24;
55    public static final byte OP_ALOAD           = 25;
56    public static final byte OP_ILOAD_0         = 26;
57    public static final byte OP_ILOAD_1         = 27;
58    public static final byte OP_ILOAD_2         = 28;
59    public static final byte OP_ILOAD_3         = 29;
60    public static final byte OP_LLOAD_0         = 30;
61    public static final byte OP_LLOAD_1         = 31;
62    public static final byte OP_LLOAD_2         = 32;
63    public static final byte OP_LLOAD_3         = 33;
64    public static final byte OP_FLOAD_0         = 34;
65    public static final byte OP_FLOAD_1         = 35;
66    public static final byte OP_FLOAD_2         = 36;
67    public static final byte OP_FLOAD_3         = 37;
68    public static final byte OP_DLOAD_0         = 38;
69    public static final byte OP_DLOAD_1         = 39;
70    public static final byte OP_DLOAD_2         = 40;
71    public static final byte OP_DLOAD_3         = 41;
72    public static final byte OP_ALOAD_0         = 42;
73    public static final byte OP_ALOAD_1         = 43;
74    public static final byte OP_ALOAD_2         = 44;
75    public static final byte OP_ALOAD_3         = 45;
76    public static final byte OP_IALOAD          = 46;
77    public static final byte OP_LALOAD          = 47;
78    public static final byte OP_FALOAD          = 48;
79    public static final byte OP_DALOAD          = 49;
80    public static final byte OP_AALOAD          = 50;
81    public static final byte OP_BALOAD          = 51;
82    public static final byte OP_CALOAD          = 52;
83    public static final byte OP_SALOAD          = 53;
84    public static final byte OP_ISTORE          = 54;
85    public static final byte OP_LSTORE          = 55;
86    public static final byte OP_FSTORE          = 56;
87    public static final byte OP_DSTORE          = 57;
88    public static final byte OP_ASTORE          = 58;
89    public static final byte OP_ISTORE_0        = 59;
90    public static final byte OP_ISTORE_1        = 60;
91    public static final byte OP_ISTORE_2        = 61;
92    public static final byte OP_ISTORE_3        = 62;
93    public static final byte OP_LSTORE_0        = 63;
94    public static final byte OP_LSTORE_1        = 64;
95    public static final byte OP_LSTORE_2        = 65;
96    public static final byte OP_LSTORE_3        = 66;
97    public static final byte OP_FSTORE_0        = 67;
98    public static final byte OP_FSTORE_1        = 68;
99    public static final byte OP_FSTORE_2        = 69;
100    public static final byte OP_FSTORE_3        = 70;
101    public static final byte OP_DSTORE_0        = 71;
102    public static final byte OP_DSTORE_1        = 72;
103    public static final byte OP_DSTORE_2        = 73;
104    public static final byte OP_DSTORE_3        = 74;
105    public static final byte OP_ASTORE_0        = 75;
106    public static final byte OP_ASTORE_1        = 76;
107    public static final byte OP_ASTORE_2        = 77;
108    public static final byte OP_ASTORE_3        = 78;
109    public static final byte OP_IASTORE         = 79;
110    public static final byte OP_LASTORE         = 80;
111    public static final byte OP_FASTORE         = 81;
112    public static final byte OP_DASTORE         = 82;
113    public static final byte OP_AASTORE         = 83;
114    public static final byte OP_BASTORE         = 84;
115    public static final byte OP_CASTORE         = 85;
116    public static final byte OP_SASTORE         = 86;
117    public static final byte OP_POP             = 87;
118    public static final byte OP_POP2            = 88;
119    public static final byte OP_DUP             = 89;
120    public static final byte OP_DUP_X1          = 90;
121    public static final byte OP_DUP_X2          = 91;
122    public static final byte OP_DUP2            = 92;
123    public static final byte OP_DUP2_X1         = 93;
124    public static final byte OP_DUP2_X2         = 94;
125    public static final byte OP_SWAP            = 95;
126    public static final byte OP_IADD            = 96;
127    public static final byte OP_LADD            = 97;
128    public static final byte OP_FADD            = 98;
129    public static final byte OP_DADD            = 99;
130    public static final byte OP_ISUB            = 100;
131    public static final byte OP_LSUB            = 101;
132    public static final byte OP_FSUB            = 102;
133    public static final byte OP_DSUB            = 103;
134    public static final byte OP_IMUL            = 104;
135    public static final byte OP_LMUL            = 105;
136    public static final byte OP_FMUL            = 106;
137    public static final byte OP_DMUL            = 107;
138    public static final byte OP_IDIV            = 108;
139    public static final byte OP_LDIV            = 109;
140    public static final byte OP_FDIV            = 110;
141    public static final byte OP_DDIV            = 111;
142    public static final byte OP_IREM            = 112;
143    public static final byte OP_LREM            = 113;
144    public static final byte OP_FREM            = 114;
145    public static final byte OP_DREM            = 115;
146    public static final byte OP_INEG            = 116;
147    public static final byte OP_LNEG            = 117;
148    public static final byte OP_FNEG            = 118;
149    public static final byte OP_DNEG            = 119;
150    public static final byte OP_ISHL            = 120;
151    public static final byte OP_LSHL            = 121;
152    public static final byte OP_ISHR            = 122;
153    public static final byte OP_LSHR            = 123;
154    public static final byte OP_IUSHR           = 124;
155    public static final byte OP_LUSHR           = 125;
156    public static final byte OP_IAND            = 126;
157    public static final byte OP_LAND            = 127;
158    public static final byte OP_IOR             = -128;
159    public static final byte OP_LOR             = -127;
160    public static final byte OP_IXOR            = -126;
161    public static final byte OP_LXOR            = -125;
162    public static final byte OP_IINC            = -124;
163    public static final byte OP_I2L             = -123;
164    public static final byte OP_I2F             = -122;
165    public static final byte OP_I2D             = -121;
166    public static final byte OP_L2I             = -120;
167    public static final byte OP_L2F             = -119;
168    public static final byte OP_L2D             = -118;
169    public static final byte OP_F2I             = -117;
170    public static final byte OP_F2L             = -116;
171    public static final byte OP_F2D             = -115;
172    public static final byte OP_D2I             = -114;
173    public static final byte OP_D2L             = -113;
174    public static final byte OP_D2F             = -112;
175    public static final byte OP_I2B             = -111;
176    public static final byte OP_I2C             = -110;
177    public static final byte OP_I2S             = -109;
178    public static final byte OP_LCMP            = -108;
179    public static final byte OP_FCMPL           = -107;
180    public static final byte OP_FCMPG           = -106;
181    public static final byte OP_DCMPL           = -105;
182    public static final byte OP_DCMPG           = -104;
183    public static final byte OP_IFEQ            = -103;
184    public static final byte OP_IFNE            = -102;
185    public static final byte OP_IFLT            = -101;
186    public static final byte OP_IFGE            = -100;
187    public static final byte OP_IFGT            = -99;
188    public static final byte OP_IFLE            = -98;
189    public static final byte OP_IFICMPEQ        = -97;
190    public static final byte OP_IFICMPNE        = -96;
191    public static final byte OP_IFICMPLT        = -95;
192    public static final byte OP_IFICMPGE        = -94;
193    public static final byte OP_IFICMPGT        = -93;
194    public static final byte OP_IFICMPLE        = -92;
195    public static final byte OP_IFACMPEQ        = -91;
196    public static final byte OP_IFACMPNE        = -90;
197    public static final byte OP_GOTO            = -89;
198    public static final byte OP_JSR             = -88;
199    public static final byte OP_RET             = -87;
200    public static final byte OP_TABLESWITCH     = -86;
201    public static final byte OP_LOOKUPSWITCH    = -85;
202    public static final byte OP_IRETURN         = -84;
203    public static final byte OP_LRETURN         = -83;
204    public static final byte OP_FRETURN         = -82;
205    public static final byte OP_DRETURN         = -81;
206    public static final byte OP_ARETURN         = -80;
207    public static final byte OP_RETURN          = -79;
208    public static final byte OP_GETSTATIC       = -78;
209    public static final byte OP_PUTSTATIC       = -77;
210    public static final byte OP_GETFIELD        = -76;
211    public static final byte OP_PUTFIELD        = -75;
212    public static final byte OP_INVOKEVIRTUAL   = -74;
213    public static final byte OP_INVOKESPECIAL   = -73;
214    public static final byte OP_INVOKESTATIC    = -72;
215    public static final byte OP_INVOKEINTERFACE = -71;
216    public static final byte OP_INVOKEDYNAMIC   = -70;
217    public static final byte OP_NEW             = -69;
218    public static final byte OP_NEWARRAY        = -68;
219    public static final byte OP_ANEWARRAY       = -67;
220    public static final byte OP_ARRAYLENGTH     = -66;
221    public static final byte OP_ATHROW          = -65;
222    public static final byte OP_CHECKCAST       = -64;
223    public static final byte OP_INSTANCEOF      = -63;
224    public static final byte OP_MONITORENTER    = -62;
225    public static final byte OP_MONITOREXIT     = -61;
226    public static final byte OP_WIDE            = -60;
227    public static final byte OP_MULTIANEWARRAY  = -59;
228    public static final byte OP_IFNULL          = -58;
229    public static final byte OP_IFNONNULL       = -57;
230    public static final byte OP_GOTO_W          = -56;
231    public static final byte OP_JSR_W           = -55;
232
233
234    public static final String[] NAMES =
235    {
236        "nop",
237        "aconst_null",
238        "iconst_m1",
239        "iconst_0",
240        "iconst_1",
241        "iconst_2",
242        "iconst_3",
243        "iconst_4",
244        "iconst_5",
245        "lconst_0",
246        "lconst_1",
247        "fconst_0",
248        "fconst_1",
249        "fconst_2",
250        "dconst_0",
251        "dconst_1",
252        "bipush",
253        "sipush",
254        "ldc",
255        "ldc_w",
256        "ldc2_w",
257        "iload",
258        "lload",
259        "fload",
260        "dload",
261        "aload",
262        "iload_0",
263        "iload_1",
264        "iload_2",
265        "iload_3",
266        "lload_0",
267        "lload_1",
268        "lload_2",
269        "lload_3",
270        "fload_0",
271        "fload_1",
272        "fload_2",
273        "fload_3",
274        "dload_0",
275        "dload_1",
276        "dload_2",
277        "dload_3",
278        "aload_0",
279        "aload_1",
280        "aload_2",
281        "aload_3",
282        "iaload",
283        "laload",
284        "faload",
285        "daload",
286        "aaload",
287        "baload",
288        "caload",
289        "saload",
290        "istore",
291        "lstore",
292        "fstore",
293        "dstore",
294        "astore",
295        "istore_0",
296        "istore_1",
297        "istore_2",
298        "istore_3",
299        "lstore_0",
300        "lstore_1",
301        "lstore_2",
302        "lstore_3",
303        "fstore_0",
304        "fstore_1",
305        "fstore_2",
306        "fstore_3",
307        "dstore_0",
308        "dstore_1",
309        "dstore_2",
310        "dstore_3",
311        "astore_0",
312        "astore_1",
313        "astore_2",
314        "astore_3",
315        "iastore",
316        "lastore",
317        "fastore",
318        "dastore",
319        "aastore",
320        "bastore",
321        "castore",
322        "sastore",
323        "pop",
324        "pop2",
325        "dup",
326        "dup_x1",
327        "dup_x2",
328        "dup2",
329        "dup2_x1",
330        "dup2_x2",
331        "swap",
332        "iadd",
333        "ladd",
334        "fadd",
335        "dadd",
336        "isub",
337        "lsub",
338        "fsub",
339        "dsub",
340        "imul",
341        "lmul",
342        "fmul",
343        "dmul",
344        "idiv",
345        "ldiv",
346        "fdiv",
347        "ddiv",
348        "irem",
349        "lrem",
350        "frem",
351        "drem",
352        "ineg",
353        "lneg",
354        "fneg",
355        "dneg",
356        "ishl",
357        "lshl",
358        "ishr",
359        "lshr",
360        "iushr",
361        "lushr",
362        "iand",
363        "land",
364        "ior",
365        "lor",
366        "ixor",
367        "lxor",
368        "iinc",
369        "i2l",
370        "i2f",
371        "i2d",
372        "l2i",
373        "l2f",
374        "l2d",
375        "f2i",
376        "f2l",
377        "f2d",
378        "d2i",
379        "d2l",
380        "d2f",
381        "i2b",
382        "i2c",
383        "i2s",
384        "lcmp",
385        "fcmpl",
386        "fcmpg",
387        "dcmpl",
388        "dcmpg",
389        "ifeq",
390        "ifne",
391        "iflt",
392        "ifge",
393        "ifgt",
394        "ifle",
395        "ificmpeq",
396        "ificmpne",
397        "ificmplt",
398        "ificmpge",
399        "ificmpgt",
400        "ificmple",
401        "ifacmpeq",
402        "ifacmpne",
403        "goto",
404        "jsr",
405        "ret",
406        "tableswitch",
407        "lookupswitch",
408        "ireturn",
409        "lreturn",
410        "freturn",
411        "dreturn",
412        "areturn",
413        "return",
414        "getstatic",
415        "putstatic",
416        "getfield",
417        "putfield",
418        "invokevirtual",
419        "invokespecial",
420        "invokestatic",
421        "invokeinterface",
422        "invokedynamic",
423        "new",
424        "newarray",
425        "anewarray",
426        "arraylength",
427        "athrow",
428        "checkcast",
429        "instanceof",
430        "monitorenter",
431        "monitorexit",
432        "wide",
433        "multianewarray",
434        "ifnull",
435        "ifnonnull",
436        "goto_w",
437        "jsr_w",
438    };
439
440
441    public static final byte ARRAY_T_BOOLEAN = 4;
442    public static final byte ARRAY_T_CHAR    = 5;
443    public static final byte ARRAY_T_FLOAT   = 6;
444    public static final byte ARRAY_T_DOUBLE  = 7;
445    public static final byte ARRAY_T_BYTE    = 8;
446    public static final byte ARRAY_T_SHORT   = 9;
447    public static final byte ARRAY_T_INT     = 10;
448    public static final byte ARRAY_T_LONG    = 11;
449}
450