8203865: Metaspace cleanup: Remove unused MemRegion in VirtualSpaceNode
authorstuefe
Tue, 29 May 2018 12:52:08 +0200
changeset 50286 cbc4fca9171e
parent 50285 5b6bdc59f8cc
child 50287 64c880300d9b
8203865: Metaspace cleanup: Remove unused MemRegion in VirtualSpaceNode Reviewed-by: dholmes, zgu
src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp
src/hotspot/share/memory/metaspace/virtualSpaceNode.hpp
--- a/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp	Tue May 29 10:53:55 2018 +0200
+++ b/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp	Tue May 29 12:52:08 2018 +0200
@@ -521,16 +521,6 @@
         "Checking that the pre-committed memory was registered by the VirtualSpace");
 
     set_top((MetaWord*)virtual_space()->low());
-    set_reserved(MemRegion((HeapWord*)_rs.base(),
-        (HeapWord*)(_rs.base() + _rs.size())));
-
-    assert(reserved()->start() == (HeapWord*) _rs.base(),
-        "Reserved start was not set properly " PTR_FORMAT
-        " != " PTR_FORMAT, p2i(reserved()->start()), p2i(_rs.base()));
-    assert(reserved()->word_size() == _rs.size() / BytesPerWord,
-        "Reserved size was not set properly " SIZE_FORMAT
-        " != " SIZE_FORMAT, reserved()->word_size(),
-        _rs.size() / BytesPerWord);
   }
 
   // Initialize Occupancy Map.
--- a/src/hotspot/share/memory/metaspace/virtualSpaceNode.hpp	Tue May 29 10:53:55 2018 +0200
+++ b/src/hotspot/share/memory/metaspace/virtualSpaceNode.hpp	Tue May 29 12:52:08 2018 +0200
@@ -49,7 +49,6 @@
   const bool _is_class;
 
   // total in the VirtualSpace
-  MemRegion _reserved;
   ReservedSpace _rs;
   VirtualSpace _virtual_space;
   MetaWord* _top;
@@ -102,11 +101,9 @@
   VirtualSpaceNode* next() { return _next; }
   void set_next(VirtualSpaceNode* v) { _next = v; }
 
-  void set_reserved(MemRegion const v) { _reserved = v; }
   void set_top(MetaWord* v) { _top = v; }
 
   // Accessors
-  MemRegion* reserved() { return &_reserved; }
   VirtualSpace* virtual_space() const { return (VirtualSpace*) &_virtual_space; }
 
   // Returns true if "word_size" is available in the VirtualSpace
@@ -135,8 +132,7 @@
   // Allocate a chunk from the virtual space and return it.
   Metachunk* get_chunk_vs(size_t chunk_word_size);
 
-  // Expands/shrinks the committed space in a virtual space.  Delegates
-  // to Virtualspace
+  // Expands the committed space by at least min_words words.
   bool expand_by(size_t min_words, size_t preferred_words);
 
   // In preparation for deleting this node, remove all the chunks