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

Assert that SystemDictionaryShared::find_builtin_class is not called twice for the same class

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 19
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Labels:

      Description

      In the below code, we should never have two concurrent threads that each obtain the same non-NULL ik. Or else they would proceed to restore the same ik twice and will run into lots of issues.

      There's already code in the SystemDictionary to prevent this from happening. We should add an appropriate assert to make this clear.

      InstanceKlass* SystemDictionary::load_instance_class_impl(Symbol* class_name, Handle class_loader, TRAPS) {

          if (UseSharedSpaces)
          {
            PerfTraceTime vmtimer(ClassLoader::perf_shared_classload_time());
            InstanceKlass* ik = SystemDictionaryShared::find_builtin_class(class_name);
            if (ik != NULL && ik->is_shared_boot_class() && !ik->shared_loading_failed()) {
              SharedClassLoadingMark slm(THREAD, ik);
              k = load_shared_class(ik, class_loader, Handle(), NULL, pkg_entry, CHECK_NULL);
            }
          }

        Attachments

          Activity

            People

            Assignee:
            iklam Ioi Lam
            Reporter:
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: