annotate agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java @ 1913:3b2dea75431e

6984311: JSR 292 needs optional bootstrap method parameters Summary: Allow CONSTANT_InvokeDynamic nodes to have any number of extra operands. Reviewed-by: twisti
author jrose
date Sat, 30 Oct 2010 13:08:23 -0700
parents 083fde3b838e
children ed69575596ac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1385
diff changeset
2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1385
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1385
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1385
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.runtime;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 public interface ClassConstants
a61af66fc99e Initial load
duke
parents:
diff changeset
28 {
a61af66fc99e Initial load
duke
parents:
diff changeset
29 // constant pool constant types - from JVM spec.
a61af66fc99e Initial load
duke
parents:
diff changeset
30
a61af66fc99e Initial load
duke
parents:
diff changeset
31 public static final int JVM_CONSTANT_Utf8 = 1;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 public static final int JVM_CONSTANT_Unicode = 2; // unused
a61af66fc99e Initial load
duke
parents:
diff changeset
33 public static final int JVM_CONSTANT_Integer = 3;
a61af66fc99e Initial load
duke
parents:
diff changeset
34 public static final int JVM_CONSTANT_Float = 4;
a61af66fc99e Initial load
duke
parents:
diff changeset
35 public static final int JVM_CONSTANT_Long = 5;
a61af66fc99e Initial load
duke
parents:
diff changeset
36 public static final int JVM_CONSTANT_Double = 6;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public static final int JVM_CONSTANT_Class = 7;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 public static final int JVM_CONSTANT_String = 8;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 public static final int JVM_CONSTANT_Fieldref = 9;
a61af66fc99e Initial load
duke
parents:
diff changeset
40 public static final int JVM_CONSTANT_Methodref = 10;
a61af66fc99e Initial load
duke
parents:
diff changeset
41 public static final int JVM_CONSTANT_InterfaceMethodref = 11;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 public static final int JVM_CONSTANT_NameAndType = 12;
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
43 public static final int JVM_CONSTANT_MethodHandle = 15;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
44 public static final int JVM_CONSTANT_MethodType = 16;
1913
3b2dea75431e 6984311: JSR 292 needs optional bootstrap method parameters
jrose
parents: 1660
diff changeset
45 public static final int JVM_CONSTANT_InvokeDynamicTrans = 17; // only occurs in old class files
3b2dea75431e 6984311: JSR 292 needs optional bootstrap method parameters
jrose
parents: 1660
diff changeset
46 public static final int JVM_CONSTANT_InvokeDynamic = 18;
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
47
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
48 // JVM_CONSTANT_MethodHandle subtypes
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
49 public static final int JVM_REF_getField = 1;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
50 public static final int JVM_REF_getStatic = 2;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
51 public static final int JVM_REF_putField = 3;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
52 public static final int JVM_REF_putStatic = 4;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
53 public static final int JVM_REF_invokeVirtual = 5;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
54 public static final int JVM_REF_invokeStatic = 6;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
55 public static final int JVM_REF_invokeSpecial = 7;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
56 public static final int JVM_REF_newInvokeSpecial = 8;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
57 public static final int JVM_REF_invokeInterface = 9;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
58
a61af66fc99e Initial load
duke
parents:
diff changeset
59 // HotSpot specific constant pool constant types.
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // For bad value initialization
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public static final int JVM_CONSTANT_Invalid = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
63
a61af66fc99e Initial load
duke
parents:
diff changeset
64 // Temporary tag until actual use
a61af66fc99e Initial load
duke
parents:
diff changeset
65 public static final int JVM_CONSTANT_UnresolvedClass = 100;
a61af66fc99e Initial load
duke
parents:
diff changeset
66
a61af66fc99e Initial load
duke
parents:
diff changeset
67 // Temporary tag while constructing constant pool
a61af66fc99e Initial load
duke
parents:
diff changeset
68 public static final int JVM_CONSTANT_ClassIndex = 101;
a61af66fc99e Initial load
duke
parents:
diff changeset
69
a61af66fc99e Initial load
duke
parents:
diff changeset
70 // Temporary tag until actual use
a61af66fc99e Initial load
duke
parents:
diff changeset
71 public static final int JVM_CONSTANT_UnresolvedString = 102;
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 // Temporary tag while constructing constant pool
a61af66fc99e Initial load
duke
parents:
diff changeset
74 public static final int JVM_CONSTANT_StringIndex = 103;
a61af66fc99e Initial load
duke
parents:
diff changeset
75
1385
bc32f286fae0 6945219: minor SA fixes
never
parents: 844
diff changeset
76 // Temporary tag while constructing constant pool
bc32f286fae0 6945219: minor SA fixes
never
parents: 844
diff changeset
77 public static final int JVM_CONSTANT_UnresolvedClassInError = 104;
bc32f286fae0 6945219: minor SA fixes
never
parents: 844
diff changeset
78
0
a61af66fc99e Initial load
duke
parents:
diff changeset
79 // 1.5 major/minor version numbers from JVM spec. 3rd edition
a61af66fc99e Initial load
duke
parents:
diff changeset
80 public static final short MAJOR_VERSION = 49;
a61af66fc99e Initial load
duke
parents:
diff changeset
81 public static final short MINOR_VERSION = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
82
a61af66fc99e Initial load
duke
parents:
diff changeset
83 public static final short MAJOR_VERSION_OLD = 46;
a61af66fc99e Initial load
duke
parents:
diff changeset
84 public static final short MINOR_VERSION_OLD = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
85
a61af66fc99e Initial load
duke
parents:
diff changeset
86 // From jvm.h
a61af66fc99e Initial load
duke
parents:
diff changeset
87 public static final long JVM_ACC_PUBLIC = 0x0001; /* visible to everyone */
a61af66fc99e Initial load
duke
parents:
diff changeset
88 public static final long JVM_ACC_PRIVATE = 0x0002; /* visible only to the defining class */
a61af66fc99e Initial load
duke
parents:
diff changeset
89 public static final long JVM_ACC_PROTECTED = 0x0004; /* visible to subclasses */
a61af66fc99e Initial load
duke
parents:
diff changeset
90 public static final long JVM_ACC_STATIC = 0x0008; /* instance variable is static */
a61af66fc99e Initial load
duke
parents:
diff changeset
91 public static final long JVM_ACC_FINAL = 0x0010; /* no further subclassing, overriding */
a61af66fc99e Initial load
duke
parents:
diff changeset
92 public static final long JVM_ACC_SYNCHRONIZED = 0x0020; /* wrap method call in monitor lock */
a61af66fc99e Initial load
duke
parents:
diff changeset
93 public static final long JVM_ACC_SUPER = 0x0020; /* funky handling of invokespecial */
a61af66fc99e Initial load
duke
parents:
diff changeset
94 public static final long JVM_ACC_VOLATILE = 0x0040; /* can not cache in registers */
a61af66fc99e Initial load
duke
parents:
diff changeset
95 public static final long JVM_ACC_BRIDGE = 0x0040; /* bridge method generated by compiler */
a61af66fc99e Initial load
duke
parents:
diff changeset
96 public static final long JVM_ACC_TRANSIENT = 0x0080; /* not persistant */
a61af66fc99e Initial load
duke
parents:
diff changeset
97 public static final long JVM_ACC_VARARGS = 0x0080; /* method declared with variable number of args */
a61af66fc99e Initial load
duke
parents:
diff changeset
98 public static final long JVM_ACC_NATIVE = 0x0100; /* implemented in C */
a61af66fc99e Initial load
duke
parents:
diff changeset
99 public static final long JVM_ACC_INTERFACE = 0x0200; /* class is an interface */
a61af66fc99e Initial load
duke
parents:
diff changeset
100 public static final long JVM_ACC_ABSTRACT = 0x0400; /* no definition provided */
a61af66fc99e Initial load
duke
parents:
diff changeset
101 public static final long JVM_ACC_STRICT = 0x0800; /* strict floating point */
a61af66fc99e Initial load
duke
parents:
diff changeset
102 public static final long JVM_ACC_SYNTHETIC = 0x1000; /* compiler-generated class, method or field */
a61af66fc99e Initial load
duke
parents:
diff changeset
103 public static final long JVM_ACC_ANNOTATION = 0x2000; /* annotation type */
a61af66fc99e Initial load
duke
parents:
diff changeset
104 public static final long JVM_ACC_ENUM = 0x4000; /* field is declared as element of enum */
a61af66fc99e Initial load
duke
parents:
diff changeset
105
a61af66fc99e Initial load
duke
parents:
diff changeset
106
a61af66fc99e Initial load
duke
parents:
diff changeset
107 // from accessFlags.hpp - hotspot internal flags
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // flags actually put in .class file
a61af66fc99e Initial load
duke
parents:
diff changeset
110 public static final long JVM_ACC_WRITTEN_FLAGS = 0x00007FFF;
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 // methodOop flags
a61af66fc99e Initial load
duke
parents:
diff changeset
113 // monitorenter/monitorexit bytecodes match
a61af66fc99e Initial load
duke
parents:
diff changeset
114 public static final long JVM_ACC_MONITOR_MATCH = 0x10000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
115 // Method contains monitorenter/monitorexit bytecodes
a61af66fc99e Initial load
duke
parents:
diff changeset
116 public static final long JVM_ACC_HAS_MONITOR_BYTECODES = 0x20000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
117 // Method has loops
a61af66fc99e Initial load
duke
parents:
diff changeset
118 public static final long JVM_ACC_HAS_LOOPS = 0x40000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
119 // The loop flag has been initialized
a61af66fc99e Initial load
duke
parents:
diff changeset
120 public static final long JVM_ACC_LOOPS_FLAG_INIT = (int)0x80000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
121 // Queued for compilation
a61af66fc99e Initial load
duke
parents:
diff changeset
122 public static final long JVM_ACC_QUEUED = 0x01000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 // TEMPORARY: currently on stack replacement compilation is not built into the
a61af66fc99e Initial load
duke
parents:
diff changeset
124 // invocation counter machinery. Until it is, we will keep track of methods which
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // cannot be on stack replaced in the access flags.
a61af66fc99e Initial load
duke
parents:
diff changeset
126 public static final long JVM_ACC_NOT_OSR_COMPILABLE = 0x08000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
127 public static final long JVM_ACC_HAS_LINE_NUMBER_TABLE = 0x00100000;
a61af66fc99e Initial load
duke
parents:
diff changeset
128 public static final long JVM_ACC_HAS_CHECKED_EXCEPTIONS = 0x00400000;
a61af66fc99e Initial load
duke
parents:
diff changeset
129 public static final long JVM_ACC_HAS_JSRS = 0x00800000;
a61af66fc99e Initial load
duke
parents:
diff changeset
130 // RedefineClasses() has made method obsolete
a61af66fc99e Initial load
duke
parents:
diff changeset
131 public static final long JVM_ACC_IS_OBSOLETE = 0x00010000;
a61af66fc99e Initial load
duke
parents:
diff changeset
132
a61af66fc99e Initial load
duke
parents:
diff changeset
133 // klassOop flags
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // True if this class has miranda methods in it's vtable
a61af66fc99e Initial load
duke
parents:
diff changeset
135 public static final long JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
136 // True if klass has a vanilla default constructor
a61af66fc99e Initial load
duke
parents:
diff changeset
137 public static final long JVM_ACC_HAS_VANILLA_CONSTRUCTOR = 0x20000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
138 // True if klass has a non-empty finalize() method
a61af66fc99e Initial load
duke
parents:
diff changeset
139 public static final long JVM_ACC_HAS_FINALIZER = 0x40000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
140 // True if klass supports the Clonable interface
a61af66fc99e Initial load
duke
parents:
diff changeset
141 public static final long JVM_ACC_IS_CLONEABLE = 0x80000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 // klassOop and methodOop flags
a61af66fc99e Initial load
duke
parents:
diff changeset
144 public static final long JVM_ACC_HAS_LOCAL_VARIABLE_TABLE = 0x00200000;
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // flags promoted from methods to the holding klass
a61af66fc99e Initial load
duke
parents:
diff changeset
146 public static final long JVM_ACC_PROMOTED_FLAGS = 0x00200000;
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 // field flags
a61af66fc99e Initial load
duke
parents:
diff changeset
149 // Note: these flags must be defined in the low order 16 bits because
a61af66fc99e Initial load
duke
parents:
diff changeset
150 // instanceKlass only stores a ushort worth of information from the
a61af66fc99e Initial load
duke
parents:
diff changeset
151 // AccessFlags value.
a61af66fc99e Initial load
duke
parents:
diff changeset
152 // field access is watched by JVMTI
a61af66fc99e Initial load
duke
parents:
diff changeset
153 public static final long JVM_ACC_FIELD_ACCESS_WATCHED = 0x00002000;
a61af66fc99e Initial load
duke
parents:
diff changeset
154 // field modification is watched by JVMTI
a61af66fc99e Initial load
duke
parents:
diff changeset
155 public static final long JVM_ACC_FIELD_MODIFICATION_WATCHED = 0x00008000;
a61af66fc99e Initial load
duke
parents:
diff changeset
156
a61af66fc99e Initial load
duke
parents:
diff changeset
157 // flags accepted by set_field_flags
a61af66fc99e Initial load
duke
parents:
diff changeset
158 public static final long JVM_ACC_FIELD_FLAGS = 0x00008000 | JVM_ACC_WRITTEN_FLAGS;
a61af66fc99e Initial load
duke
parents:
diff changeset
159
a61af66fc99e Initial load
duke
parents:
diff changeset
160 // from jvm.h
a61af66fc99e Initial load
duke
parents:
diff changeset
161
a61af66fc99e Initial load
duke
parents:
diff changeset
162 public static final long JVM_RECOGNIZED_CLASS_MODIFIERS = (JVM_ACC_PUBLIC |
705
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
163 JVM_ACC_FINAL |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
164 JVM_ACC_SUPER |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
165 JVM_ACC_INTERFACE |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
166 JVM_ACC_ABSTRACT |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
167 JVM_ACC_ANNOTATION |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
168 JVM_ACC_ENUM |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
169 JVM_ACC_SYNTHETIC);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
170
a61af66fc99e Initial load
duke
parents:
diff changeset
171
a61af66fc99e Initial load
duke
parents:
diff changeset
172 public static final long JVM_RECOGNIZED_FIELD_MODIFIERS = (JVM_ACC_PUBLIC |
705
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
173 JVM_ACC_PRIVATE |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
174 JVM_ACC_PROTECTED |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
175 JVM_ACC_STATIC |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
176 JVM_ACC_FINAL |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
177 JVM_ACC_VOLATILE |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
178 JVM_ACC_TRANSIENT |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
179 JVM_ACC_ENUM |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
180 JVM_ACC_SYNTHETIC);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 public static final long JVM_RECOGNIZED_METHOD_MODIFIERS = (JVM_ACC_PUBLIC |
705
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
183 JVM_ACC_PRIVATE |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
184 JVM_ACC_PROTECTED |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
185 JVM_ACC_STATIC |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
186 JVM_ACC_FINAL |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
187 JVM_ACC_SYNCHRONIZED |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
188 JVM_ACC_BRIDGE |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
189 JVM_ACC_VARARGS |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
190 JVM_ACC_NATIVE |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
191 JVM_ACC_ABSTRACT |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
192 JVM_ACC_STRICT |
1f2abec69714 6826261: class file dumping from SA is broken
never
parents: 0
diff changeset
193 JVM_ACC_SYNTHETIC);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
194 }