1 /*
2  * Copyright (c) 2005, 2009, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.  Oracle designates this
8  * particular file as subject to the "Classpath" exception as provided
9  * by Oracle in the LICENSE file that accompanied this code.
10  *
11  * This code is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14  * version 2 for more details (a copy is included in the LICENSE file that
15  * accompanied this code).
16  *
17  * You should have received a copy of the GNU General Public License version
18  * 2 along with this work; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20  *
21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22  * or visit www.oracle.com if you need additional information or have any
23  * questions.
24  */
25 
26 /*
27  * This file is available under and governed by the GNU General Public
28  * License version 2 only, as published by the Free Software Foundation.
29  * However, the following notice accompanied the original version of this
30  * file:
31  *
32  * ASM: a very small and fast Java bytecode manipulation framework
33  * Copyright (c) 2000-2007 INRIA, France Telecom
34  * All rights reserved.
35  *
36  * Redistribution and use in source and binary forms, with or without
37  * modification, are permitted provided that the following conditions
38  * are met:
39  * 1. Redistributions of source code must retain the above copyright
40  *    notice, this list of conditions and the following disclaimer.
41  * 2. Redistributions in binary form must reproduce the above copyright
42  *    notice, this list of conditions and the following disclaimer in the
43  *    documentation and/or other materials provided with the distribution.
44  * 3. Neither the name of the copyright holders nor the names of its
45  *    contributors may be used to endorse or promote products derived from
46  *    this software without specific prior written permission.
47  *
48  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
49  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
52  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
53  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
54  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
55  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
56  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
57  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
58  * THE POSSIBILITY OF SUCH DAMAGE.
59  */
60 package com.sun.xml.internal.ws.org.objectweb.asm;
61 
62 /**
63  * Defines the JVM opcodes, access flags and array type codes. This interface
64  * does not define all the JVM opcodes because some opcodes are automatically
65  * handled. For example, the xLOAD and xSTORE opcodes are automatically replaced
66  * by xLOAD_n and xSTORE_n opcodes when possible. The xLOAD_n and xSTORE_n
67  * opcodes are therefore not defined in this interface. Likewise for LDC,
68  * automatically replaced by LDC_W or LDC2_W when necessary, WIDE, GOTO_W and
69  * JSR_W.
70  *
71  * @author Eric Bruneton
72  * @author Eugene Kuleshov
73  */
74 public interface Opcodes {
75 
76     // versions
77 
78     int V1_1 = 3 << 16 | 45;
79     int V1_2 = 0 << 16 | 46;
80     int V1_3 = 0 << 16 | 47;
81     int V1_4 = 0 << 16 | 48;
82     int V1_5 = 0 << 16 | 49;
83     int V1_6 = 0 << 16 | 50;
84 
85     // access flags
86 
87     int ACC_PUBLIC = 0x0001; // class, field, method
88     int ACC_PRIVATE = 0x0002; // class, field, method
89     int ACC_PROTECTED = 0x0004; // class, field, method
90     int ACC_STATIC = 0x0008; // field, method
91     int ACC_FINAL = 0x0010; // class, field, method
92     int ACC_SUPER = 0x0020; // class
93     int ACC_SYNCHRONIZED = 0x0020; // method
94     int ACC_VOLATILE = 0x0040; // field
95     int ACC_BRIDGE = 0x0040; // method
96     int ACC_VARARGS = 0x0080; // method
97     int ACC_TRANSIENT = 0x0080; // field
98     int ACC_NATIVE = 0x0100; // method
99     int ACC_INTERFACE = 0x0200; // class
100     int ACC_ABSTRACT = 0x0400; // class, method
101     int ACC_STRICT = 0x0800; // method
102     int ACC_SYNTHETIC = 0x1000; // class, field, method
103     int ACC_ANNOTATION = 0x2000; // class
104     int ACC_ENUM = 0x4000; // class(?) field inner
105 
106     // ASM specific pseudo access flags
107 
108     int ACC_DEPRECATED = 131072; // class, field, method
109 
110     // types for NEWARRAY
111 
112     int T_BOOLEAN = 4;
113     int T_CHAR = 5;
114     int T_FLOAT = 6;
115     int T_DOUBLE = 7;
116     int T_BYTE = 8;
117     int T_SHORT = 9;
118     int T_INT = 10;
119     int T_LONG = 11;
120 
121     // stack map frame types
122 
123     /**
124      * Represents an expanded frame. See {@link ClassReader#EXPAND_FRAMES}.
125      */
126     int F_NEW = -1;
127 
128     /**
129      * Represents a compressed frame with complete frame data.
130      */
131     int F_FULL = 0;
132 
133     /**
134      * Represents a compressed frame where locals are the same as the locals in
135      * the previous frame, except that additional 1-3 locals are defined, and
136      * with an empty stack.
137      */
138     int F_APPEND = 1;
139 
140     /**
141      * Represents a compressed frame where locals are the same as the locals in
142      * the previous frame, except that the last 1-3 locals are absent and with
143      * an empty stack.
144      */
145     int F_CHOP = 2;
146 
147     /**
148      * Represents a compressed frame with exactly the same locals as the
149      * previous frame and with an empty stack.
150      */
151     int F_SAME = 3;
152 
153     /**
154      * Represents a compressed frame with exactly the same locals as the
155      * previous frame and with a single value on the stack.
156      */
157     int F_SAME1 = 4;
158 
159     Integer TOP = new Integer(0);
160     Integer INTEGER = new Integer(1);
161     Integer FLOAT = new Integer(2);
162     Integer DOUBLE = new Integer(3);
163     Integer LONG = new Integer(4);
164     Integer NULL = new Integer(5);
165     Integer UNINITIALIZED_THIS = new Integer(6);
166 
167     // opcodes // visit method (- = idem)
168 
169     int NOP = 0; // visitInsn
170     int ACONST_NULL = 1; // -
171     int ICONST_M1 = 2; // -
172     int ICONST_0 = 3; // -
173     int ICONST_1 = 4; // -
174     int ICONST_2 = 5; // -
175     int ICONST_3 = 6; // -
176     int ICONST_4 = 7; // -
177     int ICONST_5 = 8; // -
178     int LCONST_0 = 9; // -
179     int LCONST_1 = 10; // -
180     int FCONST_0 = 11; // -
181     int FCONST_1 = 12; // -
182     int FCONST_2 = 13; // -
183     int DCONST_0 = 14; // -
184     int DCONST_1 = 15; // -
185     int BIPUSH = 16; // visitIntInsn
186     int SIPUSH = 17; // -
187     int LDC = 18; // visitLdcInsn
188     // int LDC_W = 19; // -
189     // int LDC2_W = 20; // -
190     int ILOAD = 21; // visitVarInsn
191     int LLOAD = 22; // -
192     int FLOAD = 23; // -
193     int DLOAD = 24; // -
194     int ALOAD = 25; // -
195     // int ILOAD_0 = 26; // -
196     // int ILOAD_1 = 27; // -
197     // int ILOAD_2 = 28; // -
198     // int ILOAD_3 = 29; // -
199     // int LLOAD_0 = 30; // -
200     // int LLOAD_1 = 31; // -
201     // int LLOAD_2 = 32; // -
202     // int LLOAD_3 = 33; // -
203     // int FLOAD_0 = 34; // -
204     // int FLOAD_1 = 35; // -
205     // int FLOAD_2 = 36; // -
206     // int FLOAD_3 = 37; // -
207     // int DLOAD_0 = 38; // -
208     // int DLOAD_1 = 39; // -
209     // int DLOAD_2 = 40; // -
210     // int DLOAD_3 = 41; // -
211     // int ALOAD_0 = 42; // -
212     // int ALOAD_1 = 43; // -
213     // int ALOAD_2 = 44; // -
214     // int ALOAD_3 = 45; // -
215     int IALOAD = 46; // visitInsn
216     int LALOAD = 47; // -
217     int FALOAD = 48; // -
218     int DALOAD = 49; // -
219     int AALOAD = 50; // -
220     int BALOAD = 51; // -
221     int CALOAD = 52; // -
222     int SALOAD = 53; // -
223     int ISTORE = 54; // visitVarInsn
224     int LSTORE = 55; // -
225     int FSTORE = 56; // -
226     int DSTORE = 57; // -
227     int ASTORE = 58; // -
228     // int ISTORE_0 = 59; // -
229     // int ISTORE_1 = 60; // -
230     // int ISTORE_2 = 61; // -
231     // int ISTORE_3 = 62; // -
232     // int LSTORE_0 = 63; // -
233     // int LSTORE_1 = 64; // -
234     // int LSTORE_2 = 65; // -
235     // int LSTORE_3 = 66; // -
236     // int FSTORE_0 = 67; // -
237     // int FSTORE_1 = 68; // -
238     // int FSTORE_2 = 69; // -
239     // int FSTORE_3 = 70; // -
240     // int DSTORE_0 = 71; // -
241     // int DSTORE_1 = 72; // -
242     // int DSTORE_2 = 73; // -
243     // int DSTORE_3 = 74; // -
244     // int ASTORE_0 = 75; // -
245     // int ASTORE_1 = 76; // -
246     // int ASTORE_2 = 77; // -
247     // int ASTORE_3 = 78; // -
248     int IASTORE = 79; // visitInsn
249     int LASTORE = 80; // -
250     int FASTORE = 81; // -
251     int DASTORE = 82; // -
252     int AASTORE = 83; // -
253     int BASTORE = 84; // -
254     int CASTORE = 85; // -
255     int SASTORE = 86; // -
256     int POP = 87; // -
257     int POP2 = 88; // -
258     int DUP = 89; // -
259     int DUP_X1 = 90; // -
260     int DUP_X2 = 91; // -
261     int DUP2 = 92; // -
262     int DUP2_X1 = 93; // -
263     int DUP2_X2 = 94; // -
264     int SWAP = 95; // -
265     int IADD = 96; // -
266     int LADD = 97; // -
267     int FADD = 98; // -
268     int DADD = 99; // -
269     int ISUB = 100; // -
270     int LSUB = 101; // -
271     int FSUB = 102; // -
272     int DSUB = 103; // -
273     int IMUL = 104; // -
274     int LMUL = 105; // -
275     int FMUL = 106; // -
276     int DMUL = 107; // -
277     int IDIV = 108; // -
278     int LDIV = 109; // -
279     int FDIV = 110; // -
280     int DDIV = 111; // -
281     int IREM = 112; // -
282     int LREM = 113; // -
283     int FREM = 114; // -
284     int DREM = 115; // -
285     int INEG = 116; // -
286     int LNEG = 117; // -
287     int FNEG = 118; // -
288     int DNEG = 119; // -
289     int ISHL = 120; // -
290     int LSHL = 121; // -
291     int ISHR = 122; // -
292     int LSHR = 123; // -
293     int IUSHR = 124; // -
294     int LUSHR = 125; // -
295     int IAND = 126; // -
296     int LAND = 127; // -
297     int IOR = 128; // -
298     int LOR = 129; // -
299     int IXOR = 130; // -
300     int LXOR = 131; // -
301     int IINC = 132; // visitIincInsn
302     int I2L = 133; // visitInsn
303     int I2F = 134; // -
304     int I2D = 135; // -
305     int L2I = 136; // -
306     int L2F = 137; // -
307     int L2D = 138; // -
308     int F2I = 139; // -
309     int F2L = 140; // -
310     int F2D = 141; // -
311     int D2I = 142; // -
312     int D2L = 143; // -
313     int D2F = 144; // -
314     int I2B = 145; // -
315     int I2C = 146; // -
316     int I2S = 147; // -
317     int LCMP = 148; // -
318     int FCMPL = 149; // -
319     int FCMPG = 150; // -
320     int DCMPL = 151; // -
321     int DCMPG = 152; // -
322     int IFEQ = 153; // visitJumpInsn
323     int IFNE = 154; // -
324     int IFLT = 155; // -
325     int IFGE = 156; // -
326     int IFGT = 157; // -
327     int IFLE = 158; // -
328     int IF_ICMPEQ = 159; // -
329     int IF_ICMPNE = 160; // -
330     int IF_ICMPLT = 161; // -
331     int IF_ICMPGE = 162; // -
332     int IF_ICMPGT = 163; // -
333     int IF_ICMPLE = 164; // -
334     int IF_ACMPEQ = 165; // -
335     int IF_ACMPNE = 166; // -
336     int GOTO = 167; // -
337     int JSR = 168; // -
338     int RET = 169; // visitVarInsn
339     int TABLESWITCH = 170; // visiTableSwitchInsn
340     int LOOKUPSWITCH = 171; // visitLookupSwitch
341     int IRETURN = 172; // visitInsn
342     int LRETURN = 173; // -
343     int FRETURN = 174; // -
344     int DRETURN = 175; // -
345     int ARETURN = 176; // -
346     int RETURN = 177; // -
347     int GETSTATIC = 178; // visitFieldInsn
348     int PUTSTATIC = 179; // -
349     int GETFIELD = 180; // -
350     int PUTFIELD = 181; // -
351     int INVOKEVIRTUAL = 182; // visitMethodInsn
352     int INVOKESPECIAL = 183; // -
353     int INVOKESTATIC = 184; // -
354     int INVOKEINTERFACE = 185; // -
355     // int UNUSED = 186; // NOT VISITED
356     int NEW = 187; // visitTypeInsn
357     int NEWARRAY = 188; // visitIntInsn
358     int ANEWARRAY = 189; // visitTypeInsn
359     int ARRAYLENGTH = 190; // visitInsn
360     int ATHROW = 191; // -
361     int CHECKCAST = 192; // visitTypeInsn
362     int INSTANCEOF = 193; // -
363     int MONITORENTER = 194; // visitInsn
364     int MONITOREXIT = 195; // -
365     // int WIDE = 196; // NOT VISITED
366     int MULTIANEWARRAY = 197; // visitMultiANewArrayInsn
367     int IFNULL = 198; // visitJumpInsn
368     int IFNONNULL = 199; // -
369     // int GOTO_W = 200; // -
370     // int JSR_W = 201; // -
371 }
372