hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp
changeset 35210 eb1d5c68bf64
parent 35204 78a0fd90a70f
child 35211 3771329165d4
--- a/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Tue Dec 22 00:08:38 2015 +0000
+++ b/hotspot/src/share/vm/gc/g1/g1CollectedHeap.cpp	Tue Dec 22 11:02:04 2015 +0100
@@ -1789,9 +1789,6 @@
   uint n_queues = ParallelGCThreads;
   _task_queues = new RefToScanQueueSet(n_queues);
 
-  uint n_rem_sets = HeapRegionRemSet::num_par_rem_sets();
-  assert(n_rem_sets > 0, "Invariant.");
-
   _worker_cset_start_region = NEW_C_HEAP_ARRAY(HeapRegion*, n_queues, mtGC);
   _worker_cset_start_region_time_stamp = NEW_C_HEAP_ARRAY(uint, n_queues, mtGC);
   _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
@@ -1891,7 +1888,6 @@
   _g1_rem_set = new G1RemSet(this, g1_barrier_set());
 
   // Carve out the G1 part of the heap.
-
   ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
   size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
   G1RegionToSpaceMapper* heap_storage =
@@ -1940,6 +1936,8 @@
   const uint max_region_idx = (1U << (sizeof(RegionIdx_t)*BitsPerByte-1)) - 1;
   guarantee((max_regions() - 1) <= max_region_idx, "too many regions");
 
+  G1RemSet::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,
@@ -1967,9 +1965,6 @@
   }
   _cmThread = _cm->cmThread();
 
-  // Initialize the from_card cache structure of HeapRegionRemSet.
-  HeapRegionRemSet::init_heap(max_regions());
-
   // Now expand into the initial heap size.
   if (!expand(init_byte_size)) {
     vm_shutdown_during_initialization("Failed to allocate initial heap.");