src/hotspot/share/classfile/systemDictionary.cpp
changeset 51674 d7dcaacb95dd
parent 51610 cdef4df6b0e7
child 51959 db0c3952de52
equal deleted inserted replaced
51673:53e61697a020 51674:d7dcaacb95dd
  2026   WKID scan = FIRST_WKID;
  2026   WKID scan = FIRST_WKID;
  2027   // first do Object, then String, Class
  2027   // first do Object, then String, Class
  2028 #if INCLUDE_CDS
  2028 #if INCLUDE_CDS
  2029   if (UseSharedSpaces) {
  2029   if (UseSharedSpaces) {
  2030     resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Object_klass), scan, CHECK);
  2030     resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Object_klass), scan, CHECK);
       
  2031 
       
  2032     // It's unsafe to access the archived heap regions before they
       
  2033     // are fixed up, so we must do the fixup as early as possible
       
  2034     // before the archived java objects are accessed by functions
       
  2035     // such as java_lang_Class::restore_archived_mirror and
       
  2036     // ConstantPool::restore_unshareable_info (restores the archived
       
  2037     // resolved_references array object).
       
  2038     //
       
  2039     // MetaspaceShared::fixup_mapped_heap_regions() fills the empty
       
  2040     // spaces in the archived heap regions and may use
       
  2041     // SystemDictionary::Object_klass(), so we can do this only after
       
  2042     // Object_klass is resolved. See the above resolve_wk_klasses_through()
       
  2043     // call. No mirror objects are accessed/restored in the above call.
       
  2044     // Mirrors are restored after java.lang.Class is loaded.
       
  2045     MetaspaceShared::fixup_mapped_heap_regions();
       
  2046 
  2031     // Initialize the constant pool for the Object_class
  2047     // Initialize the constant pool for the Object_class
  2032     Object_klass()->constants()->restore_unshareable_info(CHECK);
  2048     Object_klass()->constants()->restore_unshareable_info(CHECK);
  2033     resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
  2049     resolve_wk_klasses_through(WK_KLASS_ENUM_NAME(Class_klass), scan, CHECK);
  2034   } else
  2050   } else
  2035 #endif
  2051 #endif