Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/systemDictionary.hpp @ 3938:e6b1331a51d2
7086585: make Java field injection more flexible
Reviewed-by: jrose, twisti, kvn, coleenp
author | never |
---|---|
date | Sat, 10 Sep 2011 17:29:02 -0700 |
parents | c26de9aef2ed |
children | 04b9a2566eec b2cd0ee8f778 |
comparison
equal
deleted
inserted
replaced
3937:c565834fb592 | 3938:e6b1331a51d2 |
---|---|
131 template(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre) \ | 131 template(reflect_AccessibleObject_klass, java_lang_reflect_AccessibleObject, Pre) \ |
132 template(reflect_Field_klass, java_lang_reflect_Field, Pre) \ | 132 template(reflect_Field_klass, java_lang_reflect_Field, Pre) \ |
133 template(reflect_Method_klass, java_lang_reflect_Method, Pre) \ | 133 template(reflect_Method_klass, java_lang_reflect_Method, Pre) \ |
134 template(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre) \ | 134 template(reflect_Constructor_klass, java_lang_reflect_Constructor, Pre) \ |
135 \ | 135 \ |
136 /* NOTE: needed too early in bootstrapping process to have checks based on JDK version */ \ | 136 /* NOTE: needed too early in bootstrapping process to have checks based on JDK version */ \ |
137 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ | 137 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ |
138 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ | 138 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ |
139 template(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt) \ | 139 template(reflect_MagicAccessorImpl_klass, sun_reflect_MagicAccessorImpl, Opt) \ |
140 template(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \ | 140 template(reflect_MethodAccessorImpl_klass, sun_reflect_MethodAccessorImpl, Opt_Only_JDK14NewRef) \ |
141 template(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \ | 141 template(reflect_ConstructorAccessorImpl_klass, sun_reflect_ConstructorAccessorImpl, Opt_Only_JDK14NewRef) \ |
142 template(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt) \ | 142 template(reflect_DelegatingClassLoader_klass, sun_reflect_DelegatingClassLoader, Opt) \ |
143 template(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15) \ | 143 template(reflect_ConstantPool_klass, sun_reflect_ConstantPool, Opt_Only_JDK15) \ |
144 template(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \ | 144 template(reflect_UnsafeStaticFieldAccessorImpl_klass, sun_reflect_UnsafeStaticFieldAccessorImpl, Opt_Only_JDK15) \ |
145 \ | 145 \ |
146 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ | 146 /* support for dynamic typing; it's OK if these are NULL in earlier JDKs */ \ |
147 template(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292) \ | 147 template(MethodHandle_klass, java_lang_invoke_MethodHandle, Pre_JSR292) \ |
148 template(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292) \ | 148 template(MemberName_klass, java_lang_invoke_MemberName, Pre_JSR292) \ |
149 template(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292) \ | 149 template(MethodHandleNatives_klass, java_lang_invoke_MethodHandleNatives, Pre_JSR292) \ |
166 \ | 166 \ |
167 /* It's NULL in non-1.4 JDKs. */ \ | 167 /* It's NULL in non-1.4 JDKs. */ \ |
168 template(StackTraceElement_klass, java_lang_StackTraceElement, Opt) \ | 168 template(StackTraceElement_klass, java_lang_StackTraceElement, Opt) \ |
169 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ | 169 /* Universe::is_gte_jdk14x_version() is not set up by this point. */ \ |
170 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ | 170 /* It's okay if this turns out to be NULL in non-1.4 JDKs. */ \ |
171 template(java_nio_Buffer_klass, java_nio_Buffer, Opt) \ | 171 template(nio_Buffer_klass, java_nio_Buffer, Opt) \ |
172 \ | 172 \ |
173 /* If this class isn't present, it won't be referenced. */ \ | 173 /* If this class isn't present, it won't be referenced. */ \ |
174 template(sun_misc_AtomicLongCSImpl_klass, sun_misc_AtomicLongCSImpl, Opt) \ | 174 template(AtomicLongCSImpl_klass, sun_misc_AtomicLongCSImpl, Opt) \ |
175 \ | 175 \ |
176 template(sun_jkernel_DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel) \ | 176 template(DownloadManager_klass, sun_jkernel_DownloadManager, Opt_Kernel) \ |
177 \ | 177 \ |
178 template(sun_misc_PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt) \ | 178 template(PostVMInitHook_klass, sun_misc_PostVMInitHook, Opt) \ |
179 \ | 179 \ |
180 /* Preload boxing klasses */ \ | 180 /* Preload boxing klasses */ \ |
181 template(Boolean_klass, java_lang_Boolean, Pre) \ | 181 template(Boolean_klass, java_lang_Boolean, Pre) \ |
182 template(Character_klass, java_lang_Character, Pre) \ | 182 template(Character_klass, java_lang_Character, Pre) \ |
183 template(Float_klass, java_lang_Float, Pre) \ | 183 template(Float_klass, java_lang_Float, Pre) \ |
197 | 197 |
198 public: | 198 public: |
199 enum WKID { | 199 enum WKID { |
200 NO_WKID = 0, | 200 NO_WKID = 0, |
201 | 201 |
202 #define WK_KLASS_ENUM(name, ignore_s, ignore_o) WK_KLASS_ENUM_NAME(name), | 202 #define WK_KLASS_ENUM(name, symbol, ignore_o) WK_KLASS_ENUM_NAME(name), WK_KLASS_ENUM_NAME(symbol) = WK_KLASS_ENUM_NAME(name), |
203 WK_KLASSES_DO(WK_KLASS_ENUM) | 203 WK_KLASSES_DO(WK_KLASS_ENUM) |
204 #undef WK_KLASS_ENUM | 204 #undef WK_KLASS_ENUM |
205 | 205 |
206 WKID_LIMIT, | 206 WKID_LIMIT, |
207 | 207 |
424 int limit = (int)end_id + 1; | 424 int limit = (int)end_id + 1; |
425 initialize_wk_klasses_until((WKID) limit, start_id, THREAD); | 425 initialize_wk_klasses_until((WKID) limit, start_id, THREAD); |
426 } | 426 } |
427 | 427 |
428 public: | 428 public: |
429 #define WK_KLASS_DECLARE(name, ignore_symbol, option) \ | 429 #define WK_KLASS_DECLARE(name, symbol, option) \ |
430 static klassOop name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } | 430 static klassOop name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } |
431 WK_KLASSES_DO(WK_KLASS_DECLARE); | 431 WK_KLASSES_DO(WK_KLASS_DECLARE); |
432 #undef WK_KLASS_DECLARE | 432 #undef WK_KLASS_DECLARE |
433 | |
434 static klassOop well_known_klass(WKID id) { | |
435 assert(id >= (int)FIRST_WKID && id < (int)WKID_LIMIT, "oob"); | |
436 return _well_known_klasses[id]; | |
437 } | |
433 | 438 |
434 // Local definition for direct access to the private array: | 439 // Local definition for direct access to the private array: |
435 #define WK_KLASS(name) _well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)] | 440 #define WK_KLASS(name) _well_known_klasses[SystemDictionary::WK_KLASS_ENUM_NAME(name)] |
436 | 441 |
437 static klassOop box_klass(BasicType t) { | 442 static klassOop box_klass(BasicType t) { |