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