The following code complicates the implementation of SystemDictionary::resolve_with_circularity_detection() and should be removed.
https://github.com/openjdk/jdk/blob/7a6ff9206a0a4d116dec542819d51daa558d200d/src/hotspot/share/classfile/systemDictionary.cpp#L418-L435
InstanceKlass* SystemDictionary::resolve_with_circularity_detection(Symbol* class_name,
Symbol* next_name,
Handle class_loader,
bool is_superclass,
TRAPS) {
#if INCLUDE_CDS
if (CDSConfig::is_dumping_static_archive()) {
// Special processing for handling UNREGISTERED shared classes.
InstanceKlass* k = SystemDictionaryShared::lookup_super_for_unregistered_class(class_name,
next_name, is_superclass);
if (k) {
return k;
}
}
#endif // INCLUDE_CDS
=====================================
Background:
"Unregisted" classes are classes in the CDS archive to be loaded by custom class loaders during runtime. (I.e., they are not to be loaded by the 3 built-in boot/platform/app loaders).
Originally, during dump time, CDS uses the boot class loader to load the unregistered classes. However, an unregistered class could have supertypes that are not loaded by the boot loader. In such cases, we need the above hack to find such supertypes.
However, sinceJDK-8261941 (Use ClassLoader for unregistered classes during -Xshare:dump), the unregistered classes are loaded by a ClassLoader implemented in Java code. We should be able remove the above hack and implement the logic for supertype lookup in Java code instead.
https://github.com/openjdk/jdk/blob/7a6ff9206a0a4d116dec542819d51daa558d200d/src/hotspot/share/classfile/systemDictionary.cpp#L418-L435
InstanceKlass* SystemDictionary::resolve_with_circularity_detection(Symbol* class_name,
Symbol* next_name,
Handle class_loader,
bool is_superclass,
TRAPS) {
#if INCLUDE_CDS
if (CDSConfig::is_dumping_static_archive()) {
// Special processing for handling UNREGISTERED shared classes.
InstanceKlass* k = SystemDictionaryShared::lookup_super_for_unregistered_class(class_name,
next_name, is_superclass);
if (k) {
return k;
}
}
#endif // INCLUDE_CDS
=====================================
Background:
"Unregisted" classes are classes in the CDS archive to be loaded by custom class loaders during runtime. (I.e., they are not to be loaded by the 3 built-in boot/platform/app loaders).
Originally, during dump time, CDS uses the boot class loader to load the unregistered classes. However, an unregistered class could have supertypes that are not loaded by the boot loader. In such cases, we need the above hack to find such supertypes.
However, since
- relates to
-
JDK-8337548 Parallel class loading can pass is_superclass true for interfaces
- Resolved
- links to
-
Commit(master) openjdk/jdk/7f16a087
-
Review(master) openjdk/jdk/23226