comparison CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/classfile_constants.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
comparison
equal deleted inserted replaced
67:0e9998148a16 69:33d812a61356
1 /*
2 * Copyright (c) 2004, 2017, 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 #ifndef CLASSFILE_CONSTANTS_H
27 #define CLASSFILE_CONSTANTS_H
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /* Classfile version number for this information */
34 #define JVM_CLASSFILE_MAJOR_VERSION 55
35 #define JVM_CLASSFILE_MINOR_VERSION 0
36
37 /* Flags */
38
39 enum {
40 JVM_ACC_PUBLIC = 0x0001,
41 JVM_ACC_PRIVATE = 0x0002,
42 JVM_ACC_PROTECTED = 0x0004,
43 JVM_ACC_STATIC = 0x0008,
44 JVM_ACC_FINAL = 0x0010,
45 JVM_ACC_SYNCHRONIZED = 0x0020,
46 JVM_ACC_SUPER = 0x0020,
47 JVM_ACC_VOLATILE = 0x0040,
48 JVM_ACC_BRIDGE = 0x0040,
49 JVM_ACC_TRANSIENT = 0x0080,
50 JVM_ACC_VARARGS = 0x0080,
51 JVM_ACC_NATIVE = 0x0100,
52 JVM_ACC_INTERFACE = 0x0200,
53 JVM_ACC_ABSTRACT = 0x0400,
54 JVM_ACC_STRICT = 0x0800,
55 JVM_ACC_SYNTHETIC = 0x1000,
56 JVM_ACC_ANNOTATION = 0x2000,
57 JVM_ACC_ENUM = 0x4000,
58 JVM_ACC_MODULE = 0x8000
59 };
60
61 #define JVM_ACC_PUBLIC_BIT 0
62 #define JVM_ACC_PRIVATE_BIT 1
63 #define JVM_ACC_PROTECTED_BIT 2
64 #define JVM_ACC_STATIC_BIT 3
65 #define JVM_ACC_FINAL_BIT 4
66 #define JVM_ACC_SYNCHRONIZED_BIT 5
67 #define JVM_ACC_SUPER_BIT 5
68 #define JVM_ACC_VOLATILE_BIT 6
69 #define JVM_ACC_BRIDGE_BIT 6
70 #define JVM_ACC_TRANSIENT_BIT 7
71 #define JVM_ACC_VARARGS_BIT 7
72 #define JVM_ACC_NATIVE_BIT 8
73 #define JVM_ACC_INTERFACE_BIT 9
74 #define JVM_ACC_ABSTRACT_BIT 10
75 #define JVM_ACC_STRICT_BIT 11
76 #define JVM_ACC_SYNTHETIC_BIT 12
77 #define JVM_ACC_ANNOTATION_BIT 13
78 #define JVM_ACC_ENUM_BIT 14
79
80 /* Used in newarray instruction. */
81
82 enum {
83 JVM_T_BOOLEAN = 4,
84 JVM_T_CHAR = 5,
85 JVM_T_FLOAT = 6,
86 JVM_T_DOUBLE = 7,
87 JVM_T_BYTE = 8,
88 JVM_T_SHORT = 9,
89 JVM_T_INT = 10,
90 JVM_T_LONG = 11
91 };
92
93 /* Constant Pool Entries */
94
95 enum {
96 JVM_CONSTANT_Utf8 = 1,
97 JVM_CONSTANT_Unicode = 2, /* unused */
98 JVM_CONSTANT_Integer = 3,
99 JVM_CONSTANT_Float = 4,
100 JVM_CONSTANT_Long = 5,
101 JVM_CONSTANT_Double = 6,
102 JVM_CONSTANT_Class = 7,
103 JVM_CONSTANT_String = 8,
104 JVM_CONSTANT_Fieldref = 9,
105 JVM_CONSTANT_Methodref = 10,
106 JVM_CONSTANT_InterfaceMethodref = 11,
107 JVM_CONSTANT_NameAndType = 12,
108 JVM_CONSTANT_MethodHandle = 15, // JSR 292
109 JVM_CONSTANT_MethodType = 16, // JSR 292
110 JVM_CONSTANT_Dynamic = 17,
111 JVM_CONSTANT_InvokeDynamic = 18,
112 JVM_CONSTANT_ExternalMax = 18
113 };
114
115 /* JVM_CONSTANT_MethodHandle subtypes */
116 enum {
117 JVM_REF_getField = 1,
118 JVM_REF_getStatic = 2,
119 JVM_REF_putField = 3,
120 JVM_REF_putStatic = 4,
121 JVM_REF_invokeVirtual = 5,
122 JVM_REF_invokeStatic = 6,
123 JVM_REF_invokeSpecial = 7,
124 JVM_REF_newInvokeSpecial = 8,
125 JVM_REF_invokeInterface = 9
126 };
127
128 /* StackMapTable type item numbers */
129
130 enum {
131 JVM_ITEM_Top = 0,
132 JVM_ITEM_Integer = 1,
133 JVM_ITEM_Float = 2,
134 JVM_ITEM_Double = 3,
135 JVM_ITEM_Long = 4,
136 JVM_ITEM_Null = 5,
137 JVM_ITEM_UninitializedThis = 6,
138 JVM_ITEM_Object = 7,
139 JVM_ITEM_Uninitialized = 8
140 };
141
142 /* Type signatures */
143
144 enum {
145 JVM_SIGNATURE_ARRAY = '[',
146 JVM_SIGNATURE_BYTE = 'B',
147 JVM_SIGNATURE_CHAR = 'C',
148 JVM_SIGNATURE_CLASS = 'L',
149 JVM_SIGNATURE_ENDCLASS = ';',
150 JVM_SIGNATURE_ENUM = 'E',
151 JVM_SIGNATURE_FLOAT = 'F',
152 JVM_SIGNATURE_DOUBLE = 'D',
153 JVM_SIGNATURE_FUNC = '(',
154 JVM_SIGNATURE_ENDFUNC = ')',
155 JVM_SIGNATURE_INT = 'I',
156 JVM_SIGNATURE_LONG = 'J',
157 JVM_SIGNATURE_SHORT = 'S',
158 JVM_SIGNATURE_VOID = 'V',
159 JVM_SIGNATURE_BOOLEAN = 'Z'
160 };
161
162 /* Opcodes */
163
164 enum {
165 JVM_OPC_nop = 0,
166 JVM_OPC_aconst_null = 1,
167 JVM_OPC_iconst_m1 = 2,
168 JVM_OPC_iconst_0 = 3,
169 JVM_OPC_iconst_1 = 4,
170 JVM_OPC_iconst_2 = 5,
171 JVM_OPC_iconst_3 = 6,
172 JVM_OPC_iconst_4 = 7,
173 JVM_OPC_iconst_5 = 8,
174 JVM_OPC_lconst_0 = 9,
175 JVM_OPC_lconst_1 = 10,
176 JVM_OPC_fconst_0 = 11,
177 JVM_OPC_fconst_1 = 12,
178 JVM_OPC_fconst_2 = 13,
179 JVM_OPC_dconst_0 = 14,
180 JVM_OPC_dconst_1 = 15,
181 JVM_OPC_bipush = 16,
182 JVM_OPC_sipush = 17,
183 JVM_OPC_ldc = 18,
184 JVM_OPC_ldc_w = 19,
185 JVM_OPC_ldc2_w = 20,
186 JVM_OPC_iload = 21,
187 JVM_OPC_lload = 22,
188 JVM_OPC_fload = 23,
189 JVM_OPC_dload = 24,
190 JVM_OPC_aload = 25,
191 JVM_OPC_iload_0 = 26,
192 JVM_OPC_iload_1 = 27,
193 JVM_OPC_iload_2 = 28,
194 JVM_OPC_iload_3 = 29,
195 JVM_OPC_lload_0 = 30,
196 JVM_OPC_lload_1 = 31,
197 JVM_OPC_lload_2 = 32,
198 JVM_OPC_lload_3 = 33,
199 JVM_OPC_fload_0 = 34,
200 JVM_OPC_fload_1 = 35,
201 JVM_OPC_fload_2 = 36,
202 JVM_OPC_fload_3 = 37,
203 JVM_OPC_dload_0 = 38,
204 JVM_OPC_dload_1 = 39,
205 JVM_OPC_dload_2 = 40,
206 JVM_OPC_dload_3 = 41,
207 JVM_OPC_aload_0 = 42,
208 JVM_OPC_aload_1 = 43,
209 JVM_OPC_aload_2 = 44,
210 JVM_OPC_aload_3 = 45,
211 JVM_OPC_iaload = 46,
212 JVM_OPC_laload = 47,
213 JVM_OPC_faload = 48,
214 JVM_OPC_daload = 49,
215 JVM_OPC_aaload = 50,
216 JVM_OPC_baload = 51,
217 JVM_OPC_caload = 52,
218 JVM_OPC_saload = 53,
219 JVM_OPC_istore = 54,
220 JVM_OPC_lstore = 55,
221 JVM_OPC_fstore = 56,
222 JVM_OPC_dstore = 57,
223 JVM_OPC_astore = 58,
224 JVM_OPC_istore_0 = 59,
225 JVM_OPC_istore_1 = 60,
226 JVM_OPC_istore_2 = 61,
227 JVM_OPC_istore_3 = 62,
228 JVM_OPC_lstore_0 = 63,
229 JVM_OPC_lstore_1 = 64,
230 JVM_OPC_lstore_2 = 65,
231 JVM_OPC_lstore_3 = 66,
232 JVM_OPC_fstore_0 = 67,
233 JVM_OPC_fstore_1 = 68,
234 JVM_OPC_fstore_2 = 69,
235 JVM_OPC_fstore_3 = 70,
236 JVM_OPC_dstore_0 = 71,
237 JVM_OPC_dstore_1 = 72,
238 JVM_OPC_dstore_2 = 73,
239 JVM_OPC_dstore_3 = 74,
240 JVM_OPC_astore_0 = 75,
241 JVM_OPC_astore_1 = 76,
242 JVM_OPC_astore_2 = 77,
243 JVM_OPC_astore_3 = 78,
244 JVM_OPC_iastore = 79,
245 JVM_OPC_lastore = 80,
246 JVM_OPC_fastore = 81,
247 JVM_OPC_dastore = 82,
248 JVM_OPC_aastore = 83,
249 JVM_OPC_bastore = 84,
250 JVM_OPC_castore = 85,
251 JVM_OPC_sastore = 86,
252 JVM_OPC_pop = 87,
253 JVM_OPC_pop2 = 88,
254 JVM_OPC_dup = 89,
255 JVM_OPC_dup_x1 = 90,
256 JVM_OPC_dup_x2 = 91,
257 JVM_OPC_dup2 = 92,
258 JVM_OPC_dup2_x1 = 93,
259 JVM_OPC_dup2_x2 = 94,
260 JVM_OPC_swap = 95,
261 JVM_OPC_iadd = 96,
262 JVM_OPC_ladd = 97,
263 JVM_OPC_fadd = 98,
264 JVM_OPC_dadd = 99,
265 JVM_OPC_isub = 100,
266 JVM_OPC_lsub = 101,
267 JVM_OPC_fsub = 102,
268 JVM_OPC_dsub = 103,
269 JVM_OPC_imul = 104,
270 JVM_OPC_lmul = 105,
271 JVM_OPC_fmul = 106,
272 JVM_OPC_dmul = 107,
273 JVM_OPC_idiv = 108,
274 JVM_OPC_ldiv = 109,
275 JVM_OPC_fdiv = 110,
276 JVM_OPC_ddiv = 111,
277 JVM_OPC_irem = 112,
278 JVM_OPC_lrem = 113,
279 JVM_OPC_frem = 114,
280 JVM_OPC_drem = 115,
281 JVM_OPC_ineg = 116,
282 JVM_OPC_lneg = 117,
283 JVM_OPC_fneg = 118,
284 JVM_OPC_dneg = 119,
285 JVM_OPC_ishl = 120,
286 JVM_OPC_lshl = 121,
287 JVM_OPC_ishr = 122,
288 JVM_OPC_lshr = 123,
289 JVM_OPC_iushr = 124,
290 JVM_OPC_lushr = 125,
291 JVM_OPC_iand = 126,
292 JVM_OPC_land = 127,
293 JVM_OPC_ior = 128,
294 JVM_OPC_lor = 129,
295 JVM_OPC_ixor = 130,
296 JVM_OPC_lxor = 131,
297 JVM_OPC_iinc = 132,
298 JVM_OPC_i2l = 133,
299 JVM_OPC_i2f = 134,
300 JVM_OPC_i2d = 135,
301 JVM_OPC_l2i = 136,
302 JVM_OPC_l2f = 137,
303 JVM_OPC_l2d = 138,
304 JVM_OPC_f2i = 139,
305 JVM_OPC_f2l = 140,
306 JVM_OPC_f2d = 141,
307 JVM_OPC_d2i = 142,
308 JVM_OPC_d2l = 143,
309 JVM_OPC_d2f = 144,
310 JVM_OPC_i2b = 145,
311 JVM_OPC_i2c = 146,
312 JVM_OPC_i2s = 147,
313 JVM_OPC_lcmp = 148,
314 JVM_OPC_fcmpl = 149,
315 JVM_OPC_fcmpg = 150,
316 JVM_OPC_dcmpl = 151,
317 JVM_OPC_dcmpg = 152,
318 JVM_OPC_ifeq = 153,
319 JVM_OPC_ifne = 154,
320 JVM_OPC_iflt = 155,
321 JVM_OPC_ifge = 156,
322 JVM_OPC_ifgt = 157,
323 JVM_OPC_ifle = 158,
324 JVM_OPC_if_icmpeq = 159,
325 JVM_OPC_if_icmpne = 160,
326 JVM_OPC_if_icmplt = 161,
327 JVM_OPC_if_icmpge = 162,
328 JVM_OPC_if_icmpgt = 163,
329 JVM_OPC_if_icmple = 164,
330 JVM_OPC_if_acmpeq = 165,
331 JVM_OPC_if_acmpne = 166,
332 JVM_OPC_goto = 167,
333 JVM_OPC_jsr = 168,
334 JVM_OPC_ret = 169,
335 JVM_OPC_tableswitch = 170,
336 JVM_OPC_lookupswitch = 171,
337 JVM_OPC_ireturn = 172,
338 JVM_OPC_lreturn = 173,
339 JVM_OPC_freturn = 174,
340 JVM_OPC_dreturn = 175,
341 JVM_OPC_areturn = 176,
342 JVM_OPC_return = 177,
343 JVM_OPC_getstatic = 178,
344 JVM_OPC_putstatic = 179,
345 JVM_OPC_getfield = 180,
346 JVM_OPC_putfield = 181,
347 JVM_OPC_invokevirtual = 182,
348 JVM_OPC_invokespecial = 183,
349 JVM_OPC_invokestatic = 184,
350 JVM_OPC_invokeinterface = 185,
351 JVM_OPC_invokedynamic = 186,
352 JVM_OPC_new = 187,
353 JVM_OPC_newarray = 188,
354 JVM_OPC_anewarray = 189,
355 JVM_OPC_arraylength = 190,
356 JVM_OPC_athrow = 191,
357 JVM_OPC_checkcast = 192,
358 JVM_OPC_instanceof = 193,
359 JVM_OPC_monitorenter = 194,
360 JVM_OPC_monitorexit = 195,
361 JVM_OPC_wide = 196,
362 JVM_OPC_multianewarray = 197,
363 JVM_OPC_ifnull = 198,
364 JVM_OPC_ifnonnull = 199,
365 JVM_OPC_goto_w = 200,
366 JVM_OPC_jsr_w = 201,
367 JVM_OPC_MAX = 201
368 };
369
370 /* Opcode length initializer, use with something like:
371 * unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER;
372 */
373 #define JVM_OPCODE_LENGTH_INITIALIZER { \
374 1, /* nop */ \
375 1, /* aconst_null */ \
376 1, /* iconst_m1 */ \
377 1, /* iconst_0 */ \
378 1, /* iconst_1 */ \
379 1, /* iconst_2 */ \
380 1, /* iconst_3 */ \
381 1, /* iconst_4 */ \
382 1, /* iconst_5 */ \
383 1, /* lconst_0 */ \
384 1, /* lconst_1 */ \
385 1, /* fconst_0 */ \
386 1, /* fconst_1 */ \
387 1, /* fconst_2 */ \
388 1, /* dconst_0 */ \
389 1, /* dconst_1 */ \
390 2, /* bipush */ \
391 3, /* sipush */ \
392 2, /* ldc */ \
393 3, /* ldc_w */ \
394 3, /* ldc2_w */ \
395 2, /* iload */ \
396 2, /* lload */ \
397 2, /* fload */ \
398 2, /* dload */ \
399 2, /* aload */ \
400 1, /* iload_0 */ \
401 1, /* iload_1 */ \
402 1, /* iload_2 */ \
403 1, /* iload_3 */ \
404 1, /* lload_0 */ \
405 1, /* lload_1 */ \
406 1, /* lload_2 */ \
407 1, /* lload_3 */ \
408 1, /* fload_0 */ \
409 1, /* fload_1 */ \
410 1, /* fload_2 */ \
411 1, /* fload_3 */ \
412 1, /* dload_0 */ \
413 1, /* dload_1 */ \
414 1, /* dload_2 */ \
415 1, /* dload_3 */ \
416 1, /* aload_0 */ \
417 1, /* aload_1 */ \
418 1, /* aload_2 */ \
419 1, /* aload_3 */ \
420 1, /* iaload */ \
421 1, /* laload */ \
422 1, /* faload */ \
423 1, /* daload */ \
424 1, /* aaload */ \
425 1, /* baload */ \
426 1, /* caload */ \
427 1, /* saload */ \
428 2, /* istore */ \
429 2, /* lstore */ \
430 2, /* fstore */ \
431 2, /* dstore */ \
432 2, /* astore */ \
433 1, /* istore_0 */ \
434 1, /* istore_1 */ \
435 1, /* istore_2 */ \
436 1, /* istore_3 */ \
437 1, /* lstore_0 */ \
438 1, /* lstore_1 */ \
439 1, /* lstore_2 */ \
440 1, /* lstore_3 */ \
441 1, /* fstore_0 */ \
442 1, /* fstore_1 */ \
443 1, /* fstore_2 */ \
444 1, /* fstore_3 */ \
445 1, /* dstore_0 */ \
446 1, /* dstore_1 */ \
447 1, /* dstore_2 */ \
448 1, /* dstore_3 */ \
449 1, /* astore_0 */ \
450 1, /* astore_1 */ \
451 1, /* astore_2 */ \
452 1, /* astore_3 */ \
453 1, /* iastore */ \
454 1, /* lastore */ \
455 1, /* fastore */ \
456 1, /* dastore */ \
457 1, /* aastore */ \
458 1, /* bastore */ \
459 1, /* castore */ \
460 1, /* sastore */ \
461 1, /* pop */ \
462 1, /* pop2 */ \
463 1, /* dup */ \
464 1, /* dup_x1 */ \
465 1, /* dup_x2 */ \
466 1, /* dup2 */ \
467 1, /* dup2_x1 */ \
468 1, /* dup2_x2 */ \
469 1, /* swap */ \
470 1, /* iadd */ \
471 1, /* ladd */ \
472 1, /* fadd */ \
473 1, /* dadd */ \
474 1, /* isub */ \
475 1, /* lsub */ \
476 1, /* fsub */ \
477 1, /* dsub */ \
478 1, /* imul */ \
479 1, /* lmul */ \
480 1, /* fmul */ \
481 1, /* dmul */ \
482 1, /* idiv */ \
483 1, /* ldiv */ \
484 1, /* fdiv */ \
485 1, /* ddiv */ \
486 1, /* irem */ \
487 1, /* lrem */ \
488 1, /* frem */ \
489 1, /* drem */ \
490 1, /* ineg */ \
491 1, /* lneg */ \
492 1, /* fneg */ \
493 1, /* dneg */ \
494 1, /* ishl */ \
495 1, /* lshl */ \
496 1, /* ishr */ \
497 1, /* lshr */ \
498 1, /* iushr */ \
499 1, /* lushr */ \
500 1, /* iand */ \
501 1, /* land */ \
502 1, /* ior */ \
503 1, /* lor */ \
504 1, /* ixor */ \
505 1, /* lxor */ \
506 3, /* iinc */ \
507 1, /* i2l */ \
508 1, /* i2f */ \
509 1, /* i2d */ \
510 1, /* l2i */ \
511 1, /* l2f */ \
512 1, /* l2d */ \
513 1, /* f2i */ \
514 1, /* f2l */ \
515 1, /* f2d */ \
516 1, /* d2i */ \
517 1, /* d2l */ \
518 1, /* d2f */ \
519 1, /* i2b */ \
520 1, /* i2c */ \
521 1, /* i2s */ \
522 1, /* lcmp */ \
523 1, /* fcmpl */ \
524 1, /* fcmpg */ \
525 1, /* dcmpl */ \
526 1, /* dcmpg */ \
527 3, /* ifeq */ \
528 3, /* ifne */ \
529 3, /* iflt */ \
530 3, /* ifge */ \
531 3, /* ifgt */ \
532 3, /* ifle */ \
533 3, /* if_icmpeq */ \
534 3, /* if_icmpne */ \
535 3, /* if_icmplt */ \
536 3, /* if_icmpge */ \
537 3, /* if_icmpgt */ \
538 3, /* if_icmple */ \
539 3, /* if_acmpeq */ \
540 3, /* if_acmpne */ \
541 3, /* goto */ \
542 3, /* jsr */ \
543 2, /* ret */ \
544 99, /* tableswitch */ \
545 99, /* lookupswitch */ \
546 1, /* ireturn */ \
547 1, /* lreturn */ \
548 1, /* freturn */ \
549 1, /* dreturn */ \
550 1, /* areturn */ \
551 1, /* return */ \
552 3, /* getstatic */ \
553 3, /* putstatic */ \
554 3, /* getfield */ \
555 3, /* putfield */ \
556 3, /* invokevirtual */ \
557 3, /* invokespecial */ \
558 3, /* invokestatic */ \
559 5, /* invokeinterface */ \
560 5, /* invokedynamic */ \
561 3, /* new */ \
562 2, /* newarray */ \
563 3, /* anewarray */ \
564 1, /* arraylength */ \
565 1, /* athrow */ \
566 3, /* checkcast */ \
567 3, /* instanceof */ \
568 1, /* monitorenter */ \
569 1, /* monitorexit */ \
570 0, /* wide */ \
571 4, /* multianewarray */ \
572 3, /* ifnull */ \
573 3, /* ifnonnull */ \
574 5, /* goto_w */ \
575 5 /* jsr_w */ \
576 }
577
578 #ifdef __cplusplus
579 } /* extern "C" */
580 #endif /* __cplusplus */
581
582 #endif /* CLASSFILE_CONSTANTS */