Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8348240

Remove SystemDictionaryShared::lookup_super_for_unregistered_class()

XMLWordPrintable

    • b08

        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, since JDK-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.

              iklam Ioi Lam
              iklam Ioi Lam
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: