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

SystemDictionaryShared::initialize() should be renamed to be more meaningful

    XMLWordPrintable

Details

    • Enhancement
    • Resolution: Fixed
    • P3
    • 11
    • 10
    • hotspot
    • b14

    Backports

      Description

        The SystemDictionary::compute_java_loaders() seems to do what the function name indicates by obtaining system loader and the PlatformClassLoader. However, it also does something extra by calling SystemDictionaryShared::initialize(), which seems to indicate it is initializing the shared system dictionary from the mapped archive. Based on the naming, the call sequence seems to be wrong as initializing the mapping shared system dictionary should happen earlier in the VM start up. However, the closed implementation of SystemDictionaryShared::initialize() only initializes of a few classes that's used by AppCDS. The function should be renamed to be more meaningful.

        See http://hg.openjdk.java.net/jdk/jdk/file/9fec54fe663d/src/hotspot/share/classfile/systemDictionaryShared.cpp#l65
                http://hg.openjdk.java.net/jdk/jdk/file/9fec54fe663d/src/hotspot/share/classfile/systemDictionary.cpp#l153

        131 void SystemDictionary::compute_java_loaders(TRAPS) {
         132 JavaValue result(T_OBJECT);
         133 InstanceKlass* class_loader_klass = SystemDictionary::ClassLoader_klass();
         134 JavaCalls::call_static(&result,
         135 class_loader_klass,
         136 vmSymbols::getSystemClassLoader_name(),
         137 vmSymbols::void_classloader_signature(),
         138 CHECK);
         139
         140 _java_system_loader = (oop)result.get_jobject();
         141
         142 JavaCalls::call_static(&result,
         143 class_loader_klass,
         144 vmSymbols::getPlatformClassLoader_name(),
         145 vmSymbols::void_classloader_signature(),
         146 CHECK);
         147
         148 _java_platform_loader = (oop)result.get_jobject();
         149
         150 CDS_ONLY(SystemDictionaryShared::initialize(CHECK);)
         151 }

        Attachments

          Issue Links

            Activity

              People

                iklam Ioi Lam
                jiangli Jiangli Zhou
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: