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

Simplify SystemDictionary::is_shared_class_visible

XMLWordPrintable

    • b03

      The current implementation of SystemDictionary::is_shared_class_visible and SystemDictionaryShared::is_shared_class_visible_for_classloader are very hard to follow:

      http://hg.openjdk.java.net/jdk/jdk/file/6bcfcb7fe83b/src/hotspot/share/classfile/systemDictionary.cpp#l1175
      http://hg.openjdk.java.net/jdk/jdk/file/6bcfcb7fe83b/src/hotspot/share/classfile/systemDictionaryShared.cpp#l661

      Maybe we can simplify the logic to:

      SystemDictionary::is_shared_class_visible(Symbol* class_name,
                                                     InstanceKlass* ik,
                                                     Handle class_loader, TRAPS)
      find {runtime_module, runtime_location, runtime_loader} that can define ik now;

      find {dumptime_module, dumptime_location, dumptime_loader} that defined ik during CDS dump time;

      if ({runtime_module, runtime_location, runtime_loader} ==
          {dumptime_module, dumptime_location, dumptime_loader}) {
         return true;
      } else {
         return false;
      }

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

              Created:
              Updated:
              Resolved: