8224497: Remove FIXME in metaspaceClosure.cpp
authorccheung
Fri, 07 Jun 2019 14:03:17 -0700
changeset 55296 357c9dcb6eb9
parent 55295 14283f280695
child 55297 fd61ef6c4091
8224497: Remove FIXME in metaspaceClosure.cpp Summary: Also cleaned up some comment and code related to the od (optional data) region. Reviewed-by: iklam, jiangli
src/hotspot/share/memory/filemap.cpp
src/hotspot/share/memory/metaspaceClosure.cpp
src/hotspot/share/memory/metaspaceShared.cpp
src/hotspot/share/memory/metaspaceShared.hpp
--- a/src/hotspot/share/memory/filemap.cpp	Fri Jun 07 13:57:08 2019 -0700
+++ b/src/hotspot/share/memory/filemap.cpp	Fri Jun 07 14:03:17 2019 -0700
@@ -1080,7 +1080,7 @@
 }
 
 // Memory map a region in the address space.
-static const char* shared_region_name[] = { "MiscData", "ReadWrite", "ReadOnly", "MiscCode", "OptionalData",
+static const char* shared_region_name[] = { "MiscData", "ReadWrite", "ReadOnly", "MiscCode",
                                             "String1", "String2", "OpenArchive1", "OpenArchive2" };
 
 char* FileMapInfo::map_regions(int regions[], char* saved_base[], size_t len) {
@@ -1094,7 +1094,7 @@
       return NULL;
     }
     if (i > 0) {
-      // We require that mc->rw->ro->md->od to be laid out consecutively, with no
+      // We require that mc->rw->ro->md to be laid out consecutively, with no
       // gaps between them. That way, we can ensure that the OS won't be able to
       // allocate any new memory spaces inside _shared_metaspace_{base,top}, which
       // would mess up the simple comparision in MetaspaceShared::is_in_shared_metaspace().
--- a/src/hotspot/share/memory/metaspaceClosure.cpp	Fri Jun 07 13:57:08 2019 -0700
+++ b/src/hotspot/share/memory/metaspaceClosure.cpp	Fri Jun 07 14:03:17 2019 -0700
@@ -45,7 +45,7 @@
 }
 
 void MetaspaceClosure::do_push(MetaspaceClosure::Ref* ref) {
-  if (ref->not_null()) { // FIXME: make this configurable, so DynamicArchiveBuilder mark all pointers
+  if (ref->not_null()) {
     bool read_only;
     Writability w = ref->writability();
     switch (w) {
--- a/src/hotspot/share/memory/metaspaceShared.cpp	Fri Jun 07 13:57:08 2019 -0700
+++ b/src/hotspot/share/memory/metaspaceShared.cpp	Fri Jun 07 14:03:17 2019 -0700
@@ -90,18 +90,17 @@
 //     rw  - read-write metadata
 //     ro  - read-only metadata and read-only tables
 //     md  - misc data (the c++ vtables)
-//     od  - optional data (original class files)
 //
 //     ca0 - closed archive heap space #0
 //     ca1 - closed archive heap space #1 (may be empty)
 //     oa0 - open archive heap space #0
 //     oa1 - open archive heap space #1 (may be empty)
 //
-// The mc, rw, ro, md and od regions are linearly allocated, starting from
-// SharedBaseAddress, in the order of mc->rw->ro->md->od. The size of these 5 regions
+// The mc, rw, ro, and md regions are linearly allocated, starting from
+// SharedBaseAddress, in the order of mc->rw->ro->md. The size of these 4 regions
 // are page-aligned, and there's no gap between any consecutive regions.
 //
-// These 5 regions are populated in the following steps:
+// These 4 regions are populated in the following steps:
 // [1] All classes are loaded in MetaspaceShared::preload_classes(). All metadata are
 //     temporarily allocated outside of the shared regions. Only the method entry
 //     trampolines are written into the mc region.
@@ -110,10 +109,9 @@
 // [4] SymbolTable, StringTable, SystemDictionary, and a few other read-only data
 //     are copied into the ro region as read-only tables.
 // [5] C++ vtables are copied into the md region.
-// [6] Original class files are copied into the od region.
 //
 // The s0/s1 and oa0/oa1 regions are populated inside HeapShared::archive_java_heap_objects.
-// Their layout is independent of the other 5 regions.
+// Their layout is independent of the other 4 regions.
 
 char* DumpRegion::expand_top_to(char* newtop) {
   assert(is_allocatable(), "must be initialized and not packed");
@@ -174,7 +172,7 @@
   }
 }
 
-DumpRegion _mc_region("mc"), _ro_region("ro"), _rw_region("rw"), _md_region("md"), _od_region("od");
+DumpRegion _mc_region("mc"), _ro_region("ro"), _rw_region("rw"), _md_region("md");
 size_t _total_closed_archive_region_size = 0, _total_open_archive_region_size = 0;
 
 void MetaspaceShared::init_shared_dump_space(DumpRegion* first_space, address first_space_bottom) {
@@ -198,10 +196,6 @@
   return &_ro_region;
 }
 
-DumpRegion* MetaspaceShared::optional_data_dump_space() {
-  return &_od_region;
-}
-
 void MetaspaceShared::pack_dump_space(DumpRegion* current, DumpRegion* next,
                                       ReservedSpace* rs) {
   current->pack(next);
@@ -290,10 +284,10 @@
   //
   //                              +-- SharedBaseAddress (default = 0x800000000)
   //                              v
-  // +-..---------+---------+ ... +----+----+----+----+----+---------------+
-  // |    Heap    | Archive |     | MC | RW | RO | MD | OD | class space   |
-  // +-..---------+---------+ ... +----+----+----+----+----+---------------+
-  // |<--   MaxHeapSize  -->|     |<-- UnscaledClassSpaceMax = 4GB ------->|
+  // +-..---------+---------+ ... +----+----+----+----+---------------+
+  // |    Heap    | Archive |     | MC | RW | RO | MD | class space   |
+  // +-..---------+---------+ ... +----+----+----+----+---------------+
+  // |<--   MaxHeapSize  -->|     |<-- UnscaledClassSpaceMax = 4GB -->|
   //
   const uint64_t UnscaledClassSpaceMax = (uint64_t(max_juint) + 1);
   const size_t cds_total = align_down(UnscaledClassSpaceMax, reserve_alignment);
@@ -1074,7 +1068,7 @@
 
   LogMessage(cds) msg;
 
-  msg.info("Detailed metadata info (excluding od/st regions; rw stats include md/mc regions):");
+  msg.info("Detailed metadata info (excluding st regions; rw stats include md/mc regions):");
   msg.info("%s", hdr);
   msg.info("%s", sep);
   for (int type = 0; type < int(_number_of_types); type ++) {
--- a/src/hotspot/share/memory/metaspaceShared.hpp	Fri Jun 07 13:57:08 2019 -0700
+++ b/src/hotspot/share/memory/metaspaceShared.hpp	Fri Jun 07 14:03:17 2019 -0700
@@ -304,7 +304,6 @@
   static DumpRegion* misc_code_dump_space();
   static DumpRegion* read_write_dump_space();
   static DumpRegion* read_only_dump_space();
-  static DumpRegion* optional_data_dump_space();
   static void pack_dump_space(DumpRegion* current, DumpRegion* next,
                               ReservedSpace* rs);