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

LOAD_INSTANCE placeholders unneeded for parallelCapable class loaders

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 17
    • Fix Version/s: 17
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b10

      Description

      Loading classes from parallelCapable() class loaders, like our AppClassLoader, don't need to take out LOAD_INSTANCE placeholders. They are not used for mutual exclusion for class loading and are essentially ignored. They are used for mutual exclusion for the bootstrap class loader and for user level Java class loaders that are not parallelCapable().
      parallelCapable() class loaders take out a per-class lock in Java in the loadClass() method.

      In SystemDictionary::load_instance_class_or_null, the only code that checks and waits for the LOAD_INSTANCE placeholder is in this conditional:
            if (class_loader.is_null() || !is_parallelCapable(class_loader)) {
                    PlaceholderEntry* oldprobe = placeholders()->get_entry(name_hash, name, loader_data);
                       ...
                    // case 3: traditional: should never see load_in_progress.
                  while (!class_has_been_loaded && oldprobe != NULL && oldprobe->instance_load_in_progress()) { <=== HERE
                          both bootloader (class_loader == NULL) and non-parallelCapable class loader wait on the SystemDictionary_lock
                          where non-parallelCapable loader first releases the class_loader instance lock
                   }

      Loading classes with parallelCapable class loaders creates the LOAD_INSTANCE placeholder but ignores it.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              coleenp Coleen Phillimore
              Reporter:
              coleenp Coleen Phillimore
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: