Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/systemDictionary.hpp @ 6847:65d07d9ee446
8000263: JSR 292: signature types may appear to be unloaded
Reviewed-by: kvn, jrose
author | twisti |
---|---|
date | Mon, 08 Oct 2012 17:04:00 -0700 |
parents | f6b0eb4e44cf |
children | 19eb999cb72c |
comparison
equal
deleted
inserted
replaced
6846:377508648226 | 6847:65d07d9ee446 |
---|---|
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_Link ) \ |
98 template(String_klass, java_lang_String, Pre) \ | 98 do_klass(String_klass, java_lang_String, Pre_Link ) \ |
99 template(Class_klass, java_lang_Class, Pre) \ | 99 do_klass(Class_klass, java_lang_Class, Pre_Link ) \ |
100 template(Cloneable_klass, java_lang_Cloneable, Pre) \ | 100 do_klass(Cloneable_klass, java_lang_Cloneable, Pre_Link ) \ |
101 template(ClassLoader_klass, java_lang_ClassLoader, Pre) \ | 101 do_klass(ClassLoader_klass, java_lang_ClassLoader, Pre_Link ) \ |
102 template(Serializable_klass, java_io_Serializable, Pre) \ | 102 do_klass(Serializable_klass, java_io_Serializable, Pre_Link ) \ |
103 template(System_klass, java_lang_System, Pre) \ | 103 do_klass(System_klass, java_lang_System, Pre_Link ) \ |
104 template(Throwable_klass, java_lang_Throwable, Pre) \ | 104 do_klass(Throwable_klass, java_lang_Throwable, Pre_Link ) \ |
105 template(Error_klass, java_lang_Error, Pre) \ | 105 do_klass(Error_klass, java_lang_Error, Pre_Link ) \ |
106 template(ThreadDeath_klass, java_lang_ThreadDeath, Pre) \ | 106 do_klass(ThreadDeath_klass, java_lang_ThreadDeath, Pre_Link ) \ |
107 template(Exception_klass, java_lang_Exception, Pre) \ | 107 do_klass(Exception_klass, java_lang_Exception, Pre_Link ) \ |
108 template(RuntimeException_klass, java_lang_RuntimeException, Pre) \ | 108 do_klass(RuntimeException_klass, java_lang_RuntimeException, Pre_Link ) \ |
109 template(ProtectionDomain_klass, java_security_ProtectionDomain, Pre) \ | 109 do_klass(ProtectionDomain_klass, java_security_ProtectionDomain, Pre_Link ) \ |
110 template(AccessControlContext_klass, java_security_AccessControlContext, Pre) \ | 110 do_klass(AccessControlContext_klass, java_security_AccessControlContext, Pre_Link ) \ |
111 template(ClassNotFoundException_klass, java_lang_ClassNotFoundException, Pre) \ | 111 do_klass(ClassNotFoundException_klass, java_lang_ClassNotFoundException, Pre_Link ) \ |
112 template(NoClassDefFoundError_klass, java_lang_NoClassDefFoundError, Pre) \ | 112 do_klass(NoClassDefFoundError_klass, java_lang_NoClassDefFoundError, Pre_Link ) \ |
113 template(LinkageError_klass, java_lang_LinkageError, Pre) \ | 113 do_klass(LinkageError_klass, java_lang_LinkageError, Pre_Link ) \ |
114 template(ClassCastException_klass, java_lang_ClassCastException, Pre) \ | 114 do_klass(ClassCastException_klass, java_lang_ClassCastException, Pre_Link ) \ |
115 template(ArrayStoreException_klass, java_lang_ArrayStoreException, Pre) \ | 115 do_klass(ArrayStoreException_klass, java_lang_ArrayStoreException, Pre_Link ) \ |
116 template(VirtualMachineError_klass, java_lang_VirtualMachineError, Pre) \ | 116 do_klass(VirtualMachineError_klass, java_lang_VirtualMachineError, Pre_Link ) \ |
117 template(OutOfMemoryError_klass, java_lang_OutOfMemoryError, Pre) \ | 117 do_klass(OutOfMemoryError_klass, java_lang_OutOfMemoryError, Pre_Link ) \ |
118 template(StackOverflowError_klass, java_lang_StackOverflowError, Pre) \ | 118 do_klass(StackOverflowError_klass, java_lang_StackOverflowError, Pre_Link ) \ |
119 template(IllegalMonitorStateException_klass, java_lang_IllegalMonitorStateException, Pre) \ | 119 do_klass(IllegalMonitorStateException_klass, java_lang_IllegalMonitorStateException, Pre_Link ) \ |
120 template(Reference_klass, java_lang_ref_Reference, Pre) \ | 120 do_klass(Reference_klass, java_lang_ref_Reference, Pre_Link ) \ |
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_Link ) \ |
124 template(WeakReference_klass, java_lang_ref_WeakReference, Pre) \ | 124 do_klass(WeakReference_klass, java_lang_ref_WeakReference, Pre_Link ) \ |
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_Link ) \ |
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_Link ) \ |
130 template(ThreadGroup_klass, java_lang_ThreadGroup, Pre) \ | 130 do_klass(ThreadGroup_klass, java_lang_ThreadGroup, Pre_Link ) \ |
131 template(Properties_klass, java_util_Properties, Pre) \ | 131 do_klass(Properties_klass, java_util_Properties, Pre_Link ) \ |
132 template(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre) \ | 132 do_klass(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre_Link ) \ |
133 template(reflect_Field_klass, java_lang_reflect_Field, Pre) \ | 133 do_klass(reflect_Field_klass, java_lang_reflect_Field, Pre_Link ) \ |
134 template(reflect_Method_klass, java_lang_reflect_Method, Pre) \ | 134 do_klass(reflect_Method_klass, java_lang_reflect_Method, Pre_Link ) \ |
135 template(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre) \ | 135 do_klass(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre_Link ) \ |
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(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt ) \ |
141 template(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \ | 141 do_klass(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \ |
142 template(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \ | 142 do_klass(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \ |
143 template(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt) \ | 143 do_klass(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt ) \ |
144 template(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15) \ | 144 do_klass(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15 ) \ |
145 template(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \ | 145 do_klass(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15 ) \ |
146 \ | 146 \ |
147 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ | 147 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ |
148 template(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292) \ | 148 do_klass(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_Link ) \ |
149 template(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292) \ | 149 do_klass(MemberName_klass, java_lang_invoke_MemberName, Pre ) \ |
150 template(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292) \ | 150 do_klass(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre ) \ |
151 template(LambdaForm_klass, java_lang_invoke_LambdaForm, Opt) \ | 151 do_klass(LambdaForm_klass, java_lang_invoke_LambdaForm, Opt ) \ |
152 template(MethodType_klass, java_lang_invoke_MethodType, Pre_JSR292) \ | 152 do_klass(MethodType_klass, java_lang_invoke_MethodType, Pre_Link ) \ |
153 template(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre_JSR292) \ | 153 do_klass(BootstrapMethodError_klass, java_lang_BootstrapMethodError, Pre_Link ) \ |
154 template(CallSite_klass, java_lang_invoke_CallSite, Pre_JSR292) \ | 154 do_klass(CallSite_klass, java_lang_invoke_CallSite, Pre_Link ) \ |
155 template(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre_JSR292) \ | 155 do_klass(ConstantCallSite_klass, java_lang_invoke_ConstantCallSite, Pre_Link ) \ |
156 template(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre_JSR292) \ | 156 do_klass(MutableCallSite_klass, java_lang_invoke_MutableCallSite, Pre_Link ) \ |
157 template(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre_JSR292) \ | 157 do_klass(VolatileCallSite_klass, java_lang_invoke_VolatileCallSite, Pre_Link ) \ |
158 /* Note: MethodHandle must be first, and VolatileCallSite last in group */ \ | 158 /* Note: MethodHandle must be first, and VolatileCallSite last in group */ \ |
159 \ | 159 \ |
160 template(StringBuffer_klass, java_lang_StringBuffer, Pre) \ | 160 do_klass(StringBuffer_klass, java_lang_StringBuffer, Pre_Link ) \ |
161 template(StringBuilder_klass, java_lang_StringBuilder, Pre) \ | 161 do_klass(StringBuilder_klass, java_lang_StringBuilder, Pre_Link ) \ |
162 \ | 162 \ |
163 /* It's NULL in non-1.4 JDKs. */ \ | 163 /* It's NULL in non-1.4 JDKs. */ \ |
164 template(StackTraceElement_klass, java_lang_StackTraceElement, Opt) \ | 164 do_klass(StackTraceElement_klass, java_lang_StackTraceElement, Opt ) \ |
165 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ | 165 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ |
166 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ | 166 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ |
167 template(nio_Buffer_klass, java_nio_Buffer, Opt) \ | 167 do_klass(nio_Buffer_klass, java_nio_Buffer, Opt ) \ |
168 \ | 168 \ |
169 template(DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel) \ | 169 do_klass(DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel ) \ |
170 \ | 170 \ |
171 template(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt) \ | 171 do_klass(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt ) \ |
172 \ | 172 \ |
173 /* Preload boxing klasses */ \ | 173 /* Preload boxing klasses */ \ |
174 template(Boolean_klass, java_lang_Boolean, Pre) \ | 174 do_klass(Boolean_klass, java_lang_Boolean, Pre_Link ) \ |
175 template(Character_klass, java_lang_Character, Pre) \ | 175 do_klass(Character_klass, java_lang_Character, Pre_Link ) \ |
176 template(Float_klass, java_lang_Float, Pre) \ | 176 do_klass(Float_klass, java_lang_Float, Pre_Link ) \ |
177 template(Double_klass, java_lang_Double, Pre) \ | 177 do_klass(Double_klass, java_lang_Double, Pre_Link ) \ |
178 template(Byte_klass, java_lang_Byte, Pre) \ | 178 do_klass(Byte_klass, java_lang_Byte, Pre_Link ) \ |
179 template(Short_klass, java_lang_Short, Pre) \ | 179 do_klass(Short_klass, java_lang_Short, Pre_Link ) \ |
180 template(Integer_klass, java_lang_Integer, Pre) \ | 180 do_klass(Integer_klass, java_lang_Integer, Pre_Link ) \ |
181 template(Long_klass, java_lang_Long, Pre) \ | 181 do_klass(Long_klass, java_lang_Long, Pre_Link ) \ |
182 /*end*/ | 182 /*end*/ |
183 | 183 |
184 | 184 |
185 class SystemDictionary : AllStatic { | 185 class SystemDictionary : AllStatic { |
186 friend class VMStructs; | 186 friend class VMStructs; |
199 FIRST_WKID = NO_WKID + 1 | 199 FIRST_WKID = NO_WKID + 1 |
200 }; | 200 }; |
201 | 201 |
202 enum InitOption { | 202 enum InitOption { |
203 Pre, // preloaded; error if not present | 203 Pre, // preloaded; error if not present |
204 Pre_JSR292, // preloaded if EnableInvokeDynamic | 204 Pre_Link, // preloaded; error if not present; link as well-known |
205 | 205 |
206 // Order is significant. Options before this point require resolve_or_fail. | 206 // Order is significant. Options before this point require resolve_or_fail. |
207 // Options after this point will use resolve_or_null instead. | 207 // Options after this point will use resolve_or_null instead. |
208 | 208 |
209 Opt, // preload tried; NULL if not present | 209 Opt, // preload tried; NULL if not present |
390 static Klass* check_klass(Klass* k) { | 390 static Klass* check_klass(Klass* k) { |
391 assert(k != NULL, "preloaded klass not initialized"); | 391 assert(k != NULL, "preloaded klass not initialized"); |
392 return k; | 392 return k; |
393 } | 393 } |
394 | 394 |
395 static Klass* check_klass_Pre(Klass* k) { return check_klass(k); } | 395 static Klass* check_klass_Pre( Klass* k) { return check_klass(k); } |
396 static Klass* check_klass_Pre_JSR292(Klass* k) { return EnableInvokeDynamic ? check_klass(k) : k; } | 396 static Klass* check_klass_Pre_Link( Klass* k) { return check_klass(k); } |
397 static Klass* check_klass_Opt(Klass* k) { return k; } | 397 static Klass* check_klass_Opt( Klass* k) { return k; } |
398 static Klass* check_klass_Opt_Kernel(Klass* k) { return k; } //== Opt | 398 static Klass* check_klass_Opt_Kernel(Klass* k) { return k; } //== Opt |
399 static Klass* check_klass_Opt_Only_JDK15(Klass* k) { | 399 static Klass* check_klass_Opt_Only_JDK15(Klass* k) { |
400 assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only"); | 400 assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only"); |
401 return k; | 401 return k; |
402 } | 402 } |
410 static void initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS); | 410 static void initialize_wk_klasses_until(WKID limit_id, WKID &start_id, TRAPS); |
411 static void initialize_wk_klasses_through(WKID end_id, WKID &start_id, TRAPS) { | 411 static void initialize_wk_klasses_through(WKID end_id, WKID &start_id, TRAPS) { |
412 int limit = (int)end_id + 1; | 412 int limit = (int)end_id + 1; |
413 initialize_wk_klasses_until((WKID) limit, start_id, THREAD); | 413 initialize_wk_klasses_until((WKID) limit, start_id, THREAD); |
414 } | 414 } |
415 | |
416 static void check_wk_pre_link_klasses() NOT_DEBUG_RETURN; | |
415 | 417 |
416 public: | 418 public: |
417 #define WK_KLASS_DECLARE(name, symbol, option) \ | 419 #define WK_KLASS_DECLARE(name, symbol, option) \ |
418 static Klass* name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } \ | 420 static Klass* name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } \ |
419 static Klass** name##_addr() { \ | 421 static Klass** name##_addr() { \ |