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

LOAD_INSTANCE placeholders unneeded for parallelCapable class loaders

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • 17
    • hotspot
    • b10

      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.

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

              Created:
              Updated:
              Resolved: