author | ksrini |
Tue, 14 Dec 2010 07:42:11 -0800 | |
changeset 7795 | 98021fc612af |
parent 7192 | 445c518364c4 |
child 10115 | eb08d08c7ef7 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
5811
f4d1f45c0058
6712743: pack200: should default to 150.7 pack format for classfiles without any classes.
ksrini
parents:
5506
diff
changeset
|
2 |
* Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 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 |
* |
|
5506 | 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. |
|
2 | 24 |
*/ |
25 |
||
26 |
package com.sun.java.util.jar.pack; |
|
27 |
||
7192
445c518364c4
7003227: (pack200) intermittent failures compiling pack200
ksrini
parents:
5811
diff
changeset
|
28 |
import java.util.Arrays; |
445c518364c4
7003227: (pack200) intermittent failures compiling pack200
ksrini
parents:
5811
diff
changeset
|
29 |
import java.util.List; |
2 | 30 |
|
31 |
/** |
|
32 |
* Shared constants |
|
33 |
* @author John Rose |
|
34 |
*/ |
|
7795
98021fc612af
6990106: FindBugs scan - Malicious code vulnerability Warnings in com.sun.java.util.jar.pack.*
ksrini
parents:
7192
diff
changeset
|
35 |
class Constants { |
98021fc612af
6990106: FindBugs scan - Malicious code vulnerability Warnings in com.sun.java.util.jar.pack.*
ksrini
parents:
7192
diff
changeset
|
36 |
|
98021fc612af
6990106: FindBugs scan - Malicious code vulnerability Warnings in com.sun.java.util.jar.pack.*
ksrini
parents:
7192
diff
changeset
|
37 |
private Constants(){} |
98021fc612af
6990106: FindBugs scan - Malicious code vulnerability Warnings in com.sun.java.util.jar.pack.*
ksrini
parents:
7192
diff
changeset
|
38 |
|
2 | 39 |
public final static int JAVA_MAGIC = 0xCAFEBABE; |
40 |
||
41 |
/* |
|
42 |
Java Class Version numbers history |
|
43 |
1.0 to 1.3.X 45,3 |
|
44 |
1.4 to 1.4.X 46,0 |
|
45 |
1.5 to 1.5.X 49,0 |
|
46 |
1.6 to 1.5.x 50,0 NOTE Assumed for now |
|
47 |
*/ |
|
48 |
||
49 |
public final static short JAVA_MIN_CLASS_MAJOR_VERSION = 45; |
|
50 |
public final static short JAVA_MIN_CLASS_MINOR_VERSION = 03; |
|
51 |
||
52 |
public final static short JAVA5_MAX_CLASS_MAJOR_VERSION = 49; |
|
53 |
public final static short JAVA5_MAX_CLASS_MINOR_VERSION = 0; |
|
5811
f4d1f45c0058
6712743: pack200: should default to 150.7 pack format for classfiles without any classes.
ksrini
parents:
5506
diff
changeset
|
54 |
|
2 | 55 |
public final static short JAVA6_MAX_CLASS_MAJOR_VERSION = 50; |
56 |
public final static short JAVA6_MAX_CLASS_MINOR_VERSION = 0; |
|
57 |
||
5811
f4d1f45c0058
6712743: pack200: should default to 150.7 pack format for classfiles without any classes.
ksrini
parents:
5506
diff
changeset
|
58 |
public final static short JAVA7_MAX_CLASS_MAJOR_VERSION = 51; |
f4d1f45c0058
6712743: pack200: should default to 150.7 pack format for classfiles without any classes.
ksrini
parents:
5506
diff
changeset
|
59 |
public final static short JAVA7_MAX_CLASS_MINOR_VERSION = 0; |
f4d1f45c0058
6712743: pack200: should default to 150.7 pack format for classfiles without any classes.
ksrini
parents:
5506
diff
changeset
|
60 |
|
2 | 61 |
public final static int JAVA_PACKAGE_MAGIC = 0xCAFED00D; |
62 |
public final static int JAVA5_PACKAGE_MAJOR_VERSION = 150; |
|
63 |
public final static int JAVA5_PACKAGE_MINOR_VERSION = 7; |
|
64 |
||
65 |
public final static int JAVA6_PACKAGE_MAJOR_VERSION = 160; |
|
66 |
public final static int JAVA6_PACKAGE_MINOR_VERSION = 1; |
|
67 |
||
68 |
public final static int CONSTANT_POOL_INDEX_LIMIT = 0x10000; |
|
69 |
public final static int CONSTANT_POOL_NARROW_LIMIT = 0x00100; |
|
70 |
||
71 |
public final static String JAVA_SIGNATURE_CHARS = "BSCIJFDZLV(["; |
|
72 |
||
73 |
public final static byte CONSTANT_Utf8 = 1; |
|
74 |
public final static byte CONSTANT_unused2 = 2; // unused, was Unicode |
|
75 |
public final static byte CONSTANT_Integer = 3; |
|
76 |
public final static byte CONSTANT_Float = 4; |
|
77 |
public final static byte CONSTANT_Long = 5; |
|
78 |
public final static byte CONSTANT_Double = 6; |
|
79 |
public final static byte CONSTANT_Class = 7; |
|
80 |
public final static byte CONSTANT_String = 8; |
|
81 |
public final static byte CONSTANT_Fieldref = 9; |
|
82 |
public final static byte CONSTANT_Methodref = 10; |
|
83 |
public final static byte CONSTANT_InterfaceMethodref = 11; |
|
84 |
public final static byte CONSTANT_NameandType = 12; |
|
85 |
||
86 |
// pseudo-constants: |
|
87 |
public final static byte CONSTANT_None = 0; |
|
88 |
public final static byte CONSTANT_Signature = 13; |
|
89 |
public final static byte CONSTANT_Limit = 14; |
|
90 |
||
91 |
public final static byte CONSTANT_All = 19; // combined global map |
|
92 |
public final static byte CONSTANT_Literal = 20; // used only for ldc fields |
|
93 |
||
94 |
// pseudo-access bits |
|
95 |
public final static int ACC_IC_LONG_FORM = (1<<16); //for ic_flags |
|
96 |
||
97 |
// attribute "context types" |
|
98 |
public static final int ATTR_CONTEXT_CLASS = 0; |
|
99 |
public static final int ATTR_CONTEXT_FIELD = 1; |
|
100 |
public static final int ATTR_CONTEXT_METHOD = 2; |
|
101 |
public static final int ATTR_CONTEXT_CODE = 3; |
|
102 |
public static final int ATTR_CONTEXT_LIMIT = 4; |
|
103 |
public static final String[] ATTR_CONTEXT_NAME |
|
104 |
= { "class", "field", "method", "code" }; |
|
105 |
||
106 |
// predefined attr bits |
|
107 |
public static final int |
|
108 |
X_ATTR_OVERFLOW = 16, |
|
109 |
CLASS_ATTR_SourceFile = 17, |
|
110 |
METHOD_ATTR_Code = 17, |
|
111 |
FIELD_ATTR_ConstantValue = 17, |
|
112 |
CLASS_ATTR_EnclosingMethod = 18, |
|
113 |
METHOD_ATTR_Exceptions = 18, |
|
114 |
X_ATTR_Signature = 19, |
|
115 |
X_ATTR_Deprecated = 20, |
|
116 |
X_ATTR_RuntimeVisibleAnnotations = 21, |
|
117 |
X_ATTR_RuntimeInvisibleAnnotations = 22, |
|
118 |
METHOD_ATTR_RuntimeVisibleParameterAnnotations = 23, |
|
119 |
CLASS_ATTR_InnerClasses = 23, |
|
120 |
METHOD_ATTR_RuntimeInvisibleParameterAnnotations = 24, |
|
121 |
CLASS_ATTR_ClassFile_version = 24, |
|
122 |
METHOD_ATTR_AnnotationDefault = 25, |
|
123 |
CODE_ATTR_StackMapTable = 0, // new in Java 6 |
|
124 |
CODE_ATTR_LineNumberTable = 1, |
|
125 |
CODE_ATTR_LocalVariableTable = 2, |
|
126 |
CODE_ATTR_LocalVariableTypeTable = 3; |
|
127 |
||
128 |
// File option bits, from LSB in ascending bit position. |
|
129 |
public static final int FO_DEFLATE_HINT = 1<<0; |
|
130 |
public static final int FO_IS_CLASS_STUB = 1<<1; |
|
131 |
||
132 |
// Archive option bits, from LSB in ascending bit position: |
|
133 |
public static final int AO_HAVE_SPECIAL_FORMATS = 1<<0; |
|
134 |
public static final int AO_HAVE_CP_NUMBERS = 1<<1; |
|
135 |
public static final int AO_HAVE_ALL_CODE_FLAGS = 1<<2; |
|
136 |
public static final int AO_3_UNUSED_MBZ = 1<<3; |
|
137 |
public static final int AO_HAVE_FILE_HEADERS = 1<<4; |
|
138 |
public static final int AO_DEFLATE_HINT = 1<<5; |
|
139 |
public static final int AO_HAVE_FILE_MODTIME = 1<<6; |
|
140 |
public static final int AO_HAVE_FILE_OPTIONS = 1<<7; |
|
141 |
public static final int AO_HAVE_FILE_SIZE_HI = 1<<8; |
|
142 |
public static final int AO_HAVE_CLASS_FLAGS_HI = 1<<9; |
|
143 |
public static final int AO_HAVE_FIELD_FLAGS_HI = 1<<10; |
|
144 |
public static final int AO_HAVE_METHOD_FLAGS_HI = 1<<11; |
|
145 |
public static final int AO_HAVE_CODE_FLAGS_HI = 1<<12; |
|
146 |
||
147 |
public static final int LG_AO_HAVE_XXX_FLAGS_HI = 9; |
|
148 |
||
149 |
// visitRefs modes: |
|
150 |
static final int VRM_CLASSIC = 0; |
|
151 |
static final int VRM_PACKAGE = 1; |
|
152 |
||
153 |
public static final int NO_MODTIME = 0; // null modtime value |
|
154 |
||
155 |
// some comstantly empty containers |
|
156 |
public final static int[] noInts = {}; |
|
157 |
public final static byte[] noBytes = {}; |
|
158 |
public final static Object[] noValues = {}; |
|
159 |
public final static String[] noStrings = {}; |
|
160 |
public final static List emptyList = Arrays.asList(noValues); |
|
161 |
||
162 |
// meta-coding |
|
163 |
public final static int |
|
164 |
_meta_default = 0, |
|
165 |
_meta_canon_min = 1, |
|
166 |
_meta_canon_max = 115, |
|
167 |
_meta_arb = 116, |
|
168 |
_meta_run = 117, |
|
169 |
_meta_pop = 141, |
|
170 |
_meta_limit = 189; |
|
171 |
||
172 |
// bytecodes |
|
173 |
public final static int |
|
174 |
_nop = 0, // 0x00 |
|
175 |
_aconst_null = 1, // 0x01 |
|
176 |
_iconst_m1 = 2, // 0x02 |
|
177 |
_iconst_0 = 3, // 0x03 |
|
178 |
_iconst_1 = 4, // 0x04 |
|
179 |
_iconst_2 = 5, // 0x05 |
|
180 |
_iconst_3 = 6, // 0x06 |
|
181 |
_iconst_4 = 7, // 0x07 |
|
182 |
_iconst_5 = 8, // 0x08 |
|
183 |
_lconst_0 = 9, // 0x09 |
|
184 |
_lconst_1 = 10, // 0x0a |
|
185 |
_fconst_0 = 11, // 0x0b |
|
186 |
_fconst_1 = 12, // 0x0c |
|
187 |
_fconst_2 = 13, // 0x0d |
|
188 |
_dconst_0 = 14, // 0x0e |
|
189 |
_dconst_1 = 15, // 0x0f |
|
190 |
_bipush = 16, // 0x10 |
|
191 |
_sipush = 17, // 0x11 |
|
192 |
_ldc = 18, // 0x12 |
|
193 |
_ldc_w = 19, // 0x13 |
|
194 |
_ldc2_w = 20, // 0x14 |
|
195 |
_iload = 21, // 0x15 |
|
196 |
_lload = 22, // 0x16 |
|
197 |
_fload = 23, // 0x17 |
|
198 |
_dload = 24, // 0x18 |
|
199 |
_aload = 25, // 0x19 |
|
200 |
_iload_0 = 26, // 0x1a |
|
201 |
_iload_1 = 27, // 0x1b |
|
202 |
_iload_2 = 28, // 0x1c |
|
203 |
_iload_3 = 29, // 0x1d |
|
204 |
_lload_0 = 30, // 0x1e |
|
205 |
_lload_1 = 31, // 0x1f |
|
206 |
_lload_2 = 32, // 0x20 |
|
207 |
_lload_3 = 33, // 0x21 |
|
208 |
_fload_0 = 34, // 0x22 |
|
209 |
_fload_1 = 35, // 0x23 |
|
210 |
_fload_2 = 36, // 0x24 |
|
211 |
_fload_3 = 37, // 0x25 |
|
212 |
_dload_0 = 38, // 0x26 |
|
213 |
_dload_1 = 39, // 0x27 |
|
214 |
_dload_2 = 40, // 0x28 |
|
215 |
_dload_3 = 41, // 0x29 |
|
216 |
_aload_0 = 42, // 0x2a |
|
217 |
_aload_1 = 43, // 0x2b |
|
218 |
_aload_2 = 44, // 0x2c |
|
219 |
_aload_3 = 45, // 0x2d |
|
220 |
_iaload = 46, // 0x2e |
|
221 |
_laload = 47, // 0x2f |
|
222 |
_faload = 48, // 0x30 |
|
223 |
_daload = 49, // 0x31 |
|
224 |
_aaload = 50, // 0x32 |
|
225 |
_baload = 51, // 0x33 |
|
226 |
_caload = 52, // 0x34 |
|
227 |
_saload = 53, // 0x35 |
|
228 |
_istore = 54, // 0x36 |
|
229 |
_lstore = 55, // 0x37 |
|
230 |
_fstore = 56, // 0x38 |
|
231 |
_dstore = 57, // 0x39 |
|
232 |
_astore = 58, // 0x3a |
|
233 |
_istore_0 = 59, // 0x3b |
|
234 |
_istore_1 = 60, // 0x3c |
|
235 |
_istore_2 = 61, // 0x3d |
|
236 |
_istore_3 = 62, // 0x3e |
|
237 |
_lstore_0 = 63, // 0x3f |
|
238 |
_lstore_1 = 64, // 0x40 |
|
239 |
_lstore_2 = 65, // 0x41 |
|
240 |
_lstore_3 = 66, // 0x42 |
|
241 |
_fstore_0 = 67, // 0x43 |
|
242 |
_fstore_1 = 68, // 0x44 |
|
243 |
_fstore_2 = 69, // 0x45 |
|
244 |
_fstore_3 = 70, // 0x46 |
|
245 |
_dstore_0 = 71, // 0x47 |
|
246 |
_dstore_1 = 72, // 0x48 |
|
247 |
_dstore_2 = 73, // 0x49 |
|
248 |
_dstore_3 = 74, // 0x4a |
|
249 |
_astore_0 = 75, // 0x4b |
|
250 |
_astore_1 = 76, // 0x4c |
|
251 |
_astore_2 = 77, // 0x4d |
|
252 |
_astore_3 = 78, // 0x4e |
|
253 |
_iastore = 79, // 0x4f |
|
254 |
_lastore = 80, // 0x50 |
|
255 |
_fastore = 81, // 0x51 |
|
256 |
_dastore = 82, // 0x52 |
|
257 |
_aastore = 83, // 0x53 |
|
258 |
_bastore = 84, // 0x54 |
|
259 |
_castore = 85, // 0x55 |
|
260 |
_sastore = 86, // 0x56 |
|
261 |
_pop = 87, // 0x57 |
|
262 |
_pop2 = 88, // 0x58 |
|
263 |
_dup = 89, // 0x59 |
|
264 |
_dup_x1 = 90, // 0x5a |
|
265 |
_dup_x2 = 91, // 0x5b |
|
266 |
_dup2 = 92, // 0x5c |
|
267 |
_dup2_x1 = 93, // 0x5d |
|
268 |
_dup2_x2 = 94, // 0x5e |
|
269 |
_swap = 95, // 0x5f |
|
270 |
_iadd = 96, // 0x60 |
|
271 |
_ladd = 97, // 0x61 |
|
272 |
_fadd = 98, // 0x62 |
|
273 |
_dadd = 99, // 0x63 |
|
274 |
_isub = 100, // 0x64 |
|
275 |
_lsub = 101, // 0x65 |
|
276 |
_fsub = 102, // 0x66 |
|
277 |
_dsub = 103, // 0x67 |
|
278 |
_imul = 104, // 0x68 |
|
279 |
_lmul = 105, // 0x69 |
|
280 |
_fmul = 106, // 0x6a |
|
281 |
_dmul = 107, // 0x6b |
|
282 |
_idiv = 108, // 0x6c |
|
283 |
_ldiv = 109, // 0x6d |
|
284 |
_fdiv = 110, // 0x6e |
|
285 |
_ddiv = 111, // 0x6f |
|
286 |
_irem = 112, // 0x70 |
|
287 |
_lrem = 113, // 0x71 |
|
288 |
_frem = 114, // 0x72 |
|
289 |
_drem = 115, // 0x73 |
|
290 |
_ineg = 116, // 0x74 |
|
291 |
_lneg = 117, // 0x75 |
|
292 |
_fneg = 118, // 0x76 |
|
293 |
_dneg = 119, // 0x77 |
|
294 |
_ishl = 120, // 0x78 |
|
295 |
_lshl = 121, // 0x79 |
|
296 |
_ishr = 122, // 0x7a |
|
297 |
_lshr = 123, // 0x7b |
|
298 |
_iushr = 124, // 0x7c |
|
299 |
_lushr = 125, // 0x7d |
|
300 |
_iand = 126, // 0x7e |
|
301 |
_land = 127, // 0x7f |
|
302 |
_ior = 128, // 0x80 |
|
303 |
_lor = 129, // 0x81 |
|
304 |
_ixor = 130, // 0x82 |
|
305 |
_lxor = 131, // 0x83 |
|
306 |
_iinc = 132, // 0x84 |
|
307 |
_i2l = 133, // 0x85 |
|
308 |
_i2f = 134, // 0x86 |
|
309 |
_i2d = 135, // 0x87 |
|
310 |
_l2i = 136, // 0x88 |
|
311 |
_l2f = 137, // 0x89 |
|
312 |
_l2d = 138, // 0x8a |
|
313 |
_f2i = 139, // 0x8b |
|
314 |
_f2l = 140, // 0x8c |
|
315 |
_f2d = 141, // 0x8d |
|
316 |
_d2i = 142, // 0x8e |
|
317 |
_d2l = 143, // 0x8f |
|
318 |
_d2f = 144, // 0x90 |
|
319 |
_i2b = 145, // 0x91 |
|
320 |
_i2c = 146, // 0x92 |
|
321 |
_i2s = 147, // 0x93 |
|
322 |
_lcmp = 148, // 0x94 |
|
323 |
_fcmpl = 149, // 0x95 |
|
324 |
_fcmpg = 150, // 0x96 |
|
325 |
_dcmpl = 151, // 0x97 |
|
326 |
_dcmpg = 152, // 0x98 |
|
327 |
_ifeq = 153, // 0x99 |
|
328 |
_ifne = 154, // 0x9a |
|
329 |
_iflt = 155, // 0x9b |
|
330 |
_ifge = 156, // 0x9c |
|
331 |
_ifgt = 157, // 0x9d |
|
332 |
_ifle = 158, // 0x9e |
|
333 |
_if_icmpeq = 159, // 0x9f |
|
334 |
_if_icmpne = 160, // 0xa0 |
|
335 |
_if_icmplt = 161, // 0xa1 |
|
336 |
_if_icmpge = 162, // 0xa2 |
|
337 |
_if_icmpgt = 163, // 0xa3 |
|
338 |
_if_icmple = 164, // 0xa4 |
|
339 |
_if_acmpeq = 165, // 0xa5 |
|
340 |
_if_acmpne = 166, // 0xa6 |
|
341 |
_goto = 167, // 0xa7 |
|
342 |
_jsr = 168, // 0xa8 |
|
343 |
_ret = 169, // 0xa9 |
|
344 |
_tableswitch = 170, // 0xaa |
|
345 |
_lookupswitch = 171, // 0xab |
|
346 |
_ireturn = 172, // 0xac |
|
347 |
_lreturn = 173, // 0xad |
|
348 |
_freturn = 174, // 0xae |
|
349 |
_dreturn = 175, // 0xaf |
|
350 |
_areturn = 176, // 0xb0 |
|
351 |
_return = 177, // 0xb1 |
|
352 |
_getstatic = 178, // 0xb2 |
|
353 |
_putstatic = 179, // 0xb3 |
|
354 |
_getfield = 180, // 0xb4 |
|
355 |
_putfield = 181, // 0xb5 |
|
356 |
_invokevirtual = 182, // 0xb6 |
|
357 |
_invokespecial = 183, // 0xb7 |
|
358 |
_invokestatic = 184, // 0xb8 |
|
359 |
_invokeinterface = 185, // 0xb9 |
|
360 |
_xxxunusedxxx = 186, // 0xba |
|
361 |
_new = 187, // 0xbb |
|
362 |
_newarray = 188, // 0xbc |
|
363 |
_anewarray = 189, // 0xbd |
|
364 |
_arraylength = 190, // 0xbe |
|
365 |
_athrow = 191, // 0xbf |
|
366 |
_checkcast = 192, // 0xc0 |
|
367 |
_instanceof = 193, // 0xc1 |
|
368 |
_monitorenter = 194, // 0xc2 |
|
369 |
_monitorexit = 195, // 0xc3 |
|
370 |
_wide = 196, // 0xc4 |
|
371 |
_multianewarray = 197, // 0xc5 |
|
372 |
_ifnull = 198, // 0xc6 |
|
373 |
_ifnonnull = 199, // 0xc7 |
|
374 |
_goto_w = 200, // 0xc8 |
|
375 |
_jsr_w = 201, // 0xc9 |
|
376 |
_bytecode_limit = 202; // 0xca |
|
377 |
||
378 |
// End marker, used to terminate bytecode sequences: |
|
379 |
public final static int _end_marker = 255; |
|
380 |
// Escapes: |
|
381 |
public final static int _byte_escape = 254; |
|
382 |
public final static int _ref_escape = 253; |
|
383 |
||
384 |
// Self-relative pseudo-opcodes for better compression. |
|
385 |
// A "linker op" is a bytecode which links to a class member. |
|
386 |
// (But in what follows, "invokeinterface" ops are excluded.) |
|
387 |
// |
|
388 |
// A "self linker op" is a variant bytecode which works only |
|
389 |
// with the current class or its super. Because the number of |
|
390 |
// possible targets is small, it admits a more compact encoding. |
|
391 |
// Self linker ops are allowed to absorb a previous "aload_0" op. |
|
392 |
// There are (7 * 4) self linker ops (super or not, aload_0 or not). |
|
393 |
// |
|
394 |
// For simplicity, we define the full symmetric set of variants. |
|
395 |
// However, some of them are relatively useless. |
|
396 |
// Self linker ops are enabled by Pack.selfCallVariants (true). |
|
397 |
public final static int _first_linker_op = _getstatic; |
|
398 |
public final static int _last_linker_op = _invokestatic; |
|
399 |
public final static int _num_linker_ops = (_last_linker_op - _first_linker_op) + 1; |
|
400 |
public final static int _self_linker_op = _bytecode_limit; |
|
401 |
public final static int _self_linker_aload_flag = 1*_num_linker_ops; |
|
402 |
public final static int _self_linker_super_flag = 2*_num_linker_ops; |
|
403 |
public final static int _self_linker_limit = _self_linker_op + 4*_num_linker_ops; |
|
404 |
// An "invoke init" op is a variant of invokespecial which works |
|
405 |
// only with the method name "<init>". There are variants which |
|
406 |
// link to the current class, the super class, or the class of the |
|
407 |
// immediately previous "newinstance" op. There are 3 of these ops. |
|
408 |
// They all take method signature references as operands. |
|
409 |
// Invoke init ops are enabled by Pack.initCallVariants (true). |
|
410 |
public final static int _invokeinit_op = _self_linker_limit; |
|
411 |
public final static int _invokeinit_self_option = 0; |
|
412 |
public final static int _invokeinit_super_option = 1; |
|
413 |
public final static int _invokeinit_new_option = 2; |
|
414 |
public final static int _invokeinit_limit = _invokeinit_op+3; |
|
415 |
||
416 |
public final static int _pseudo_instruction_limit = _invokeinit_limit; |
|
417 |
// linker variant limit == 202+(7*4)+3 == 233 |
|
418 |
||
419 |
// Ldc variants support strongly typed references to constants. |
|
420 |
// This lets us index constant pool entries completely according to tag, |
|
421 |
// which is a great simplification. |
|
422 |
// Ldc variants gain us only 0.007% improvement in compression ratio, |
|
423 |
// but they simplify the file format greatly. |
|
424 |
public final static int _xldc_op = _invokeinit_limit; |
|
425 |
public final static int _aldc = _ldc; |
|
426 |
public final static int _cldc = _xldc_op+0; |
|
427 |
public final static int _ildc = _xldc_op+1; |
|
428 |
public final static int _fldc = _xldc_op+2; |
|
429 |
public final static int _aldc_w = _ldc_w; |
|
430 |
public final static int _cldc_w = _xldc_op+3; |
|
431 |
public final static int _ildc_w = _xldc_op+4; |
|
432 |
public final static int _fldc_w = _xldc_op+5; |
|
433 |
public final static int _lldc2_w = _ldc2_w; |
|
434 |
public final static int _dldc2_w = _xldc_op+6; |
|
435 |
public final static int _xldc_limit = _xldc_op+7; |
|
436 |
} |