< prev index next >

src/hotspot/share/cds/metaspaceShared.cpp

Print this page
*** 65,10 ***
--- 65,12 ---
  #include "memory/metaspaceClosure.hpp"
  #include "memory/resourceArea.hpp"
  #include "memory/universe.hpp"
  #include "nmt/memTracker.hpp"
  #include "oops/compressedKlass.hpp"
+ #include "oops/flatArrayKlass.hpp"
+ #include "oops/inlineKlass.hpp"
  #include "oops/instanceMirrorKlass.hpp"
  #include "oops/klass.inline.hpp"
  #include "oops/objArrayOop.hpp"
  #include "oops/oop.inline.hpp"
  #include "oops/oopHandle.hpp"

*** 107,11 ***
  //
  // The rw and ro regions are linearly allocated, in the order of rw->ro.
  // These regions are aligned with MetaspaceShared::core_region_alignment().
  //
  // These 2 regions are populated in the following steps:
! // [0] All classes are loaded in MetaspaceShared::preload_classes(). All metadata are
  //     temporarily allocated outside of the shared regions.
  // [1] We enter a safepoint and allocate a buffer for the rw/ro regions.
  // [2] C++ vtables are copied into the rw region.
  // [3] ArchiveBuilder copies RW metadata into the rw region.
  // [4] ArchiveBuilder copies RO metadata into the ro region.
--- 109,11 ---
  //
  // The rw and ro regions are linearly allocated, in the order of rw->ro.
  // These regions are aligned with MetaspaceShared::core_region_alignment().
  //
  // These 2 regions are populated in the following steps:
! // [0] All classes are loaded in MetaspaceShared::loadable_descriptors(). All metadata are
  //     temporarily allocated outside of the shared regions.
  // [1] We enter a safepoint and allocate a buffer for the rw/ro regions.
  // [2] C++ vtables are copied into the rw region.
  // [3] ArchiveBuilder copies RW metadata into the rw region.
  // [4] ArchiveBuilder copies RO metadata into the ro region.

*** 722,11 ***
                   buf_size - classlist_path_len,
                   "%sclasslist", os::file_separator());
    }
  }
  
! void MetaspaceShared::preload_classes(TRAPS) {
    char default_classlist[JVM_MAXPATHLEN];
    const char* classlist_path;
  
    get_default_classlist(default_classlist, sizeof(default_classlist));
    if (SharedClassListFile == nullptr) {
--- 724,11 ---
                   buf_size - classlist_path_len,
                   "%sclasslist", os::file_separator());
    }
  }
  
! void MetaspaceShared::loadable_descriptors(TRAPS) {
    char default_classlist[JVM_MAXPATHLEN];
    const char* classlist_path;
  
    get_default_classlist(default_classlist, sizeof(default_classlist));
    if (SharedClassListFile == nullptr) {

*** 767,11 ***
    // Exercise FileSystem and URL code
    CDSProtectionDomain::to_file_URL("dummy.jar", Handle(), CHECK);
  }
  
  void MetaspaceShared::preload_and_dump_impl(StaticArchiveBuilder& builder, TRAPS) {
!   preload_classes(CHECK);
  
    if (SharedArchiveConfigFile) {
      log_info(cds)("Reading extra data from %s ...", SharedArchiveConfigFile);
      read_extra_data(THREAD, SharedArchiveConfigFile);
      log_info(cds)("Reading extra data: done.");
--- 769,11 ---
    // Exercise FileSystem and URL code
    CDSProtectionDomain::to_file_URL("dummy.jar", Handle(), CHECK);
  }
  
  void MetaspaceShared::preload_and_dump_impl(StaticArchiveBuilder& builder, TRAPS) {
!   loadable_descriptors(CHECK);
  
    if (SharedArchiveConfigFile) {
      log_info(cds)("Reading extra data from %s ...", SharedArchiveConfigFile);
      read_extra_data(THREAD, SharedArchiveConfigFile);
      log_info(cds)("Reading extra data: done.");

*** 868,10 ***
--- 870,14 ---
    }
  }
  
  #if INCLUDE_CDS_JAVA_HEAP
  void VM_PopulateDumpSharedSpace::dump_java_heap_objects(GrowableArray<Klass*>* klasses) {
+   if (CDSConfig::is_valhalla_preview()) {
+     log_info(cds)("Archived java heap is not yet supported with Valhalla preview");
+     return;
+   }
    if(!HeapShared::can_write()) {
      log_info(cds)(
        "Archived java heap is not supported as UseG1GC "
        "and UseCompressedClassPointers are required."
        "Current settings: UseG1GC=%s, UseCompressedClassPointers=%s.",
< prev index next >