Mercurial > hg > graal-jvmci-8
comparison src/share/vm/classfile/systemDictionary.hpp @ 2356:72dee110246f
6839872: remove implementation inheritance from JSR 292 APIs
Summary: consolidate runtime support in java.dyn.MethodHandleNatives; include transitional compatibility logic
Reviewed-by: twisti
author | jrose |
---|---|
date | Fri, 11 Mar 2011 22:33:47 -0800 |
parents | 3582bf76420e |
children | 8033953d67ff |
comparison
equal
deleted
inserted
replaced
2355:799d8ccf63cf | 2356:72dee110246f |
---|---|
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_dyn_MethodHandle, Opt) \ | 147 template(MethodHandle_klass, java_dyn_MethodHandle, Pre_JSR292) \ |
148 template(MemberName_klass, sun_dyn_MemberName, Opt) \ | 148 template(MemberName_klass, java_dyn_MemberName, Pre_JSR292) \ |
149 template(MethodHandleImpl_klass, sun_dyn_MethodHandleImpl, Opt) \ | 149 template(MethodHandleImpl_klass, java_dyn_MethodHandleImpl, Pre_JSR292) /* AllowTransitionalJSR292 ONLY */ \ |
150 template(MethodHandleNatives_klass, sun_dyn_MethodHandleNatives, Opt) \ | 150 template(MethodHandleNatives_klass, java_dyn_MethodHandleNatives, Pre_JSR292) \ |
151 template(AdapterMethodHandle_klass, sun_dyn_AdapterMethodHandle, Opt) \ | 151 template(AdapterMethodHandle_klass, java_dyn_AdapterMethodHandle, Pre_JSR292) \ |
152 template(BoundMethodHandle_klass, sun_dyn_BoundMethodHandle, Opt) \ | 152 template(BoundMethodHandle_klass, java_dyn_BoundMethodHandle, Pre_JSR292) \ |
153 template(DirectMethodHandle_klass, sun_dyn_DirectMethodHandle, Opt) \ | 153 template(DirectMethodHandle_klass, java_dyn_DirectMethodHandle, Pre_JSR292) \ |
154 template(MethodType_klass, java_dyn_MethodType, Opt) \ | 154 template(MethodType_klass, java_dyn_MethodType, Pre_JSR292) \ |
155 template(MethodTypeForm_klass, java_dyn_MethodTypeForm, Opt) \ | 155 template(MethodTypeForm_klass, java_dyn_MethodTypeForm, Pre_JSR292) \ |
156 template(WrongMethodTypeException_klass, java_dyn_WrongMethodTypeException, Opt) \ | 156 template(WrongMethodTypeException_klass, java_dyn_WrongMethodTypeException, Pre_JSR292) \ |
157 template(Linkage_klass, java_dyn_Linkage, Opt) \ | 157 template(Linkage_klass, java_dyn_Linkage, Pre_JSR292) \ |
158 template(CallSite_klass, java_dyn_CallSite, Opt) \ | 158 template(CallSite_klass, java_dyn_CallSite, Pre_JSR292) \ |
159 /* Note: MethodHandle must be first, and CallSite last in group */ \ | 159 /* Note: MethodHandle must be first, and CallSite last in group */ \ |
160 \ | 160 \ |
161 template(StringBuffer_klass, java_lang_StringBuffer, Pre) \ | 161 template(StringBuffer_klass, java_lang_StringBuffer, Pre) \ |
162 template(StringBuilder_klass, java_lang_StringBuilder, Pre) \ | 162 template(StringBuilder_klass, java_lang_StringBuilder, Pre) \ |
163 \ | 163 \ |
205 FIRST_WKID = NO_WKID + 1 | 205 FIRST_WKID = NO_WKID + 1 |
206 }; | 206 }; |
207 | 207 |
208 enum InitOption { | 208 enum InitOption { |
209 Pre, // preloaded; error if not present | 209 Pre, // preloaded; error if not present |
210 Pre_JSR292, // preloaded if EnableMethodHandles | |
210 | 211 |
211 // Order is significant. Options before this point require resolve_or_fail. | 212 // Order is significant. Options before this point require resolve_or_fail. |
212 // Options after this point will use resolve_or_null instead. | 213 // Options after this point will use resolve_or_null instead. |
213 | 214 |
214 Opt, // preload tried; NULL if not present | 215 Opt, // preload tried; NULL if not present |
399 assert(k != NULL, "preloaded klass not initialized"); | 400 assert(k != NULL, "preloaded klass not initialized"); |
400 return k; | 401 return k; |
401 } | 402 } |
402 | 403 |
403 static klassOop check_klass_Pre(klassOop k) { return check_klass(k); } | 404 static klassOop check_klass_Pre(klassOop k) { return check_klass(k); } |
405 static klassOop check_klass_Pre_JSR292(klassOop k) { return EnableInvokeDynamic ? check_klass(k) : k; } | |
404 static klassOop check_klass_Opt(klassOop k) { return k; } | 406 static klassOop check_klass_Opt(klassOop k) { return k; } |
405 static klassOop check_klass_Opt_Kernel(klassOop k) { return k; } //== Opt | 407 static klassOop check_klass_Opt_Kernel(klassOop k) { return k; } //== Opt |
406 static klassOop check_klass_Opt_Only_JDK15(klassOop k) { | 408 static klassOop check_klass_Opt_Only_JDK15(klassOop k) { |
407 assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only"); | 409 assert(JDK_Version::is_gte_jdk15x_version(), "JDK 1.5 only"); |
408 return k; | 410 return k; |
418 static void initialize_wk_klasses_through(WKID end_id, WKID &start_id, TRAPS) { | 420 static void initialize_wk_klasses_through(WKID end_id, WKID &start_id, TRAPS) { |
419 int limit = (int)end_id + 1; | 421 int limit = (int)end_id + 1; |
420 initialize_wk_klasses_until((WKID) limit, start_id, THREAD); | 422 initialize_wk_klasses_until((WKID) limit, start_id, THREAD); |
421 } | 423 } |
422 | 424 |
425 static Symbol* find_backup_symbol(Symbol* symbol, const char* from_prefix, const char* to_prefix); | |
426 | |
423 public: | 427 public: |
424 #define WK_KLASS_DECLARE(name, ignore_symbol, option) \ | 428 #define WK_KLASS_DECLARE(name, ignore_symbol, option) \ |
425 static klassOop name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } | 429 static klassOop name() { return check_klass_##option(_well_known_klasses[WK_KLASS_ENUM_NAME(name)]); } |
426 WK_KLASSES_DO(WK_KLASS_DECLARE); | 430 WK_KLASSES_DO(WK_KLASS_DECLARE); |
427 #undef WK_KLASS_DECLARE | 431 #undef WK_KLASS_DECLARE |
438 // methods returning lazily loaded klasses | 442 // methods returning lazily loaded klasses |
439 // The corresponding method to load the class must be called before calling them. | 443 // The corresponding method to load the class must be called before calling them. |
440 static klassOop abstract_ownable_synchronizer_klass() { return check_klass(_abstract_ownable_synchronizer_klass); } | 444 static klassOop abstract_ownable_synchronizer_klass() { return check_klass(_abstract_ownable_synchronizer_klass); } |
441 | 445 |
442 static void load_abstract_ownable_synchronizer_klass(TRAPS); | 446 static void load_abstract_ownable_synchronizer_klass(TRAPS); |
447 | |
448 static Symbol* find_backup_class_name(Symbol* class_name_symbol); | |
449 static Symbol* find_backup_signature(Symbol* signature_symbol); | |
443 | 450 |
444 private: | 451 private: |
445 // Tells whether ClassLoader.loadClassInternal is present | 452 // Tells whether ClassLoader.loadClassInternal is present |
446 static bool has_loadClassInternal() { return _has_loadClassInternal; } | 453 static bool has_loadClassInternal() { return _has_loadClassInternal; } |
447 | 454 |