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.
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.
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).
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.
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
26 #ifndef CLASSFILE_CONSTANTS_H
27 #define CLASSFILE_CONSTANTS_H
33 /* Classfile version number for this information */
34 #define JVM_CLASSFILE_MAJOR_VERSION 55
35 #define JVM_CLASSFILE_MINOR_VERSION 0
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
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
80 /* Used in newarray instruction. */
93 /* Constant Pool Entries */
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
115 /* JVM_CONSTANT_MethodHandle subtypes */
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
128 /* StackMapTable type item numbers */
132 JVM_ITEM_Integer = 1,
137 JVM_ITEM_UninitializedThis = 6,
139 JVM_ITEM_Uninitialized = 8
142 /* Type signatures */
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'
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,
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,
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,
258 JVM_OPC_dup2_x1 = 93,
259 JVM_OPC_dup2_x2 = 94,
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,
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,
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,
362 JVM_OPC_multianewarray = 197,
363 JVM_OPC_ifnull = 198,
364 JVM_OPC_ifnonnull = 199,
365 JVM_OPC_goto_w = 200,
370 /* Opcode length initializer, use with something like:
371 * unsigned char opcode_length[JVM_OPC_MAX+1] = JVM_OPCODE_LENGTH_INITIALIZER;
373 #define JVM_OPCODE_LENGTH_INITIALIZER { \
375 1, /* aconst_null */ \
544 99, /* tableswitch */ \
545 99, /* lookupswitch */ \
556 3, /* invokevirtual */ \
557 3, /* invokespecial */ \
558 3, /* invokestatic */ \
559 5, /* invokeinterface */ \
560 5, /* invokedynamic */ \
564 1, /* arraylength */ \
567 3, /* instanceof */ \
568 1, /* monitorenter */ \
569 1, /* monitorexit */ \
571 4, /* multianewarray */ \
580 #endif /* __cplusplus */
582 #endif /* CLASSFILE_CONSTANTS */