< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.cpp

Print this page
rev 60593 : 8252035: G1: Clean up G1CollectedHeap::*reserved* methods
Reviewed-by:

@@ -1679,28 +1679,26 @@
   // The G1FromCardCache reserves card with value 0 as "invalid", so the heap must not
   // start within the first card.
   guarantee(g1_rs.base() >= (char*)G1CardTable::card_size, "Java heap must not start within the first card.");
   // Also create a G1 rem set.
   _rem_set = new G1RemSet(this, _card_table, _hot_card_cache);
-  _rem_set->initialize(max_reserved_capacity(), max_regions());
+  _rem_set->initialize(max_regions());
 
   size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1;
   guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized");
   guarantee(HeapRegion::CardsPerRegion < max_cards_per_region,
             "too many cards per region");
 
   FreeRegionList::set_unrealistically_long_length(max_expandable_regions() + 1);
 
-  _bot = new G1BlockOffsetTable(reserved_region(), bot_storage);
+  _bot = new G1BlockOffsetTable(reserved(), bot_storage);
 
   {
-    HeapWord* start = _hrm->reserved().start();
-    HeapWord* end = _hrm->reserved().end();
     size_t granularity = HeapRegion::GrainBytes;
 
-    _region_attr.initialize(start, end, granularity);
-    _humongous_reclaim_candidates.initialize(start, end, granularity);
+    _region_attr.initialize(reserved(), granularity);
+    _humongous_reclaim_candidates.initialize(reserved(), granularity);
   }
 
   _workers = new WorkGang("GC Thread", ParallelGCThreads,
                           true /* are_GC_task_threads */,
                           false /* are_ConcurrentGC_threads */);

@@ -2269,11 +2267,11 @@
   }
 }
 
 #ifdef ASSERT
 bool G1CollectedHeap::is_in_exact(const void* p) const {
-  bool contains = reserved_region().contains(p);
+  bool contains = reserved().contains(p);
   bool available = _hrm->is_available(addr_to_region((HeapWord*)p));
   if (contains && available) {
     return true;
   } else {
     return false;

@@ -2391,14 +2389,10 @@
 
 size_t G1CollectedHeap::max_capacity() const {
   return _hrm->max_expandable_length() * HeapRegion::GrainBytes;
 }
 
-size_t G1CollectedHeap::max_reserved_capacity() const {
-  return _hrm->max_length() * HeapRegion::GrainBytes;
-}
-
 void G1CollectedHeap::deduplicate_string(oop str) {
   assert(java_lang_String::is_instance(str), "invariant");
 
   if (G1StringDedup::is_enabled()) {
     G1StringDedup::deduplicate(str);
< prev index next >