1 /* |
|
2 * Copyright (c) 2001, 2013, 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 Java Class Version numbers history |
|
28 1.0 to 1.3.X 45,3 |
|
29 1.4 to 1.4.X 46,0 |
|
30 1.5 to 1.5.X 49,0 |
|
31 1.6 to 1.5.x 50,0 NOTE Assumed for now |
|
32 */ |
|
33 |
|
34 // classfile constants |
|
35 #define JAVA_MAGIC 0xCAFEBABE |
|
36 #define JAVA_MIN_MAJOR_VERSION 45 |
|
37 #define JAVA_MIN_MINOR_VERSION 3 |
|
38 |
|
39 #define JAVA5_MAX_MAJOR_VERSION 49 |
|
40 #define JAVA5_MAX_MINOR_VERSION 0 |
|
41 |
|
42 #define JAVA6_MAX_MAJOR_VERSION 50 |
|
43 #define JAVA6_MAX_MINOR_VERSION 0 |
|
44 |
|
45 #define JAVA7_MAX_MAJOR_VERSION 51 |
|
46 #define JAVA7_MAX_MINOR_VERSION 0 |
|
47 |
|
48 #define JAVA8_MAX_MAJOR_VERSION 52 |
|
49 #define JAVA8_MAX_MINOR_VERSION 0 |
|
50 |
|
51 // package file constants |
|
52 #define JAVA_PACKAGE_MAGIC 0xCAFED00D |
|
53 #define JAVA5_PACKAGE_MAJOR_VERSION 150 |
|
54 #define JAVA5_PACKAGE_MINOR_VERSION 7 |
|
55 |
|
56 #define JAVA6_PACKAGE_MAJOR_VERSION 160 |
|
57 #define JAVA6_PACKAGE_MINOR_VERSION 1 |
|
58 |
|
59 #define JAVA7_PACKAGE_MAJOR_VERSION 170 |
|
60 #define JAVA7_PACKAGE_MINOR_VERSION 1 |
|
61 |
|
62 #define JAVA8_PACKAGE_MAJOR_VERSION 171 |
|
63 #define JAVA8_PACKAGE_MINOR_VERSION 0 |
|
64 |
|
65 // magic number for gzip streams (for processing pack200-gzip data) |
|
66 #define GZIP_MAGIC 0x1F8B0800 |
|
67 #define GZIP_MAGIC_MASK 0xFFFFFF00 // last byte is variable "flg" field |
|
68 |
|
69 enum { |
|
70 CONSTANT_None = 0, |
|
71 CONSTANT_Utf8 = 1, |
|
72 CONSTANT_unused = 2, /* unused, was Unicode */ |
|
73 CONSTANT_Integer = 3, |
|
74 CONSTANT_Float = 4, |
|
75 CONSTANT_Long = 5, |
|
76 CONSTANT_Double = 6, |
|
77 CONSTANT_Class = 7, |
|
78 CONSTANT_String = 8, |
|
79 CONSTANT_Fieldref = 9, |
|
80 CONSTANT_Methodref = 10, |
|
81 CONSTANT_InterfaceMethodref = 11, |
|
82 CONSTANT_NameandType = 12, |
|
83 CONSTANT_unused13 = 13, |
|
84 CONSTANT_unused14 = 14, |
|
85 CONSTANT_MethodHandle = 15, |
|
86 CONSTANT_MethodType = 16, |
|
87 CONSTANT_unused17 = 17, |
|
88 CONSTANT_InvokeDynamic = 18, |
|
89 CONSTANT_Limit = 19, |
|
90 CONSTANT_Signature = CONSTANT_unused13, |
|
91 CONSTANT_BootstrapMethod = CONSTANT_unused17, // used only for InvokeDynamic |
|
92 CONSTANT_All = 50, // combined global map |
|
93 CONSTANT_LoadableValue = 51, // used for 'KL' and qldc operands |
|
94 CONSTANT_AnyMember = 52, // union of refs to field or (interface) method |
|
95 CONSTANT_FieldSpecific = 53, // used only for 'KQ' ConstantValue attrs |
|
96 CONSTANT_GroupFirst = CONSTANT_All, // start group marker |
|
97 CONSTANT_GroupLimit = 54, // end group marker |
|
98 |
|
99 // CONSTANT_MethodHandle reference kinds |
|
100 REF_getField = 1, |
|
101 REF_getStatic = 2, |
|
102 REF_putField = 3, |
|
103 REF_putStatic = 4, |
|
104 REF_invokeVirtual = 5, |
|
105 REF_invokeStatic = 6, |
|
106 REF_invokeSpecial = 7, |
|
107 REF_newInvokeSpecial = 8, |
|
108 REF_invokeInterface = 9, |
|
109 |
|
110 SUBINDEX_BIT = 64, // combined with CONSTANT_xxx for ixTag |
|
111 |
|
112 ACC_STATIC = 0x0008, |
|
113 ACC_IC_LONG_FORM = (1<<16), //for ic_flags |
|
114 |
|
115 CLASS_ATTR_SourceFile = 17, |
|
116 CLASS_ATTR_EnclosingMethod = 18, |
|
117 CLASS_ATTR_InnerClasses = 23, |
|
118 CLASS_ATTR_ClassFile_version = 24, |
|
119 CLASS_ATTR_BootstrapMethods = 25, |
|
120 FIELD_ATTR_ConstantValue = 17, |
|
121 METHOD_ATTR_Code = 17, |
|
122 METHOD_ATTR_Exceptions = 18, |
|
123 METHOD_ATTR_RuntimeVisibleParameterAnnotations = 23, |
|
124 METHOD_ATTR_RuntimeInvisibleParameterAnnotations = 24, |
|
125 METHOD_ATTR_AnnotationDefault = 25, |
|
126 METHOD_ATTR_MethodParameters = 26, |
|
127 CODE_ATTR_StackMapTable = 0, |
|
128 CODE_ATTR_LineNumberTable = 1, |
|
129 CODE_ATTR_LocalVariableTable = 2, |
|
130 CODE_ATTR_LocalVariableTypeTable = 3, |
|
131 //X_ATTR_Synthetic = 12, // ACC_SYNTHETIC; not predefined |
|
132 X_ATTR_Signature = 19, |
|
133 X_ATTR_Deprecated = 20, |
|
134 X_ATTR_RuntimeVisibleAnnotations = 21, |
|
135 X_ATTR_RuntimeInvisibleAnnotations = 22, |
|
136 X_ATTR_RuntimeVisibleTypeAnnotations = 27, |
|
137 X_ATTR_RuntimeInvisibleTypeAnnotations = 28, |
|
138 X_ATTR_OVERFLOW = 16, |
|
139 X_ATTR_LIMIT_NO_FLAGS_HI = 32, |
|
140 X_ATTR_LIMIT_FLAGS_HI = 63, |
|
141 |
|
142 #define O_ATTR_DO(F) \ |
|
143 F(X_ATTR_OVERFLOW,01) \ |
|
144 /*(end)*/ |
|
145 #define X_ATTR_DO(F) \ |
|
146 O_ATTR_DO(F) \ |
|
147 F(X_ATTR_Signature,Signature) \ |
|
148 F(X_ATTR_Deprecated,Deprecated) \ |
|
149 F(X_ATTR_RuntimeVisibleAnnotations,RuntimeVisibleAnnotations) \ |
|
150 F(X_ATTR_RuntimeInvisibleAnnotations,RuntimeInvisibleAnnotations) \ |
|
151 F(X_ATTR_RuntimeVisibleTypeAnnotations,RuntimeVisibleTypeAnnotations) \ |
|
152 F(X_ATTR_RuntimeInvisibleTypeAnnotations,RuntimeInvisibleTypeAnnotations) \ |
|
153 /*F(X_ATTR_Synthetic,Synthetic)*/ \ |
|
154 /*(end)*/ |
|
155 #define CLASS_ATTR_DO(F) \ |
|
156 F(CLASS_ATTR_SourceFile,SourceFile) \ |
|
157 F(CLASS_ATTR_InnerClasses,InnerClasses) \ |
|
158 F(CLASS_ATTR_EnclosingMethod,EnclosingMethod) \ |
|
159 F(CLASS_ATTR_ClassFile_version,02) \ |
|
160 F(CLASS_ATTR_BootstrapMethods,BootstrapMethods) \ |
|
161 /*(end)*/ |
|
162 #define FIELD_ATTR_DO(F) \ |
|
163 F(FIELD_ATTR_ConstantValue,ConstantValue) \ |
|
164 /*(end)*/ |
|
165 #define METHOD_ATTR_DO(F) \ |
|
166 F(METHOD_ATTR_Code,Code) \ |
|
167 F(METHOD_ATTR_Exceptions,Exceptions) \ |
|
168 F(METHOD_ATTR_RuntimeVisibleParameterAnnotations,RuntimeVisibleParameterAnnotations) \ |
|
169 F(METHOD_ATTR_RuntimeInvisibleParameterAnnotations,RuntimeInvisibleParameterAnnotations) \ |
|
170 F(METHOD_ATTR_AnnotationDefault,AnnotationDefault) \ |
|
171 F(METHOD_ATTR_MethodParameters,MethodParameters) \ |
|
172 /*(end)*/ |
|
173 #define CODE_ATTR_DO(F) \ |
|
174 F(CODE_ATTR_StackMapTable,StackMapTable) \ |
|
175 F(CODE_ATTR_LineNumberTable,LineNumberTable) \ |
|
176 F(CODE_ATTR_LocalVariableTable,LocalVariableTable) \ |
|
177 F(CODE_ATTR_LocalVariableTypeTable,LocalVariableTypeTable) \ |
|
178 /*(end)*/ |
|
179 #define ALL_ATTR_DO(F) \ |
|
180 X_ATTR_DO(F) \ |
|
181 CLASS_ATTR_DO(F) \ |
|
182 FIELD_ATTR_DO(F) \ |
|
183 METHOD_ATTR_DO(F) \ |
|
184 CODE_ATTR_DO(F) \ |
|
185 /*(end)*/ |
|
186 |
|
187 // attribute "context types" |
|
188 ATTR_CONTEXT_CLASS = 0, |
|
189 ATTR_CONTEXT_FIELD = 1, |
|
190 ATTR_CONTEXT_METHOD = 2, |
|
191 ATTR_CONTEXT_CODE = 3, |
|
192 ATTR_CONTEXT_LIMIT = 4, |
|
193 |
|
194 // constants for parsed layouts (stored in band::le_kind) |
|
195 EK_NONE = 0, // not a layout element |
|
196 EK_INT = 'I', // B H I SH etc., also FH etc. |
|
197 EK_BCI = 'P', // PH etc. |
|
198 EK_BCID = 'Q', // POH etc. |
|
199 EK_BCO = 'O', // OH etc. |
|
200 EK_REPL = 'N', // NH[...] etc. |
|
201 EK_REF = 'R', // RUH, RUNH, KQH, etc. |
|
202 EK_UN = 'T', // TB(...)[...] etc. |
|
203 EK_CASE = 'K', // (...)[...] etc. |
|
204 EK_CALL = '(', // (0), (1), etc. |
|
205 EK_CBLE = '[', // [...][...] etc. |
|
206 NO_BAND_INDEX = -1, |
|
207 |
|
208 // File option bits, from LSB in ascending bit position. |
|
209 FO_DEFLATE_HINT = 1<<0, |
|
210 FO_IS_CLASS_STUB = 1<<1, |
|
211 |
|
212 // Archive option bits, from LSB in ascending bit position: |
|
213 AO_HAVE_SPECIAL_FORMATS = 1<<0, |
|
214 AO_HAVE_CP_NUMBERS = 1<<1, |
|
215 AO_HAVE_ALL_CODE_FLAGS = 1<<2, |
|
216 AO_HAVE_CP_EXTRAS = 1<<3, |
|
217 AO_HAVE_FILE_HEADERS = 1<<4, |
|
218 AO_DEFLATE_HINT = 1<<5, |
|
219 AO_HAVE_FILE_MODTIME = 1<<6, |
|
220 AO_HAVE_FILE_OPTIONS = 1<<7, |
|
221 AO_HAVE_FILE_SIZE_HI = 1<<8, |
|
222 AO_HAVE_CLASS_FLAGS_HI = 1<<9, |
|
223 AO_HAVE_FIELD_FLAGS_HI = 1<<10, |
|
224 AO_HAVE_METHOD_FLAGS_HI = 1<<11, |
|
225 AO_HAVE_CODE_FLAGS_HI = 1<<12, |
|
226 AO_UNUSED_MBZ = (-1)<<13, // options bits reserved for future use. |
|
227 |
|
228 #define ARCHIVE_BIT_DO(F) \ |
|
229 F(AO_HAVE_SPECIAL_FORMATS) \ |
|
230 F(AO_HAVE_CP_NUMBERS) \ |
|
231 F(AO_HAVE_ALL_CODE_FLAGS) \ |
|
232 F(AO_HAVE_CP_EXTRAS) \ |
|
233 F(AO_HAVE_FILE_HEADERS) \ |
|
234 F(AO_DEFLATE_HINT) \ |
|
235 F(AO_HAVE_FILE_MODTIME) \ |
|
236 F(AO_HAVE_FILE_OPTIONS) \ |
|
237 F(AO_HAVE_FILE_SIZE_HI) \ |
|
238 F(AO_HAVE_CLASS_FLAGS_HI) \ |
|
239 F(AO_HAVE_FIELD_FLAGS_HI) \ |
|
240 F(AO_HAVE_METHOD_FLAGS_HI) \ |
|
241 F(AO_HAVE_CODE_FLAGS_HI) \ |
|
242 /*(end)*/ |
|
243 |
|
244 // Constants for decoding attribute definition header bytes. |
|
245 ADH_CONTEXT_MASK = 0x3, // (hdr & ADH_CONTEXT_MASK) |
|
246 ADH_BIT_SHIFT = 0x2, // (hdr >> ADH_BIT_SHIFT) |
|
247 ADH_BIT_IS_LSB = 1, // (hdr >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB |
|
248 #define ADH_BYTE(context, index) \ |
|
249 ((((index) + ADH_BIT_IS_LSB)<<ADH_BIT_SHIFT) + (context)) |
|
250 #define ADH_BYTE_CONTEXT(adhb) \ |
|
251 ((adhb) & ADH_CONTEXT_MASK) |
|
252 #define ADH_BYTE_INDEX(adhb) \ |
|
253 (((adhb) >> ADH_BIT_SHIFT) - ADH_BIT_IS_LSB) |
|
254 |
|
255 NO_MODTIME = 0, // null modtime value |
|
256 |
|
257 // meta-coding |
|
258 _meta_default = 0, |
|
259 _meta_canon_min = 1, |
|
260 _meta_canon_max = 115, |
|
261 _meta_arb = 116, |
|
262 _meta_run = 117, |
|
263 _meta_pop = 141, |
|
264 _meta_limit = 189, |
|
265 _meta_error = 255, |
|
266 |
|
267 _xxx_1_end |
|
268 }; |
|
269 |
|
270 // Bytecodes. |
|
271 |
|
272 enum { |
|
273 bc_nop = 0, // 0x00 |
|
274 bc_aconst_null = 1, // 0x01 |
|
275 bc_iconst_m1 = 2, // 0x02 |
|
276 bc_iconst_0 = 3, // 0x03 |
|
277 bc_iconst_1 = 4, // 0x04 |
|
278 bc_iconst_2 = 5, // 0x05 |
|
279 bc_iconst_3 = 6, // 0x06 |
|
280 bc_iconst_4 = 7, // 0x07 |
|
281 bc_iconst_5 = 8, // 0x08 |
|
282 bc_lconst_0 = 9, // 0x09 |
|
283 bc_lconst_1 = 10, // 0x0a |
|
284 bc_fconst_0 = 11, // 0x0b |
|
285 bc_fconst_1 = 12, // 0x0c |
|
286 bc_fconst_2 = 13, // 0x0d |
|
287 bc_dconst_0 = 14, // 0x0e |
|
288 bc_dconst_1 = 15, // 0x0f |
|
289 bc_bipush = 16, // 0x10 |
|
290 bc_sipush = 17, // 0x11 |
|
291 bc_ldc = 18, // 0x12 |
|
292 bc_ldc_w = 19, // 0x13 |
|
293 bc_ldc2_w = 20, // 0x14 |
|
294 bc_iload = 21, // 0x15 |
|
295 bc_lload = 22, // 0x16 |
|
296 bc_fload = 23, // 0x17 |
|
297 bc_dload = 24, // 0x18 |
|
298 bc_aload = 25, // 0x19 |
|
299 bc_iload_0 = 26, // 0x1a |
|
300 bc_iload_1 = 27, // 0x1b |
|
301 bc_iload_2 = 28, // 0x1c |
|
302 bc_iload_3 = 29, // 0x1d |
|
303 bc_lload_0 = 30, // 0x1e |
|
304 bc_lload_1 = 31, // 0x1f |
|
305 bc_lload_2 = 32, // 0x20 |
|
306 bc_lload_3 = 33, // 0x21 |
|
307 bc_fload_0 = 34, // 0x22 |
|
308 bc_fload_1 = 35, // 0x23 |
|
309 bc_fload_2 = 36, // 0x24 |
|
310 bc_fload_3 = 37, // 0x25 |
|
311 bc_dload_0 = 38, // 0x26 |
|
312 bc_dload_1 = 39, // 0x27 |
|
313 bc_dload_2 = 40, // 0x28 |
|
314 bc_dload_3 = 41, // 0x29 |
|
315 bc_aload_0 = 42, // 0x2a |
|
316 bc_aload_1 = 43, // 0x2b |
|
317 bc_aload_2 = 44, // 0x2c |
|
318 bc_aload_3 = 45, // 0x2d |
|
319 bc_iaload = 46, // 0x2e |
|
320 bc_laload = 47, // 0x2f |
|
321 bc_faload = 48, // 0x30 |
|
322 bc_daload = 49, // 0x31 |
|
323 bc_aaload = 50, // 0x32 |
|
324 bc_baload = 51, // 0x33 |
|
325 bc_caload = 52, // 0x34 |
|
326 bc_saload = 53, // 0x35 |
|
327 bc_istore = 54, // 0x36 |
|
328 bc_lstore = 55, // 0x37 |
|
329 bc_fstore = 56, // 0x38 |
|
330 bc_dstore = 57, // 0x39 |
|
331 bc_astore = 58, // 0x3a |
|
332 bc_istore_0 = 59, // 0x3b |
|
333 bc_istore_1 = 60, // 0x3c |
|
334 bc_istore_2 = 61, // 0x3d |
|
335 bc_istore_3 = 62, // 0x3e |
|
336 bc_lstore_0 = 63, // 0x3f |
|
337 bc_lstore_1 = 64, // 0x40 |
|
338 bc_lstore_2 = 65, // 0x41 |
|
339 bc_lstore_3 = 66, // 0x42 |
|
340 bc_fstore_0 = 67, // 0x43 |
|
341 bc_fstore_1 = 68, // 0x44 |
|
342 bc_fstore_2 = 69, // 0x45 |
|
343 bc_fstore_3 = 70, // 0x46 |
|
344 bc_dstore_0 = 71, // 0x47 |
|
345 bc_dstore_1 = 72, // 0x48 |
|
346 bc_dstore_2 = 73, // 0x49 |
|
347 bc_dstore_3 = 74, // 0x4a |
|
348 bc_astore_0 = 75, // 0x4b |
|
349 bc_astore_1 = 76, // 0x4c |
|
350 bc_astore_2 = 77, // 0x4d |
|
351 bc_astore_3 = 78, // 0x4e |
|
352 bc_iastore = 79, // 0x4f |
|
353 bc_lastore = 80, // 0x50 |
|
354 bc_fastore = 81, // 0x51 |
|
355 bc_dastore = 82, // 0x52 |
|
356 bc_aastore = 83, // 0x53 |
|
357 bc_bastore = 84, // 0x54 |
|
358 bc_castore = 85, // 0x55 |
|
359 bc_sastore = 86, // 0x56 |
|
360 bc_pop = 87, // 0x57 |
|
361 bc_pop2 = 88, // 0x58 |
|
362 bc_dup = 89, // 0x59 |
|
363 bc_dup_x1 = 90, // 0x5a |
|
364 bc_dup_x2 = 91, // 0x5b |
|
365 bc_dup2 = 92, // 0x5c |
|
366 bc_dup2_x1 = 93, // 0x5d |
|
367 bc_dup2_x2 = 94, // 0x5e |
|
368 bc_swap = 95, // 0x5f |
|
369 bc_iadd = 96, // 0x60 |
|
370 bc_ladd = 97, // 0x61 |
|
371 bc_fadd = 98, // 0x62 |
|
372 bc_dadd = 99, // 0x63 |
|
373 bc_isub = 100, // 0x64 |
|
374 bc_lsub = 101, // 0x65 |
|
375 bc_fsub = 102, // 0x66 |
|
376 bc_dsub = 103, // 0x67 |
|
377 bc_imul = 104, // 0x68 |
|
378 bc_lmul = 105, // 0x69 |
|
379 bc_fmul = 106, // 0x6a |
|
380 bc_dmul = 107, // 0x6b |
|
381 bc_idiv = 108, // 0x6c |
|
382 bc_ldiv = 109, // 0x6d |
|
383 bc_fdiv = 110, // 0x6e |
|
384 bc_ddiv = 111, // 0x6f |
|
385 bc_irem = 112, // 0x70 |
|
386 bc_lrem = 113, // 0x71 |
|
387 bc_frem = 114, // 0x72 |
|
388 bc_drem = 115, // 0x73 |
|
389 bc_ineg = 116, // 0x74 |
|
390 bc_lneg = 117, // 0x75 |
|
391 bc_fneg = 118, // 0x76 |
|
392 bc_dneg = 119, // 0x77 |
|
393 bc_ishl = 120, // 0x78 |
|
394 bc_lshl = 121, // 0x79 |
|
395 bc_ishr = 122, // 0x7a |
|
396 bc_lshr = 123, // 0x7b |
|
397 bc_iushr = 124, // 0x7c |
|
398 bc_lushr = 125, // 0x7d |
|
399 bc_iand = 126, // 0x7e |
|
400 bc_land = 127, // 0x7f |
|
401 bc_ior = 128, // 0x80 |
|
402 bc_lor = 129, // 0x81 |
|
403 bc_ixor = 130, // 0x82 |
|
404 bc_lxor = 131, // 0x83 |
|
405 bc_iinc = 132, // 0x84 |
|
406 bc_i2l = 133, // 0x85 |
|
407 bc_i2f = 134, // 0x86 |
|
408 bc_i2d = 135, // 0x87 |
|
409 bc_l2i = 136, // 0x88 |
|
410 bc_l2f = 137, // 0x89 |
|
411 bc_l2d = 138, // 0x8a |
|
412 bc_f2i = 139, // 0x8b |
|
413 bc_f2l = 140, // 0x8c |
|
414 bc_f2d = 141, // 0x8d |
|
415 bc_d2i = 142, // 0x8e |
|
416 bc_d2l = 143, // 0x8f |
|
417 bc_d2f = 144, // 0x90 |
|
418 bc_i2b = 145, // 0x91 |
|
419 bc_i2c = 146, // 0x92 |
|
420 bc_i2s = 147, // 0x93 |
|
421 bc_lcmp = 148, // 0x94 |
|
422 bc_fcmpl = 149, // 0x95 |
|
423 bc_fcmpg = 150, // 0x96 |
|
424 bc_dcmpl = 151, // 0x97 |
|
425 bc_dcmpg = 152, // 0x98 |
|
426 bc_ifeq = 153, // 0x99 |
|
427 bc_ifne = 154, // 0x9a |
|
428 bc_iflt = 155, // 0x9b |
|
429 bc_ifge = 156, // 0x9c |
|
430 bc_ifgt = 157, // 0x9d |
|
431 bc_ifle = 158, // 0x9e |
|
432 bc_if_icmpeq = 159, // 0x9f |
|
433 bc_if_icmpne = 160, // 0xa0 |
|
434 bc_if_icmplt = 161, // 0xa1 |
|
435 bc_if_icmpge = 162, // 0xa2 |
|
436 bc_if_icmpgt = 163, // 0xa3 |
|
437 bc_if_icmple = 164, // 0xa4 |
|
438 bc_if_acmpeq = 165, // 0xa5 |
|
439 bc_if_acmpne = 166, // 0xa6 |
|
440 bc_goto = 167, // 0xa7 |
|
441 bc_jsr = 168, // 0xa8 |
|
442 bc_ret = 169, // 0xa9 |
|
443 bc_tableswitch = 170, // 0xaa |
|
444 bc_lookupswitch = 171, // 0xab |
|
445 bc_ireturn = 172, // 0xac |
|
446 bc_lreturn = 173, // 0xad |
|
447 bc_freturn = 174, // 0xae |
|
448 bc_dreturn = 175, // 0xaf |
|
449 bc_areturn = 176, // 0xb0 |
|
450 bc_return = 177, // 0xb1 |
|
451 bc_getstatic = 178, // 0xb2 |
|
452 bc_putstatic = 179, // 0xb3 |
|
453 bc_getfield = 180, // 0xb4 |
|
454 bc_putfield = 181, // 0xb5 |
|
455 bc_invokevirtual = 182, // 0xb6 |
|
456 bc_invokespecial = 183, // 0xb7 |
|
457 bc_invokestatic = 184, // 0xb8 |
|
458 bc_invokeinterface = 185, // 0xb9 |
|
459 bc_invokedynamic = 186, // 0xba |
|
460 bc_new = 187, // 0xbb |
|
461 bc_newarray = 188, // 0xbc |
|
462 bc_anewarray = 189, // 0xbd |
|
463 bc_arraylength = 190, // 0xbe |
|
464 bc_athrow = 191, // 0xbf |
|
465 bc_checkcast = 192, // 0xc0 |
|
466 bc_instanceof = 193, // 0xc1 |
|
467 bc_monitorenter = 194, // 0xc2 |
|
468 bc_monitorexit = 195, // 0xc3 |
|
469 bc_wide = 196, // 0xc4 |
|
470 bc_multianewarray = 197, // 0xc5 |
|
471 bc_ifnull = 198, // 0xc6 |
|
472 bc_ifnonnull = 199, // 0xc7 |
|
473 bc_goto_w = 200, // 0xc8 |
|
474 bc_jsr_w = 201, // 0xc9 |
|
475 bc_bytecode_limit = 202 // 0xca |
|
476 }; |
|
477 |
|
478 enum { |
|
479 bc_end_marker = 255, |
|
480 bc_byte_escape = 254, |
|
481 bc_ref_escape = 253, |
|
482 |
|
483 _first_linker_op = bc_getstatic, |
|
484 _last_linker_op = bc_invokestatic, |
|
485 _num_linker_ops = (_last_linker_op - _first_linker_op) + 1, |
|
486 _self_linker_op = bc_bytecode_limit, |
|
487 _self_linker_aload_flag = 1*_num_linker_ops, |
|
488 _self_linker_super_flag = 2*_num_linker_ops, |
|
489 _self_linker_limit = _self_linker_op + 4*_num_linker_ops, |
|
490 |
|
491 _invokeinit_op = _self_linker_limit, |
|
492 _invokeinit_self_option = 0, |
|
493 _invokeinit_super_option = 1, |
|
494 _invokeinit_new_option = 2, |
|
495 _invokeinit_limit = _invokeinit_op+3, |
|
496 |
|
497 _xldc_op = _invokeinit_limit, |
|
498 bc_sldc = bc_ldc, // previously named bc_aldc |
|
499 bc_cldc = _xldc_op+0, |
|
500 bc_ildc = _xldc_op+1, |
|
501 bc_fldc = _xldc_op+2, |
|
502 bc_sldc_w = bc_ldc_w, // previously named bc_aldc_w |
|
503 bc_cldc_w = _xldc_op+3, |
|
504 bc_ildc_w = _xldc_op+4, |
|
505 bc_fldc_w = _xldc_op+5, |
|
506 bc_lldc2_w = bc_ldc2_w, |
|
507 bc_dldc2_w = _xldc_op+6, |
|
508 // anything other primitive, string, or class must be handled with qldc: |
|
509 bc_qldc = _xldc_op+7, |
|
510 bc_qldc_w = _xldc_op+8, |
|
511 _xldc_limit = _xldc_op+9, |
|
512 _invoke_int_op = _xldc_limit, |
|
513 _invokespecial_int = _invoke_int_op+0, |
|
514 _invokestatic_int = _invoke_int_op+1, |
|
515 _invoke_int_limit = _invoke_int_op+2, |
|
516 _xxx_3_end |
|
517 }; |
|