7016955: G1: remove the is_zeroed parameter from the HeapRegion constructor
authorjohnc
Wed, 19 Sep 2012 08:48:10 -0700
changeset 13756 3b72f3da8cd4
parent 13755 a00f5de57d30
child 13757 8740ce357087
7016955: G1: remove the is_zeroed parameter from the HeapRegion constructor Summary: The is_zeroed parameter is no longer used and so can be removed. Reviewed-by: johnc, jmasa, brutisso Contributed-by: Brandon Mitchell <brandon@twitter.com>
hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp
hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Tue Sep 18 14:15:06 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp	Wed Sep 19 08:48:10 2012 -0700
@@ -6423,7 +6423,7 @@
   MemRegion mr(bottom, end);
   assert(_g1_reserved.contains(mr), "invariant");
   // This might return NULL if the allocation fails
-  return new HeapRegion(hrs_index, _bot_shared, mr, true /* is_zeroed */);
+  return new HeapRegion(hrs_index, _bot_shared, mr);
 }
 
 void G1CollectedHeap::verify_region_sets() {
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Tue Sep 18 14:15:06 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.cpp	Wed Sep 19 08:48:10 2012 -0700
@@ -476,10 +476,6 @@
   return low;
 }
 
-void HeapRegion::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
-  G1OffsetTableContigSpace::initialize(mr, false, mangle_space);
-  hr_clear(false/*par*/, clear_space);
-}
 #ifdef _MSC_VER // the use of 'this' below gets a warning, make it go away
 #pragma warning( disable:4355 ) // 'this' : used in base member initializer list
 #endif // _MSC_VER
@@ -487,8 +483,8 @@
 
 HeapRegion::HeapRegion(uint hrs_index,
                        G1BlockOffsetSharedArray* sharedOffsetArray,
-                       MemRegion mr, bool is_zeroed) :
-    G1OffsetTableContigSpace(sharedOffsetArray, mr, is_zeroed),
+                       MemRegion mr) :
+    G1OffsetTableContigSpace(sharedOffsetArray, mr),
     _hrs_index(hrs_index),
     _humongous_type(NotHumongous), _humongous_start_region(NULL),
     _in_collection_set(false),
@@ -507,7 +503,7 @@
   _orig_end = mr.end();
   // Note that initialize() will set the start of the unmarked area of the
   // region.
-  this->initialize(mr, !is_zeroed, SpaceDecorator::Mangle);
+  hr_clear(false /*par*/, false /*clear_space*/);
   set_top(bottom());
   set_saved_mark();
 
@@ -908,14 +904,6 @@
 // G1OffsetTableContigSpace code; copied from space.cpp.  Hope this can go
 // away eventually.
 
-void G1OffsetTableContigSpace::initialize(MemRegion mr, bool clear_space, bool mangle_space) {
-  // false ==> we'll do the clearing if there's clearing to be done.
-  ContiguousSpace::initialize(mr, false, mangle_space);
-  _offsets.zero_bottom_entry();
-  _offsets.initialize_threshold();
-  if (clear_space) clear(mangle_space);
-}
-
 void G1OffsetTableContigSpace::clear(bool mangle_space) {
   ContiguousSpace::clear(mangle_space);
   _offsets.zero_bottom_entry();
@@ -983,11 +971,14 @@
 
 G1OffsetTableContigSpace::
 G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,
-                         MemRegion mr, bool is_zeroed) :
+                         MemRegion mr) :
   _offsets(sharedOffsetArray, mr),
   _par_alloc_lock(Mutex::leaf, "OffsetTableContigSpace par alloc lock", true),
   _gc_time_stamp(0)
 {
   _offsets.set_space(this);
-  initialize(mr, !is_zeroed, SpaceDecorator::Mangle);
+  // false ==> we'll do the clearing if there's clearing to be done.
+  ContiguousSpace::initialize(mr, false, SpaceDecorator::Mangle);
+  _offsets.zero_bottom_entry();
+  _offsets.initialize_threshold();
 }
--- a/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp	Tue Sep 18 14:15:06 2012 -0700
+++ b/hotspot/src/share/vm/gc_implementation/g1/heapRegion.hpp	Wed Sep 19 08:48:10 2012 -0700
@@ -165,10 +165,8 @@
   HeapWord* _pre_dummy_top;
 
  public:
-  // Constructor.  If "is_zeroed" is true, the MemRegion "mr" may be
-  // assumed to contain zeros.
   G1OffsetTableContigSpace(G1BlockOffsetSharedArray* sharedOffsetArray,
-                           MemRegion mr, bool is_zeroed = false);
+                           MemRegion mr);
 
   void set_bottom(HeapWord* value);
   void set_end(HeapWord* value);
@@ -189,7 +187,6 @@
   }
   void reset_pre_dummy_top() { _pre_dummy_top = NULL; }
 
-  virtual void initialize(MemRegion mr, bool clear_space, bool mangle_space);
   virtual void clear(bool mangle_space);
 
   HeapWord* block_start(const void* p);
@@ -340,10 +337,9 @@
   size_t _predicted_bytes_to_copy;
 
  public:
-  // If "is_zeroed" is "true", the region "mr" can be assumed to contain zeros.
   HeapRegion(uint hrs_index,
              G1BlockOffsetSharedArray* sharedOffsetArray,
-             MemRegion mr, bool is_zeroed);
+             MemRegion mr);
 
   static int    LogOfHRGrainBytes;
   static int    LogOfHRGrainWords;
@@ -598,8 +594,6 @@
   void hr_clear(bool par, bool clear_space);
   void par_clear();
 
-  void initialize(MemRegion mr, bool clear_space, bool mangle_space);
-
   // Get the start of the unmarked area in this region.
   HeapWord* prev_top_at_mark_start() const { return _prev_top_at_mark_start; }
   HeapWord* next_top_at_mark_start() const { return _next_top_at_mark_start; }