Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/systemDictionary.hpp @ 6948:e522a00b91aa
Merge with http://hg.openjdk.java.net/hsx/hsx25/hotspot/ after NPG - C++ build works
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 12 Nov 2012 23:14:12 +0100 |
parents | fd71ca8c5f88 4735d2c84362 |
children | 41938af2b3d8 |
comparison
equal
deleted
inserted
replaced
6711:ae13cc658b80 | 6948:e522a00b91aa |
---|---|
34 #include "utilities/hashtable.hpp" | 34 #include "utilities/hashtable.hpp" |
35 #include "utilities/hashtable.inline.hpp" | 35 #include "utilities/hashtable.inline.hpp" |
36 | 36 |
37 // The system dictionary stores all loaded classes and maps: | 37 // The system dictionary stores all loaded classes and maps: |
38 // | 38 // |
39 // [class name,class loader] -> class i.e. [Symbol*,oop] -> klassOop | 39 // [class name,class loader] -> class i.e. [Symbol*,oop] -> Klass* |
40 // | 40 // |
41 // Classes are loaded lazily. The default VM class loader is | 41 // Classes are loaded lazily. The default VM class loader is |
42 // represented as NULL. | 42 // represented as NULL. |
43 | 43 |
44 // The underlying data structure is an open hash table with a fixed number | 44 // The underlying data structure is an open hash table with a fixed number |
90 // that makes some minor distinctions, like whether the klass | 90 // that makes some minor distinctions, like whether the klass |
91 // is preloaded, optional, release-specific, etc. | 91 // is preloaded, optional, release-specific, etc. |
92 // The order of these definitions is significant; it is the order in which | 92 // The order of these definitions is significant; it is the order in which |
93 // preloading is actually performed by initialize_preloaded_classes. | 93 // preloading is actually performed by initialize_preloaded_classes. |
94 | 94 |
95 #define WK_KLASSES_DO(template) \ | 95 #define WK_KLASSES_DO(do_klass) \ |
96 /* well-known classes */ \ | 96 /* well-known classes */ \ |
97 template(Object_klass, java_lang_Object, Pre) \ | 97 do_klass(Object_klass, java_lang_Object, Pre ) \ |
98 template(String_klass, java_lang_String, Pre) \ | 98 do_klass(String_klass, java_lang_String, Pre ) \ |
99 template(Class_klass, java_lang_Class, Pre) \ | 99 do_klass(Class_klass, java_lang_Class, Pre ) \ |
100 template(Cloneable_klass, java_lang_Cloneable, Pre) \ | 100 do_klass(Cloneable_klass, java_lang_Cloneable, Pre ) \ |
101 template(ClassLoader_klass, java_lang_ClassLoader, Pre) \ | 101 do_klass(ClassLoader_klass, java_lang_ClassLoader, Pre ) \ |
102 template(Serializable_klass, java_io_Serializable, Pre) \ | 102 do_klass(Serializable_klass, java_io_Serializable, Pre ) \ |
103 template(System_klass, java_lang_System, Pre) \ | 103 do_klass(System_klass, java_lang_System, Pre ) \ |
104 template(Throwable_klass, java_lang_Throwable, Pre) \ | 104 do_klass(Throwable_klass, java_lang_Throwable, Pre ) \ |
105 template(Error_klass, java_lang_Error, Pre) \ | 105 do_klass(Error_klass, java_lang_Error, Pre ) \ |
106 template(ThreadDeath_klass, java_lang_ThreadDeath, Pre) \ | 106 do_klass(ThreadDeath_klass, java_lang_ThreadDeath, Pre ) \ |
107 template(Exception_klass, java_lang_Exception, Pre) \ | 107 do_klass(Exception_klass, java_lang_Exception, Pre ) \ |
108 template(RuntimeException_klass, java_lang_RuntimeException, Pre) \ | 108 do_klass(RuntimeException_klass, java_lang_RuntimeException, Pre ) \ |
109 template(ProtectionDomain_klass, java_security_ProtectionDomain, Pre) \ | 109 do_klass(ProtectionDomain_klass, java_security_ProtectionDomain, Pre ) \ |
110 template(AccessControlContext_klass, java_security_AccessControlContext, Pre) \ | 110 do_klass(AccessControlContext_klass, java_security_AccessControlContext, Pre ) \ |
111 template(ClassNotFoundException_klass, java_lang_ClassNotFoundException, Pre) \ | 111 do_klass(ClassNotFoundException_klass, java_lang_ClassNotFoundException, Pre ) \ |
112 template(NoClassDefFoundError_klass, java_lang_NoClassDefFoundError, Pre) \ | 112 do_klass(NoClassDefFoundError_klass, java_lang_NoClassDefFoundError, Pre ) \ |
113 template(LinkageError_klass, java_lang_LinkageError, Pre) \ | 113 do_klass(LinkageError_klass, java_lang_LinkageError, Pre ) \ |
114 template(ClassCastException_klass, java_lang_ClassCastException, Pre) \ | 114 do_klass(ClassCastException_klass, java_lang_ClassCastException, Pre ) \ |
115 template(ArrayStoreException_klass, java_lang_ArrayStoreException, Pre) \ | 115 do_klass(ArrayStoreException_klass, java_lang_ArrayStoreException, Pre ) \ |
116 template(VirtualMachineError_klass, java_lang_VirtualMachineError, Pre) \ | 116 do_klass(VirtualMachineError_klass, java_lang_VirtualMachineError, Pre ) \ |
117 template(OutOfMemoryError_klass, java_lang_OutOfMemoryError, Pre) \ | 117 do_klass(OutOfMemoryError_klass, java_lang_OutOfMemoryError, Pre ) \ |
118 template(StackOverflowError_klass, java_lang_StackOverflowError, Pre) \ | 118 do_klass(StackOverflowError_klass, java_lang_StackOverflowError, Pre ) \ |
119 template(IllegalMonitorStateException_klass, java_lang_IllegalMonitorStateException, Pre) \ | 119 do_klass(IllegalMonitorStateException_klass, java_lang_IllegalMonitorStateException, Pre ) \ |
120 template(Reference_klass, java_lang_ref_Reference, Pre) \ | 120 do_klass(Reference_klass, java_lang_ref_Reference, Pre ) \ |
121 \ | 121 \ |
122 /* Preload ref klasses and set reference types */ \ | 122 /* Preload ref klasses and set reference types */ \ |
123 template(SoftReference_klass, java_lang_ref_SoftReference, Pre) \ | 123 do_klass(SoftReference_klass, java_lang_ref_SoftReference, Pre ) \ |
124 template(WeakReference_klass, java_lang_ref_WeakReference, Pre) \ | 124 do_klass(WeakReference_klass, java_lang_ref_WeakReference, Pre ) \ |
125 template(FinalReference_klass, java_lang_ref_FinalReference, Pre) \ | 125 do_klass(FinalReference_klass, java_lang_ref_FinalReference, Pre ) \ |
126 template(PhantomReference_klass, java_lang_ref_PhantomReference, Pre) \ | 126 do_klass(PhantomReference_klass, java_lang_ref_PhantomReference, Pre ) \ |
127 template(Finalizer_klass, java_lang_ref_Finalizer, Pre) \ | 127 do_klass(Finalizer_klass, java_lang_ref_Finalizer, Pre ) \ |
128 \ | 128 \ |
129 template(Thread_klass, java_lang_Thread, Pre) \ | 129 do_klass(Thread_klass, java_lang_Thread, Pre ) \ |
130 template(ThreadGroup_klass, java_lang_ThreadGroup, Pre) \ | 130 do_klass(ThreadGroup_klass, java_lang_ThreadGroup, Pre ) \ |
131 template(Properties_klass, java_util_Properties, Pre) \ | 131 do_klass(Properties_klass, java_util_Properties, Pre ) \ |
132 template(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre) \ | 132 do_klass(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre ) \ |
133 template(reflect_Field_klass, java_lang_reflect_Field, Pre) \ | 133 do_klass(reflect_Field_klass, java_lang_reflect_Field, Pre ) \ |
134 template(reflect_Method_klass, java_lang_reflect_Method, Pre) \ | 134 do_klass(reflect_Method_klass, java_lang_reflect_Method, Pre ) \ |
135 template(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre) \ | 135 do_klass(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre ) \ |
136 \ | 136 \ |
137 /* NOTE: needed too early in bootstrapping process to have checks based on JDK version */ \ | 137 /* NOTE: needed too early in bootstrapping process to have checks based on JDK version */ \ |
138 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ | 138 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ |
139 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ | 139 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ |
140 template(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt) \ | 140 do_klass(lambda_MagicLambdaImpl_klass, java_lang_invoke_MagicLambdaImpl, Opt ) \ |
141 template(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \ | 141 do_klass(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt ) \ |
142 template(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \ | 142 do_klass(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \ |
143 template(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt) \ | 143 do_klass(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \ |
144 template(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15) \ | 144 do_klass(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt ) \ |
145 template(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \ | 145 do_klass(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15 ) \ |
146 \ | 146 do_klass(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15 ) \ |
147 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ | 147 \ |
148 template(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292) \ | 148 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ |
149 template(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292) \ | 149 do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292 ) \ |
150 template(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292) \ | 150 do_klass(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292 ) \ |
151 template(LambdaForm_klass, java_lang_invoke_LambdaForm, Opt) \ | 151 do_klass(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292 ) \ |
152 template(MethodType_klass, java_lang_invoke_MethodType, Pre_JSR292) \ | 152 do_klass(LambdaForm_klass, java_lang_invoke_LambdaForm, Opt ) \ |
153 template(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre_JSR292) \ | 153 do_klass(MethodType_klass, java_lang_invoke_MethodType, Pre_JSR292 ) \ |
154 template(CallSite_klass, java_lang_invoke_CallSite, Pre_JSR292) \ | 154 do_klass(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre_JSR292 ) \ |
155 template(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre_JSR292) \ | 155 do_klass(CallSite_klass, java_lang_invoke_CallSite, Pre_JSR292 ) \ |
156 template(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre_JSR292) \ | 156 do_klass(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre_JSR292 ) \ |
157 template(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre_JSR292) \ | 157 do_klass(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre_JSR292 ) \ |
158 /* Note: MethodHandle must be first, and VolatileCallSite last in group */ \ | 158 do_klass(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre_JSR292 ) \ |
159 \ | 159 /* Note: MethodHandle must be first, and VolatileCallSite last in group */ \ |
160 template(StringBuffer_klass, java_lang_StringBuffer, Pre) \ | 160 \ |
161 template(StringBuilder_klass, java_lang_StringBuilder, Pre) \ | 161 do_klass(StringBuffer_klass, java_lang_StringBuffer, Pre ) \ |
162 \ | 162 do_klass(StringBuilder_klass, java_lang_StringBuilder, Pre ) \ |
163 /* It's NULL in non-1.4 JDKs. */ \ | 163 \ |
164 template(StackTraceElement_klass, java_lang_StackTraceElement, Opt) \ | 164 /* It's NULL in non-1.4 JDKs. */ \ |
165 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ | 165 do_klass(StackTraceElement_klass, java_lang_StackTraceElement, Opt ) \ |
166 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ | 166 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ |
167 template(nio_Buffer_klass, java_nio_Buffer, Opt) \ | 167 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ |
168 \ | 168 do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \ |
169 template(DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel) \ | 169 \ |
170 \ | 170 do_klass(DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel ) \ |
171 template(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt) \ | 171 \ |
172 \ | 172 do_klass(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt ) \ |
173 /* Preload boxing klasses */ \ | 173 \ |
174 template(Boolean_klass, java_lang_Boolean, Pre) \ | 174 /* Preload boxing klasses */ \ |
175 template(Character_klass, java_lang_Character, Pre) \ | 175 do_klass(Boolean_klass, java_lang_Boolean, Pre ) \ |
176 template(Float_klass, java_lang_Float, Pre) \ | 176 do_klass(Character_klass, java_lang_Character, Pre ) \ |
177 template(Double_klass, java_lang_Double, Pre) \ | 177 do_klass(Float_klass, java_lang_Float, Pre ) \ |
178 template(Byte_klass, java_lang_Byte, Pre) \ | 178 do_klass(Double_klass, java_lang_Double, Pre ) \ |
179 template(Short_klass, java_lang_Short, Pre) \ | 179 do_klass(Byte_klass, java_lang_Byte, Pre ) \ |
180 template(Integer_klass, java_lang_Integer, Pre) \ | 180 do_klass(Short_klass, java_lang_Short, Pre ) \ |
181 template(Long_klass, java_lang_Long, Pre) \ | 181 do_klass(Integer_klass, java_lang_Integer, Pre ) \ |
182 \ | 182 do_klass(Long_klass, java_lang_Long, Pre ) \ |
183 /* Support for Graal */ \ | 183 \ |
184 template(GraalBitMap_klass, java_util_BitSet, Opt) \ | 184 /* Support for Graal */ \ |
185 /* graal.hotspot */ \ | 185 do_klass(GraalBitMap_klass, java_util_BitSet, Opt) \ |
186 template(HotSpotKlassOop_klass, com_oracle_graal_hotspot_HotSpotKlassOop, Opt) \ | 186 /* graal.hotspot */ \ |
187 template(HotSpotCompilationResult_klass, com_oracle_graal_hotspot_HotSpotCompilationResult, Opt) \ | 187 do_klass(HotSpotKlassOop_klass, com_oracle_graal_hotspot_HotSpotKlassOop, Opt) \ |
188 template(HotSpotCodeInfo_klass, com_oracle_graal_hotspot_meta_HotSpotCodeInfo, Opt) \ | 188 do_klass(HotSpotCompilationResult_klass, com_oracle_graal_hotspot_HotSpotCompilationResult, Opt) \ |
189 template(HotSpotCompiledMethod_klass, com_oracle_graal_hotspot_meta_HotSpotCompiledMethod, Opt) \ | 189 do_klass(HotSpotCodeInfo_klass, com_oracle_graal_hotspot_meta_HotSpotCodeInfo, Opt) \ |
190 template(HotSpotJavaType_klass, com_oracle_graal_hotspot_meta_HotSpotJavaType, Opt) \ | 190 do_klass(HotSpotInstalledCode_klass, com_oracle_graal_hotspot_meta_HotSpotInstalledCode, Opt) \ |
191 template(HotSpotMethodData_klass, com_oracle_graal_hotspot_meta_HotSpotMethodData, Opt) \ | 191 do_klass(HotSpotJavaType_klass, com_oracle_graal_hotspot_meta_HotSpotJavaType, Opt) \ |
192 template(HotSpotResolvedJavaField_klass, com_oracle_graal_hotspot_meta_HotSpotResolvedJavaField, Opt) \ | 192 do_klass(HotSpotMethodData_klass, com_oracle_graal_hotspot_meta_HotSpotMethodData, Opt) \ |
193 template(HotSpotResolvedJavaMethod_klass, com_oracle_graal_hotspot_meta_HotSpotResolvedJavaMethod, Opt) \ | 193 do_klass(HotSpotResolvedJavaField_klass, com_oracle_graal_hotspot_meta_HotSpotResolvedJavaField, Opt) \ |
194 template(HotSpotResolvedJavaType_klass, com_oracle_graal_hotspot_meta_HotSpotResolvedJavaType, Opt) \ | 194 do_klass(HotSpotResolvedJavaMethod_klass, com_oracle_graal_hotspot_meta_HotSpotResolvedJavaMethod, Opt) \ |
195 /* graal.api.code */ \ | 195 do_klass(HotSpotResolvedJavaType_klass, com_oracle_graal_hotspot_meta_HotSpotResolvedJavaType, Opt) \ |
196 template(Assumptions_klass, com_oracle_graal_api_code_Assumptions, Opt) \ | 196 /* graal.api.code */ \ |
197 template(Assumptions_ConcreteMethod_klass, com_oracle_graal_api_code_Assumptions_ConcreteMethod, Opt) \ | 197 do_klass(Assumptions_klass, com_oracle_graal_api_code_Assumptions, Opt) \ |
198 template(Assumptions_ConcreteSubtype_klass, com_oracle_graal_api_code_Assumptions_ConcreteSubtype, Opt) \ | 198 do_klass(Assumptions_ConcreteMethod_klass, com_oracle_graal_api_code_Assumptions_ConcreteMethod, Opt) \ |
199 template(Assumptions_MethodContents_klass, com_oracle_graal_api_code_Assumptions_MethodContents, Opt) \ | 199 do_klass(Assumptions_ConcreteSubtype_klass, com_oracle_graal_api_code_Assumptions_ConcreteSubtype, Opt) \ |
200 template(BytecodePosition_klass, com_oracle_graal_api_code_BytecodePosition, Opt) \ | 200 do_klass(Assumptions_MethodContents_klass, com_oracle_graal_api_code_Assumptions_MethodContents, Opt) \ |
201 template(DebugInfo_klass, com_oracle_graal_api_code_DebugInfo, Opt) \ | 201 do_klass(BytecodePosition_klass, com_oracle_graal_api_code_BytecodePosition, Opt) \ |
202 template(BytecodeFrame_klass, com_oracle_graal_api_code_BytecodeFrame, Opt) \ | 202 do_klass(DebugInfo_klass, com_oracle_graal_api_code_DebugInfo, Opt) \ |
203 template(CompilationResult_klass, com_oracle_graal_api_code_CompilationResult, Opt) \ | 203 do_klass(BytecodeFrame_klass, com_oracle_graal_api_code_BytecodeFrame, Opt) \ |
204 template(CompilationResult_Call_klass, com_oracle_graal_api_code_CompilationResult_Call, Opt) \ | 204 do_klass(CompilationResult_klass, com_oracle_graal_api_code_CompilationResult, Opt) \ |
205 template(CompilationResult_DataPatch_klass, com_oracle_graal_api_code_CompilationResult_DataPatch, Opt) \ | 205 do_klass(CompilationResult_Call_klass, com_oracle_graal_api_code_CompilationResult_Call, Opt) \ |
206 template(CompilationResult_ExceptionHandler_klass, com_oracle_graal_api_code_CompilationResult_ExceptionHandler, Opt) \ | 206 do_klass(CompilationResult_DataPatch_klass, com_oracle_graal_api_code_CompilationResult_DataPatch, Opt) \ |
207 template(CompilationResult_Mark_klass, com_oracle_graal_api_code_CompilationResult_Mark, Opt) \ | 207 do_klass(CompilationResult_ExceptionHandler_klass, com_oracle_graal_api_code_CompilationResult_ExceptionHandler, Opt) \ |
208 template(CompilationResult_Safepoint_klass, com_oracle_graal_api_code_CompilationResult_Safepoint, Opt) \ | 208 do_klass(CompilationResult_Mark_klass, com_oracle_graal_api_code_CompilationResult_Mark, Opt) \ |
209 template(CompilationResult_Site_klass, com_oracle_graal_api_code_CompilationResult_Site, Opt) \ | 209 do_klass(CompilationResult_Safepoint_klass, com_oracle_graal_api_code_CompilationResult_Safepoint, Opt) \ |
210 template(code_MonitorValue_klass, com_oracle_graal_api_code_MonitorValue, Opt) \ | 210 do_klass(CompilationResult_Site_klass, com_oracle_graal_api_code_CompilationResult_Site, Opt) \ |
211 template(code_Register_klass, com_oracle_graal_api_code_Register, Opt) \ | 211 do_klass(code_MonitorValue_klass, com_oracle_graal_api_code_MonitorValue, Opt) \ |
212 template(RegisterValue_klass, com_oracle_graal_api_code_RegisterValue, Opt) \ | 212 do_klass(code_Register_klass, com_oracle_graal_api_code_Register, Opt) \ |
213 template(StackSlot_klass, com_oracle_graal_api_code_StackSlot, Opt) \ | 213 do_klass(RegisterValue_klass, com_oracle_graal_api_code_RegisterValue, Opt) \ |
214 template(VirtualObject_klass, com_oracle_graal_api_code_VirtualObject, Opt) \ | 214 do_klass(StackSlot_klass, com_oracle_graal_api_code_StackSlot, Opt) \ |
215 /* graal.api.meta */ \ | 215 do_klass(VirtualObject_klass, com_oracle_graal_api_code_VirtualObject, Opt) \ |
216 template(Constant_klass, com_oracle_graal_api_meta_Constant, Opt) \ | 216 /* graal.api.meta */ \ |
217 template(ExceptionHandler_klass, com_oracle_graal_api_meta_ExceptionHandler, Opt) \ | 217 do_klass(Constant_klass, com_oracle_graal_api_meta_Constant, Opt) \ |
218 template(Kind_klass, com_oracle_graal_api_meta_Kind, Opt) \ | 218 do_klass(ExceptionHandler_klass, com_oracle_graal_api_meta_ExceptionHandler, Opt) \ |
219 template(JavaMethod_klass, com_oracle_graal_api_meta_JavaMethod, Opt) \ | 219 do_klass(Kind_klass, com_oracle_graal_api_meta_Kind, Opt) \ |
220 template(JavaType_klass, com_oracle_graal_api_meta_JavaType, Opt) \ | 220 do_klass(JavaMethod_klass, com_oracle_graal_api_meta_JavaMethod, Opt) \ |
221 template(ResolvedJavaField_klass, com_oracle_graal_api_meta_ResolvedJavaField, Opt) \ | 221 do_klass(JavaType_klass, com_oracle_graal_api_meta_JavaType, Opt) \ |
222 template(Value_klass, com_oracle_graal_api_meta_Value, Opt) \ | 222 do_klass(Value_klass, com_oracle_graal_api_meta_Value, Opt) \ |
223 | |
223 /*end*/ | 224 /*end*/ |
224 | 225 |
225 | 226 |
226 class SystemDictionary : AllStatic { | 227 class SystemDictionary : AllStatic { |
227 friend class VMStructs; | 228 friend class VMStructs; |
228 friend class CompactingPermGenGen; | |
229 friend class SystemDictionaryHandles; | 229 friend class SystemDictionaryHandles; |
230 NOT_PRODUCT(friend class instanceKlassKlass;) | |
231 | 230 |
232 public: | 231 public: |
233 enum WKID { | 232 enum WKID { |
234 NO_WKID = 0, | 233 NO_WKID = 0, |
235 | 234 |
262 // class if needed. If not found a NoClassDefFoundError or a | 261 // class if needed. If not found a NoClassDefFoundError or a |
263 // ClassNotFoundException is thrown, depending on the value on the | 262 // ClassNotFoundException is thrown, depending on the value on the |
264 // throw_error flag. For most uses the throw_error argument should be set | 263 // throw_error flag. For most uses the throw_error argument should be set |
265 // to true. | 264 // to true. |
266 | 265 |
267 static klassOop resolve_or_fail(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, TRAPS); | 266 static Klass* resolve_or_fail(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, TRAPS); |
268 // Convenient call for null loader and protection domain. | 267 // Convenient call for null loader and protection domain. |
269 static klassOop resolve_or_fail(Symbol* class_name, bool throw_error, TRAPS); | 268 static Klass* resolve_or_fail(Symbol* class_name, bool throw_error, TRAPS); |
270 private: | 269 private: |
271 // handle error translation for resolve_or_null results | 270 // handle error translation for resolve_or_null results |
272 static klassOop handle_resolution_exception(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, KlassHandle klass_h, TRAPS); | 271 static Klass* handle_resolution_exception(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, KlassHandle klass_h, TRAPS); |
273 | 272 |
274 public: | 273 public: |
275 | 274 |
276 // Returns a class with a given class name and class loader. | 275 // Returns a class with a given class name and class loader. |
277 // Loads the class if needed. If not found NULL is returned. | 276 // Loads the class if needed. If not found NULL is returned. |
278 static klassOop resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS); | 277 static Klass* resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS); |
279 // Version with null loader and protection domain | 278 // Version with null loader and protection domain |
280 static klassOop resolve_or_null(Symbol* class_name, TRAPS); | 279 static Klass* resolve_or_null(Symbol* class_name, TRAPS); |
281 | 280 |
282 // Resolve a superclass or superinterface. Called from ClassFileParser, | 281 // Resolve a superclass or superinterface. Called from ClassFileParser, |
283 // parse_interfaces, resolve_instance_class_or_null, load_shared_class | 282 // parse_interfaces, resolve_instance_class_or_null, load_shared_class |
284 // "child_name" is the class whose super class or interface is being resolved. | 283 // "child_name" is the class whose super class or interface is being resolved. |
285 static klassOop resolve_super_or_fail(Symbol* child_name, | 284 static Klass* resolve_super_or_fail(Symbol* child_name, |
286 Symbol* class_name, | 285 Symbol* class_name, |
287 Handle class_loader, | 286 Handle class_loader, |
288 Handle protection_domain, | 287 Handle protection_domain, |
289 bool is_superclass, | 288 bool is_superclass, |
290 TRAPS); | 289 TRAPS); |
291 | 290 |
292 // Parse new stream. This won't update the system dictionary or | 291 // Parse new stream. This won't update the system dictionary or |
293 // class hierarchy, simply parse the stream. Used by JVMTI RedefineClasses. | 292 // class hierarchy, simply parse the stream. Used by JVMTI RedefineClasses. |
294 static klassOop parse_stream(Symbol* class_name, | 293 static Klass* parse_stream(Symbol* class_name, |
295 Handle class_loader, | 294 Handle class_loader, |
296 Handle protection_domain, | 295 Handle protection_domain, |
297 ClassFileStream* st, | 296 ClassFileStream* st, |
298 TRAPS) { | 297 TRAPS) { |
299 KlassHandle nullHandle; | 298 KlassHandle nullHandle; |
300 return parse_stream(class_name, class_loader, protection_domain, st, nullHandle, NULL, THREAD); | 299 return parse_stream(class_name, class_loader, protection_domain, st, nullHandle, NULL, THREAD); |
301 } | 300 } |
302 static klassOop parse_stream(Symbol* class_name, | 301 static Klass* parse_stream(Symbol* class_name, |
303 Handle class_loader, | 302 Handle class_loader, |
304 Handle protection_domain, | 303 Handle protection_domain, |
305 ClassFileStream* st, | 304 ClassFileStream* st, |
306 KlassHandle host_klass, | 305 KlassHandle host_klass, |
307 GrowableArray<Handle>* cp_patches, | 306 GrowableArray<Handle>* cp_patches, |
308 TRAPS); | 307 TRAPS); |
309 | 308 |
310 // Resolve from stream (called by jni_DefineClass and JVM_DefineClass) | 309 // Resolve from stream (called by jni_DefineClass and JVM_DefineClass) |
311 static klassOop resolve_from_stream(Symbol* class_name, Handle class_loader, | 310 static Klass* resolve_from_stream(Symbol* class_name, Handle class_loader, |
312 Handle protection_domain, | 311 Handle protection_domain, |
313 ClassFileStream* st, bool verify, TRAPS); | 312 ClassFileStream* st, bool verify, TRAPS); |
314 | 313 |
315 // Lookup an already loaded class. If not found NULL is returned. | 314 // Lookup an already loaded class. If not found NULL is returned. |
316 static klassOop find(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS); | 315 static Klass* find(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS); |
317 | 316 |
318 // Lookup an already loaded instance or array class. | 317 // Lookup an already loaded instance or array class. |
319 // Do not make any queries to class loaders; consult only the cache. | 318 // Do not make any queries to class loaders; consult only the cache. |
320 // If not found NULL is returned. | 319 // If not found NULL is returned. |
321 static klassOop find_instance_or_array_klass(Symbol* class_name, | 320 static Klass* find_instance_or_array_klass(Symbol* class_name, |
322 Handle class_loader, | 321 Handle class_loader, |
323 Handle protection_domain, | 322 Handle protection_domain, |
324 TRAPS); | 323 TRAPS); |
325 | |
326 // If the given name is known to vmSymbols, return the well-know klass: | |
327 static klassOop find_well_known_klass(Symbol* class_name); | |
328 | 324 |
329 // Lookup an instance or array class that has already been loaded | 325 // Lookup an instance or array class that has already been loaded |
330 // either into the given class loader, or else into another class | 326 // either into the given class loader, or else into another class |
331 // loader that is constrained (via loader constraints) to produce | 327 // loader that is constrained (via loader constraints) to produce |
332 // a consistent class. Do not take protection domains into account. | 328 // a consistent class. Do not take protection domains into account. |
345 // 4. Loading was attempted, but there was a linkage error of some sort. | 341 // 4. Loading was attempted, but there was a linkage error of some sort. |
346 // In all of these cases, the loader constraints on this type are | 342 // In all of these cases, the loader constraints on this type are |
347 // satisfied, and it is safe for classes in the given class loader | 343 // satisfied, and it is safe for classes in the given class loader |
348 // to manipulate strongly-typed values of the found class, subject | 344 // to manipulate strongly-typed values of the found class, subject |
349 // to local linkage and access checks. | 345 // to local linkage and access checks. |
350 static klassOop find_constrained_instance_or_array_klass(Symbol* class_name, | 346 static Klass* find_constrained_instance_or_array_klass(Symbol* class_name, |
351 Handle class_loader, | 347 Handle class_loader, |
352 TRAPS); | 348 TRAPS); |
353 | 349 |
354 // Iterate over all klasses in dictionary | 350 // Iterate over all klasses in dictionary |
355 // Just the classes from defining class loaders | 351 // Just the classes from defining class loaders |
356 static void classes_do(void f(klassOop)); | 352 static void classes_do(void f(Klass*)); |
357 // Added for initialize_itable_for_klass to handle exceptions | 353 // Added for initialize_itable_for_klass to handle exceptions |
358 static void classes_do(void f(klassOop, TRAPS), TRAPS); | 354 static void classes_do(void f(Klass*, TRAPS), TRAPS); |
359 // All classes, and their class loaders | 355 // All classes, and their class loaders |
360 static void classes_do(void f(klassOop, oop)); | 356 static void classes_do(void f(Klass*, ClassLoaderData*)); |
361 // All classes, and their class loaders | 357 // All classes, and their class loaders |
362 // (added for helpers that use HandleMarks and ResourceMarks) | 358 // (added for helpers that use HandleMarks and ResourceMarks) |
363 static void classes_do(void f(klassOop, oop, TRAPS), TRAPS); | 359 static void classes_do(void f(Klass*, ClassLoaderData*, TRAPS), TRAPS); |
364 // All entries in the placeholder table and their class loaders | 360 // All entries in the placeholder table and their class loaders |
365 static void placeholders_do(void f(Symbol*, oop)); | 361 static void placeholders_do(void f(Symbol*)); |
366 | 362 |
367 // Iterate over all methods in all klasses in dictionary | 363 // Iterate over all methods in all klasses in dictionary |
368 static void methods_do(void f(methodOop)); | 364 static void methods_do(void f(Method*)); |
369 | 365 |
370 // Garbage collection support | 366 // Garbage collection support |
371 | 367 |
372 // This method applies "blk->do_oop" to all the pointers to "system" | 368 // This method applies "blk->do_oop" to all the pointers to "system" |
373 // classes and loaders. | 369 // classes and loaders. |
374 static void always_strong_oops_do(OopClosure* blk); | 370 static void always_strong_oops_do(OopClosure* blk); |
375 static void always_strong_classes_do(OopClosure* blk); | 371 static void always_strong_classes_do(KlassClosure* closure); |
376 // This method applies "blk->do_oop" to all the placeholders. | |
377 static void placeholders_do(OopClosure* blk); | |
378 | 372 |
379 // Unload (that is, break root links to) all unmarked classes and | 373 // Unload (that is, break root links to) all unmarked classes and |
380 // loaders. Returns "true" iff something was unloaded. | 374 // loaders. Returns "true" iff something was unloaded. |
381 static bool do_unloading(BoolObjectClosure* is_alive); | 375 static bool do_unloading(BoolObjectClosure* is_alive); |
382 | 376 |
387 | 381 |
388 // System loader lock | 382 // System loader lock |
389 static oop system_loader_lock() { return _system_loader_lock_obj; } | 383 static oop system_loader_lock() { return _system_loader_lock_obj; } |
390 | 384 |
391 private: | 385 private: |
392 // Traverses preloaded oops: various system classes. These are | 386 // Extended Redefine classes support (tbi) |
393 // guaranteed to be in the perm gen. | 387 static void preloaded_classes_do(KlassClosure* f); |
394 static void preloaded_oops_do(OopClosure* f); | 388 static void lazily_loaded_classes_do(KlassClosure* f); |
395 static void lazily_loaded_oops_do(OopClosure* f); | |
396 | |
397 public: | 389 public: |
398 // Sharing support. | 390 // Sharing support. |
399 static void reorder_dictionary(); | 391 static void reorder_dictionary(); |
400 static void copy_buckets(char** top, char* end); | 392 static void copy_buckets(char** top, char* end); |
401 static void copy_table(char** top, char* end); | 393 static void copy_table(char** top, char* end); |
425 #ifdef ASSERT | 417 #ifdef ASSERT |
426 static bool is_internal_format(Symbol* class_name); | 418 static bool is_internal_format(Symbol* class_name); |
427 #endif | 419 #endif |
428 | 420 |
429 // Verify class is in dictionary | 421 // Verify class is in dictionary |
430 static void verify_obj_klass_present(Handle obj, | 422 static void verify_obj_klass_present(Symbol* class_name, |
431 Symbol* class_name, | 423 ClassLoaderData* loader_data); |
432 Handle class_loader); | |
433 | 424 |
434 // Initialization | 425 // Initialization |
435 static void initialize(TRAPS); | 426 static void initialize(TRAPS); |
436 | 427 |
437 // Fast access to commonly used classes (preloaded) | 428 // Fast access to commonly used classes (preloaded) |
438 static klassOop check_klass(klassOop k) { | 429 static Klass* check_klass(Klass* k) { |
439 assert(k != NULL, "preloaded klass not initialized"); | 430 assert(k != NULL, "preloaded klass not initialized"); |
440 return k; | 431 return k; |
441 } | 432 } |
442 | 433 |
443 static klassOop check_klass_Pre(klassOop k) { return check_klass(k); } | 434 static Klass* check_klass_Pre( Klass* k) { return check_klass(k); } |
444 static klassOop check_klass_Pre_JSR292(klassOop k) { return EnableInvokeDynamic ? check_klass(k) : k; } | 435 static Klass* check_klass_Pre_JSR292(Klass* k) { return EnableInvokeDynamic ? check_klass(k) : k; } |
445 static klassOop check_klass_Opt(klassOop k) { return k; } | 436 static Klass* check_klass_Opt( Klass* k) { return k; } |
446 static klassOop check_klass_Opt_Kernel(klassOop k) { return k; } //== Opt | 437 static Klass* check_klass_Opt_Kernel(Klass* k) { return k; } //== Opt |
447 static klassOop check_klass_Opt_Only_JDK15(klassOop k) { | 438 static Klass* check_klass_Opt_Only_JDK15(Klass* k) { |
448 assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only"); | 439 assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only"); |
449 return k; | 440 return k; |
450 } | 441 } |
451 static klassOop check_klass_Opt_Only_JDK14NewRef(klassOop k) { | 442 static Klass* check_klass_Opt_Only_JDK14NewRef(Klass* k) { |
452 assert(JDK_Version::is_gte_jdk14x_version() && UseNewReflection, "JDK 1.4 only"); | 443 assert(JDK_Version::is_gte_jdk14x_version() && UseNewReflection, "JDK 1.4 only"); |
453 // despite the optional loading, if you use this it must be present: | 444 // despite the optional loading, if you use this it must be present: |
454 return check_klass(k); | 445 return check_klass(k); |
455 } | 446 } |
456 | 447 |
461 initialize_wk_klasses_until((WKID) limit, start_id, THREAD); | 452 initialize_wk_klasses_until((WKID) limit, start_id, THREAD); |
462 } | 453 } |
463 | 454 |
464 public: | 455 public: |
465 #define WK_KLASS_DECLARE(name, symbol, option) \ | 456 #define WK_KLASS_DECLARE(name, symbol, option) \ |
466 static klassOop name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } | 457 static Klass* name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } \ |
458 static Klass** name##_addr() { \ | |
459 return &SystemDictionary::_well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)]; \ | |
460 } | |
467 WK_KLASSES_DO(WK_KLASS_DECLARE); | 461 WK_KLASSES_DO(WK_KLASS_DECLARE); |
468 #undef WK_KLASS_DECLARE | 462 #undef WK_KLASS_DECLARE |
469 | 463 |
470 static klassOop well_known_klass(WKID id) { | 464 static Klass* well_known_klass(WKID id) { |
471 assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob"); | 465 assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob"); |
472 return _well_known_klasses[id]; | 466 return _well_known_klasses[id]; |
473 } | 467 } |
474 | 468 |
469 static Klass** well_known_klass_addr(WKID id) { | |
470 assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob"); | |
471 return &_well_known_klasses[id]; | |
472 } | |
473 | |
475 // Local definition for direct access to the private array: | 474 // Local definition for direct access to the private array: |
476 #define WK_KLASS(name) _well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)] | 475 #define WK_KLASS(name) _well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)] |
477 | 476 |
478 static klassOop box_klass(BasicType t) { | 477 static Klass* box_klass(BasicType t) { |
479 assert((uint)t < T_VOID+1, "range check"); | 478 assert((uint)t < T_VOID+1, "range check"); |
480 return check_klass(_box_klasses[t]); | 479 return check_klass(_box_klasses[t]); |
481 } | 480 } |
482 static BasicType box_klass_type(klassOop k); // inverse of box_klass | 481 static BasicType box_klass_type(Klass* k); // inverse of box_klass |
483 | 482 |
484 // methods returning lazily loaded klasses | 483 // methods returning lazily loaded klasses |
485 // The corresponding method to load the class must be called before calling them. | 484 // The corresponding method to load the class must be called before calling them. |
486 static klassOop abstract_ownable_synchronizer_klass() { return check_klass(_abstract_ownable_synchronizer_klass); } | 485 static Klass* abstract_ownable_synchronizer_klass() { return check_klass(_abstract_ownable_synchronizer_klass); } |
487 | 486 |
488 static void load_abstract_ownable_synchronizer_klass(TRAPS); | 487 static void load_abstract_ownable_synchronizer_klass(TRAPS); |
489 | 488 |
490 private: | 489 private: |
491 // Tells whether ClassLoader.loadClassInternal is present | 490 // Tells whether ClassLoader.loadClassInternal is present |
492 static bool has_loadClassInternal() { return _has_loadClassInternal; } | 491 static bool has_loadClassInternal() { return _has_loadClassInternal; } |
493 | 492 |
493 // Returns the class loader data to be used when looking up/updating the | |
494 // system dictionary. | |
495 static ClassLoaderData *class_loader_data(Handle class_loader) { | |
496 return ClassLoaderData::class_loader_data(class_loader()); | |
497 } | |
498 | |
494 public: | 499 public: |
495 // Tells whether ClassLoader.checkPackageAccess is present | 500 // Tells whether ClassLoader.checkPackageAccess is present |
496 static bool has_checkPackageAccess() { return _has_checkPackageAccess; } | 501 static bool has_checkPackageAccess() { return _has_checkPackageAccess; } |
497 | 502 |
498 static bool Class_klass_loaded() { return WK_KLASS(Class_klass) != NULL; } | 503 static bool Class_klass_loaded() { return WK_KLASS(Class_klass) != NULL; } |
499 static bool Cloneable_klass_loaded() { return WK_KLASS(Cloneable_klass) != NULL; } | 504 static bool Cloneable_klass_loaded() { return WK_KLASS(Cloneable_klass) != NULL; } |
505 static bool Object_klass_loaded() { return WK_KLASS(Object_klass) != NULL; } | |
506 static bool ClassLoader_klass_loaded() { return WK_KLASS(ClassLoader_klass) != NULL; } | |
500 | 507 |
501 // Returns default system loader | 508 // Returns default system loader |
502 static oop java_system_loader(); | 509 static oop java_system_loader(); |
503 | 510 |
504 // Compute the default system loader | 511 // Compute the default system loader |
505 static void compute_java_system_loader(TRAPS); | 512 static void compute_java_system_loader(TRAPS); |
506 | 513 |
514 // Register a new class loader | |
515 static ClassLoaderData* register_loader(Handle class_loader); | |
507 private: | 516 private: |
508 // Mirrors for primitive classes (created eagerly) | 517 // Mirrors for primitive classes (created eagerly) |
509 static oop check_mirror(oop m) { | 518 static oop check_mirror(oop m) { |
510 assert(m != NULL, "mirror not initialized"); | 519 assert(m != NULL, "mirror not initialized"); |
511 return m; | 520 return m; |
525 // (asks Java to compute it if necessary, except in a compiler thread) | 534 // (asks Java to compute it if necessary, except in a compiler thread) |
526 static methodHandle find_method_handle_invoker(Symbol* name, | 535 static methodHandle find_method_handle_invoker(Symbol* name, |
527 Symbol* signature, | 536 Symbol* signature, |
528 KlassHandle accessing_klass, | 537 KlassHandle accessing_klass, |
529 Handle *appendix_result, | 538 Handle *appendix_result, |
539 Handle *method_type_result, | |
530 TRAPS); | 540 TRAPS); |
531 // for a given signature, find the internal MethodHandle method (linkTo* or invokeBasic) | 541 // for a given signature, find the internal MethodHandle method (linkTo* or invokeBasic) |
532 // (does not ask Java, since this is a low-level intrinsic defined by the JVM) | 542 // (does not ask Java, since this is a low-level intrinsic defined by the JVM) |
533 static methodHandle find_method_handle_intrinsic(vmIntrinsics::ID iid, | 543 static methodHandle find_method_handle_intrinsic(vmIntrinsics::ID iid, |
534 Symbol* signature, | 544 Symbol* signature, |
551 static methodHandle find_dynamic_call_site_invoker(KlassHandle caller, | 561 static methodHandle find_dynamic_call_site_invoker(KlassHandle caller, |
552 Handle bootstrap_method, | 562 Handle bootstrap_method, |
553 Symbol* name, | 563 Symbol* name, |
554 Symbol* type, | 564 Symbol* type, |
555 Handle *appendix_result, | 565 Handle *appendix_result, |
566 Handle *method_type_result, | |
556 TRAPS); | 567 TRAPS); |
557 | 568 |
558 // Utility for printing loader "name" as part of tracing constraints | 569 // Utility for printing loader "name" as part of tracing constraints |
559 static const char* loader_name(oop loader) { | 570 static const char* loader_name(oop loader) { |
560 return ((loader) == NULL ? "<bootloader>" : | 571 return ((loader) == NULL ? "<bootloader>" : |
561 instanceKlass::cast((loader)->klass())->name()->as_C_string() ); | 572 InstanceKlass::cast((loader)->klass())->name()->as_C_string() ); |
573 } | |
574 static const char* loader_name(ClassLoaderData* loader_data) { | |
575 return (loader_data->is_the_null_class_loader_data() ? "<bootloader>" : | |
576 InstanceKlass::cast((loader_data->class_loader())->klass())->name()->as_C_string() ); | |
562 } | 577 } |
563 | 578 |
564 // Record the error when the first attempt to resolve a reference from a constant | 579 // Record the error when the first attempt to resolve a reference from a constant |
565 // pool entry to a class fails. | 580 // pool entry to a class fails. |
566 static void add_resolution_error(constantPoolHandle pool, int which, Symbol* error); | 581 static void add_resolution_error(constantPoolHandle pool, int which, Symbol* error); |
582 static void delete_resolution_error(ConstantPool* pool); | |
567 static Symbol* find_resolution_error(constantPoolHandle pool, int which); | 583 static Symbol* find_resolution_error(constantPoolHandle pool, int which); |
568 | 584 |
569 private: | 585 private: |
570 | 586 |
571 enum Constants { | 587 enum Constants { |
613 static SymbolPropertyTable* _invoke_method_table; | 629 static SymbolPropertyTable* _invoke_method_table; |
614 | 630 |
615 public: | 631 public: |
616 // for VM_CounterDecay iteration support | 632 // for VM_CounterDecay iteration support |
617 friend class CounterDecay; | 633 friend class CounterDecay; |
618 static klassOop try_get_next_class(); | 634 static Klass* try_get_next_class(); |
619 | 635 |
620 private: | 636 private: |
621 static void validate_protection_domain(instanceKlassHandle klass, | 637 static void validate_protection_domain(instanceKlassHandle klass, |
622 Handle class_loader, | 638 Handle class_loader, |
623 Handle protection_domain, TRAPS); | 639 Handle protection_domain, TRAPS); |
630 static LoaderConstraintTable* constraints() { return _loader_constraints; } | 646 static LoaderConstraintTable* constraints() { return _loader_constraints; } |
631 static ResolutionErrorTable* resolution_errors() { return _resolution_errors; } | 647 static ResolutionErrorTable* resolution_errors() { return _resolution_errors; } |
632 static SymbolPropertyTable* invoke_method_table() { return _invoke_method_table; } | 648 static SymbolPropertyTable* invoke_method_table() { return _invoke_method_table; } |
633 | 649 |
634 // Basic loading operations | 650 // Basic loading operations |
635 static klassOop resolve_instance_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS); | 651 static Klass* resolve_instance_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS); |
636 static klassOop resolve_array_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS); | 652 static Klass* resolve_array_class_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS); |
637 static instanceKlassHandle handle_parallel_super_load(Symbol* class_name, Symbol* supername, Handle class_loader, Handle protection_domain, Handle lockObject, TRAPS); | 653 static instanceKlassHandle handle_parallel_super_load(Symbol* class_name, Symbol* supername, Handle class_loader, Handle protection_domain, Handle lockObject, TRAPS); |
638 // Wait on SystemDictionary_lock; unlocks lockObject before | 654 // Wait on SystemDictionary_lock; unlocks lockObject before |
639 // waiting; relocks lockObject with correct recursion count | 655 // waiting; relocks lockObject with correct recursion count |
640 // after waiting, but before reentering SystemDictionary_lock | 656 // after waiting, but before reentering SystemDictionary_lock |
641 // to preserve lock order semantics. | 657 // to preserve lock order semantics. |
652 static Handle compute_loader_lock_object(Handle class_loader, TRAPS); | 668 static Handle compute_loader_lock_object(Handle class_loader, TRAPS); |
653 static void check_loader_lock_contention(Handle loader_lock, TRAPS); | 669 static void check_loader_lock_contention(Handle loader_lock, TRAPS); |
654 static bool is_parallelCapable(Handle class_loader); | 670 static bool is_parallelCapable(Handle class_loader); |
655 static bool is_parallelDefine(Handle class_loader); | 671 static bool is_parallelDefine(Handle class_loader); |
656 | 672 |
657 static klassOop find_shared_class(Symbol* class_name); | 673 static Klass* find_shared_class(Symbol* class_name); |
658 | 674 |
659 // Setup link to hierarchy | 675 // Setup link to hierarchy |
660 static void add_to_hierarchy(instanceKlassHandle k, TRAPS); | 676 static void add_to_hierarchy(instanceKlassHandle k, TRAPS); |
661 | 677 |
662 private: | 678 private: |
663 // We pass in the hashtable index so we can calculate it outside of | 679 // We pass in the hashtable index so we can calculate it outside of |
664 // the SystemDictionary_lock. | 680 // the SystemDictionary_lock. |
665 | 681 |
666 // Basic find on loaded classes | 682 // Basic find on loaded classes |
667 static klassOop find_class(int index, unsigned int hash, | 683 static Klass* find_class(int index, unsigned int hash, |
668 Symbol* name, Handle loader); | 684 Symbol* name, ClassLoaderData* loader_data); |
669 static klassOop find_class(Symbol* class_name, Handle class_loader); | 685 static Klass* find_class(Symbol* class_name, ClassLoaderData* loader_data); |
670 | 686 |
671 // Basic find on classes in the midst of being loaded | 687 // Basic find on classes in the midst of being loaded |
672 static Symbol* find_placeholder(Symbol* name, Handle loader); | 688 static Symbol* find_placeholder(Symbol* name, ClassLoaderData* loader_data); |
673 | 689 |
674 // Updating entry in dictionary | 690 // Updating entry in dictionary |
675 // Add a completely loaded class | 691 // Add a completely loaded class |
676 static void add_klass(int index, Symbol* class_name, | 692 static void add_klass(int index, Symbol* class_name, |
677 Handle class_loader, KlassHandle obj); | 693 ClassLoaderData* loader_data, KlassHandle obj); |
678 | 694 |
679 // Add a placeholder for a class being loaded | 695 // Add a placeholder for a class being loaded |
680 static void add_placeholder(int index, | 696 static void add_placeholder(int index, |
681 Symbol* class_name, | 697 Symbol* class_name, |
682 Handle class_loader); | 698 ClassLoaderData* loader_data); |
683 static void remove_placeholder(int index, | 699 static void remove_placeholder(int index, |
684 Symbol* class_name, | 700 Symbol* class_name, |
685 Handle class_loader); | 701 ClassLoaderData* loader_data); |
686 | 702 |
687 // Performs cleanups after resolve_super_or_fail. This typically needs | 703 // Performs cleanups after resolve_super_or_fail. This typically needs |
688 // to be called on failure. | 704 // to be called on failure. |
689 // Won't throw, but can block. | 705 // Won't throw, but can block. |
690 static void resolution_cleanups(Symbol* class_name, | 706 static void resolution_cleanups(Symbol* class_name, |
691 Handle class_loader, | 707 ClassLoaderData* loader_data, |
692 TRAPS); | 708 TRAPS); |
693 | 709 |
694 // Initialization | 710 // Initialization |
695 static void initialize_preloaded_classes(TRAPS); | 711 static void initialize_preloaded_classes(TRAPS); |
696 | 712 |
698 static void check_constraints(int index, unsigned int hash, | 714 static void check_constraints(int index, unsigned int hash, |
699 instanceKlassHandle k, Handle loader, | 715 instanceKlassHandle k, Handle loader, |
700 bool defining, TRAPS); | 716 bool defining, TRAPS); |
701 static void update_dictionary(int d_index, unsigned int d_hash, | 717 static void update_dictionary(int d_index, unsigned int d_hash, |
702 int p_index, unsigned int p_hash, | 718 int p_index, unsigned int p_hash, |
703 instanceKlassHandle k, Handle loader, TRAPS); | 719 instanceKlassHandle k, Handle loader, |
720 TRAPS); | |
704 | 721 |
705 // Variables holding commonly used klasses (preloaded) | 722 // Variables holding commonly used klasses (preloaded) |
706 static klassOop _well_known_klasses[]; | 723 static Klass* _well_known_klasses[]; |
707 | 724 |
708 // Lazily loaded klasses | 725 // Lazily loaded klasses |
709 static volatile klassOop _abstract_ownable_synchronizer_klass; | 726 static Klass* volatile _abstract_ownable_synchronizer_klass; |
710 | 727 |
711 // table of box klasses (int_klass, etc.) | 728 // table of box klasses (int_klass, etc.) |
712 static klassOop _box_klasses[T_VOID+1]; | 729 static Klass* _box_klasses[T_VOID+1]; |
713 | 730 |
714 static oop _java_system_loader; | 731 static oop _java_system_loader; |
715 | 732 |
716 static bool _has_loadClassInternal; | 733 static bool _has_loadClassInternal; |
717 static bool _has_checkPackageAccess; | 734 static bool _has_checkPackageAccess; |
718 }; | 735 }; |
719 | 736 |
720 class SystemDictionaryHandles : AllStatic { | |
721 public: | |
722 #define WK_KLASS_HANDLE_DECLARE(name, ignore_symbol, option) \ | |
723 static KlassHandle name() { \ | |
724 SystemDictionary::name(); \ | |
725 klassOop* loc = &SystemDictionary::_well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)]; \ | |
726 return KlassHandle(loc, true); \ | |
727 } | |
728 WK_KLASSES_DO(WK_KLASS_HANDLE_DECLARE); | |
729 #undef WK_KLASS_HANDLE_DECLARE | |
730 | |
731 static KlassHandle box_klass(BasicType t); | |
732 }; | |
733 | |
734 #endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP | 737 #endif // SHARE_VM_CLASSFILE_SYSTEMDICTIONARY_HPP |