annotate agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java @ 113:ba764ed4b6f2

6420645: Create a vm that uses compressed oops for up to 32gb heapsizes Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author coleenp
date Sun, 13 Apr 2008 17:43:42 -0400
parents a61af66fc99e
children 1f2abec69714
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
a61af66fc99e Initial load
duke
parents:
diff changeset
2 * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
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 *
a61af66fc99e Initial load
duke
parents:
diff changeset
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
a61af66fc99e Initial load
duke
parents:
diff changeset
20 * CA 95054 USA or visit www.sun.com if you need additional information or
a61af66fc99e Initial load
duke
parents:
diff changeset
21 * have any questions.
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;
a61af66fc99e Initial load
duke
parents:
diff changeset
43
a61af66fc99e Initial load
duke
parents:
diff changeset
44 // HotSpot specific constant pool constant types.
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 // For bad value initialization
a61af66fc99e Initial load
duke
parents:
diff changeset
47 public static final int JVM_CONSTANT_Invalid = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
48
a61af66fc99e Initial load
duke
parents:
diff changeset
49 // Temporary tag until actual use
a61af66fc99e Initial load
duke
parents:
diff changeset
50 public static final int JVM_CONSTANT_UnresolvedClass = 100;
a61af66fc99e Initial load
duke
parents:
diff changeset
51
a61af66fc99e Initial load
duke
parents:
diff changeset
52 // Temporary tag while constructing constant pool
a61af66fc99e Initial load
duke
parents:
diff changeset
53 public static final int JVM_CONSTANT_ClassIndex = 101;
a61af66fc99e Initial load
duke
parents:
diff changeset
54
a61af66fc99e Initial load
duke
parents:
diff changeset
55 // Temporary tag until actual use
a61af66fc99e Initial load
duke
parents:
diff changeset
56 public static final int JVM_CONSTANT_UnresolvedString = 102;
a61af66fc99e Initial load
duke
parents:
diff changeset
57
a61af66fc99e Initial load
duke
parents:
diff changeset
58 // Temporary tag while constructing constant pool
a61af66fc99e Initial load
duke
parents:
diff changeset
59 public static final int JVM_CONSTANT_StringIndex = 103;
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 // 1.5 major/minor version numbers from JVM spec. 3rd edition
a61af66fc99e Initial load
duke
parents:
diff changeset
62 public static final short MAJOR_VERSION = 49;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 public static final short MINOR_VERSION = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 public static final short MAJOR_VERSION_OLD = 46;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 public static final short MINOR_VERSION_OLD = 0;
a61af66fc99e Initial load
duke
parents:
diff changeset
67
a61af66fc99e Initial load
duke
parents:
diff changeset
68 // From jvm.h
a61af66fc99e Initial load
duke
parents:
diff changeset
69 public static final long JVM_ACC_PUBLIC = 0x0001; /* visible to everyone */
a61af66fc99e Initial load
duke
parents:
diff changeset
70 public static final long JVM_ACC_PRIVATE = 0x0002; /* visible only to the defining class */
a61af66fc99e Initial load
duke
parents:
diff changeset
71 public static final long JVM_ACC_PROTECTED = 0x0004; /* visible to subclasses */
a61af66fc99e Initial load
duke
parents:
diff changeset
72 public static final long JVM_ACC_STATIC = 0x0008; /* instance variable is static */
a61af66fc99e Initial load
duke
parents:
diff changeset
73 public static final long JVM_ACC_FINAL = 0x0010; /* no further subclassing, overriding */
a61af66fc99e Initial load
duke
parents:
diff changeset
74 public static final long JVM_ACC_SYNCHRONIZED = 0x0020; /* wrap method call in monitor lock */
a61af66fc99e Initial load
duke
parents:
diff changeset
75 public static final long JVM_ACC_SUPER = 0x0020; /* funky handling of invokespecial */
a61af66fc99e Initial load
duke
parents:
diff changeset
76 public static final long JVM_ACC_VOLATILE = 0x0040; /* can not cache in registers */
a61af66fc99e Initial load
duke
parents:
diff changeset
77 public static final long JVM_ACC_BRIDGE = 0x0040; /* bridge method generated by compiler */
a61af66fc99e Initial load
duke
parents:
diff changeset
78 public static final long JVM_ACC_TRANSIENT = 0x0080; /* not persistant */
a61af66fc99e Initial load
duke
parents:
diff changeset
79 public static final long JVM_ACC_VARARGS = 0x0080; /* method declared with variable number of args */
a61af66fc99e Initial load
duke
parents:
diff changeset
80 public static final long JVM_ACC_NATIVE = 0x0100; /* implemented in C */
a61af66fc99e Initial load
duke
parents:
diff changeset
81 public static final long JVM_ACC_INTERFACE = 0x0200; /* class is an interface */
a61af66fc99e Initial load
duke
parents:
diff changeset
82 public static final long JVM_ACC_ABSTRACT = 0x0400; /* no definition provided */
a61af66fc99e Initial load
duke
parents:
diff changeset
83 public static final long JVM_ACC_STRICT = 0x0800; /* strict floating point */
a61af66fc99e Initial load
duke
parents:
diff changeset
84 public static final long JVM_ACC_SYNTHETIC = 0x1000; /* compiler-generated class, method or field */
a61af66fc99e Initial load
duke
parents:
diff changeset
85 public static final long JVM_ACC_ANNOTATION = 0x2000; /* annotation type */
a61af66fc99e Initial load
duke
parents:
diff changeset
86 public static final long JVM_ACC_ENUM = 0x4000; /* field is declared as element of enum */
a61af66fc99e Initial load
duke
parents:
diff changeset
87
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 // from accessFlags.hpp - hotspot internal flags
a61af66fc99e Initial load
duke
parents:
diff changeset
90
a61af66fc99e Initial load
duke
parents:
diff changeset
91 // flags actually put in .class file
a61af66fc99e Initial load
duke
parents:
diff changeset
92 public static final long JVM_ACC_WRITTEN_FLAGS = 0x00007FFF;
a61af66fc99e Initial load
duke
parents:
diff changeset
93
a61af66fc99e Initial load
duke
parents:
diff changeset
94 // methodOop flags
a61af66fc99e Initial load
duke
parents:
diff changeset
95 // monitorenter/monitorexit bytecodes match
a61af66fc99e Initial load
duke
parents:
diff changeset
96 public static final long JVM_ACC_MONITOR_MATCH = 0x10000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
97 // Method contains monitorenter/monitorexit bytecodes
a61af66fc99e Initial load
duke
parents:
diff changeset
98 public static final long JVM_ACC_HAS_MONITOR_BYTECODES = 0x20000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
99 // Method has loops
a61af66fc99e Initial load
duke
parents:
diff changeset
100 public static final long JVM_ACC_HAS_LOOPS = 0x40000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
101 // The loop flag has been initialized
a61af66fc99e Initial load
duke
parents:
diff changeset
102 public static final long JVM_ACC_LOOPS_FLAG_INIT = (int)0x80000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 // Queued for compilation
a61af66fc99e Initial load
duke
parents:
diff changeset
104 public static final long JVM_ACC_QUEUED = 0x01000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
105 // TEMPORARY: currently on stack replacement compilation is not built into the
a61af66fc99e Initial load
duke
parents:
diff changeset
106 // invocation counter machinery. Until it is, we will keep track of methods which
a61af66fc99e Initial load
duke
parents:
diff changeset
107 // cannot be on stack replaced in the access flags.
a61af66fc99e Initial load
duke
parents:
diff changeset
108 public static final long JVM_ACC_NOT_OSR_COMPILABLE = 0x08000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
109 public static final long JVM_ACC_HAS_LINE_NUMBER_TABLE = 0x00100000;
a61af66fc99e Initial load
duke
parents:
diff changeset
110 public static final long JVM_ACC_HAS_CHECKED_EXCEPTIONS = 0x00400000;
a61af66fc99e Initial load
duke
parents:
diff changeset
111 public static final long JVM_ACC_HAS_JSRS = 0x00800000;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 // RedefineClasses() has made method obsolete
a61af66fc99e Initial load
duke
parents:
diff changeset
113 public static final long JVM_ACC_IS_OBSOLETE = 0x00010000;
a61af66fc99e Initial load
duke
parents:
diff changeset
114
a61af66fc99e Initial load
duke
parents:
diff changeset
115 // klassOop flags
a61af66fc99e Initial load
duke
parents:
diff changeset
116 // True if this class has miranda methods in it's vtable
a61af66fc99e Initial load
duke
parents:
diff changeset
117 public static final long JVM_ACC_HAS_MIRANDA_METHODS = 0x10000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
118 // True if klass has a vanilla default constructor
a61af66fc99e Initial load
duke
parents:
diff changeset
119 public static final long JVM_ACC_HAS_VANILLA_CONSTRUCTOR = 0x20000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
120 // True if klass has a non-empty finalize() method
a61af66fc99e Initial load
duke
parents:
diff changeset
121 public static final long JVM_ACC_HAS_FINALIZER = 0x40000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 // True if klass supports the Clonable interface
a61af66fc99e Initial load
duke
parents:
diff changeset
123 public static final long JVM_ACC_IS_CLONEABLE = 0x80000000;
a61af66fc99e Initial load
duke
parents:
diff changeset
124
a61af66fc99e Initial load
duke
parents:
diff changeset
125 // klassOop and methodOop flags
a61af66fc99e Initial load
duke
parents:
diff changeset
126 public static final long JVM_ACC_HAS_LOCAL_VARIABLE_TABLE = 0x00200000;
a61af66fc99e Initial load
duke
parents:
diff changeset
127 // flags promoted from methods to the holding klass
a61af66fc99e Initial load
duke
parents:
diff changeset
128 public static final long JVM_ACC_PROMOTED_FLAGS = 0x00200000;
a61af66fc99e Initial load
duke
parents:
diff changeset
129
a61af66fc99e Initial load
duke
parents:
diff changeset
130 // field flags
a61af66fc99e Initial load
duke
parents:
diff changeset
131 // Note: these flags must be defined in the low order 16 bits because
a61af66fc99e Initial load
duke
parents:
diff changeset
132 // instanceKlass only stores a ushort worth of information from the
a61af66fc99e Initial load
duke
parents:
diff changeset
133 // AccessFlags value.
a61af66fc99e Initial load
duke
parents:
diff changeset
134 // field access is watched by JVMTI
a61af66fc99e Initial load
duke
parents:
diff changeset
135 public static final long JVM_ACC_FIELD_ACCESS_WATCHED = 0x00002000;
a61af66fc99e Initial load
duke
parents:
diff changeset
136 // field modification is watched by JVMTI
a61af66fc99e Initial load
duke
parents:
diff changeset
137 public static final long JVM_ACC_FIELD_MODIFICATION_WATCHED = 0x00008000;
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 // flags accepted by set_field_flags
a61af66fc99e Initial load
duke
parents:
diff changeset
140 public static final long JVM_ACC_FIELD_FLAGS = 0x00008000 | JVM_ACC_WRITTEN_FLAGS;
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 // from jvm.h
a61af66fc99e Initial load
duke
parents:
diff changeset
143
a61af66fc99e Initial load
duke
parents:
diff changeset
144 public static final long JVM_RECOGNIZED_CLASS_MODIFIERS = (JVM_ACC_PUBLIC |
a61af66fc99e Initial load
duke
parents:
diff changeset
145 JVM_ACC_FINAL |
a61af66fc99e Initial load
duke
parents:
diff changeset
146 JVM_ACC_SUPER |
a61af66fc99e Initial load
duke
parents:
diff changeset
147 JVM_ACC_INTERFACE |
a61af66fc99e Initial load
duke
parents:
diff changeset
148 JVM_ACC_ABSTRACT |
a61af66fc99e Initial load
duke
parents:
diff changeset
149 JVM_ACC_ANNOTATION |
a61af66fc99e Initial load
duke
parents:
diff changeset
150 JVM_ACC_SYNTHETIC);
a61af66fc99e Initial load
duke
parents:
diff changeset
151
a61af66fc99e Initial load
duke
parents:
diff changeset
152
a61af66fc99e Initial load
duke
parents:
diff changeset
153 public static final long JVM_RECOGNIZED_FIELD_MODIFIERS = (JVM_ACC_PUBLIC |
a61af66fc99e Initial load
duke
parents:
diff changeset
154 JVM_ACC_PRIVATE |
a61af66fc99e Initial load
duke
parents:
diff changeset
155 JVM_ACC_PROTECTED |
a61af66fc99e Initial load
duke
parents:
diff changeset
156 JVM_ACC_STATIC |
a61af66fc99e Initial load
duke
parents:
diff changeset
157 JVM_ACC_FINAL |
a61af66fc99e Initial load
duke
parents:
diff changeset
158 JVM_ACC_VOLATILE |
a61af66fc99e Initial load
duke
parents:
diff changeset
159 JVM_ACC_TRANSIENT |
a61af66fc99e Initial load
duke
parents:
diff changeset
160 JVM_ACC_ENUM |
a61af66fc99e Initial load
duke
parents:
diff changeset
161 JVM_ACC_SYNTHETIC);
a61af66fc99e Initial load
duke
parents:
diff changeset
162
a61af66fc99e Initial load
duke
parents:
diff changeset
163 public static final long JVM_RECOGNIZED_METHOD_MODIFIERS = (JVM_ACC_PUBLIC |
a61af66fc99e Initial load
duke
parents:
diff changeset
164 JVM_ACC_PRIVATE |
a61af66fc99e Initial load
duke
parents:
diff changeset
165 JVM_ACC_PROTECTED |
a61af66fc99e Initial load
duke
parents:
diff changeset
166 JVM_ACC_STATIC |
a61af66fc99e Initial load
duke
parents:
diff changeset
167 JVM_ACC_FINAL |
a61af66fc99e Initial load
duke
parents:
diff changeset
168 JVM_ACC_SYNCHRONIZED |
a61af66fc99e Initial load
duke
parents:
diff changeset
169 JVM_ACC_BRIDGE |
a61af66fc99e Initial load
duke
parents:
diff changeset
170 JVM_ACC_VARARGS |
a61af66fc99e Initial load
duke
parents:
diff changeset
171 JVM_ACC_NATIVE |
a61af66fc99e Initial load
duke
parents:
diff changeset
172 JVM_ACC_ABSTRACT |
a61af66fc99e Initial load
duke
parents:
diff changeset
173 JVM_ACC_STRICT |
a61af66fc99e Initial load
duke
parents:
diff changeset
174 JVM_ACC_SYNTHETIC);
a61af66fc99e Initial load
duke
parents:
diff changeset
175 }