src/hotspot/share/gc/g1/g1RemSet.cpp
changeset 49806 2d62570a615c
parent 49803 14518ac8df87
child 49911 358be4680d12
--- a/src/hotspot/share/gc/g1/g1RemSet.cpp	Wed Apr 18 11:36:48 2018 +0200
+++ b/src/hotspot/share/gc/g1/g1RemSet.cpp	Wed Apr 18 11:36:48 2018 +0200
@@ -277,14 +277,14 @@
   }
 };
 
-G1RemSet::G1RemSet(G1CollectedHeap* g1,
+G1RemSet::G1RemSet(G1CollectedHeap* g1h,
                    G1CardTable* ct,
                    G1HotCardCache* hot_card_cache) :
-  _g1(g1),
+  _g1h(g1h),
   _scan_state(new G1RemSetScanState()),
   _num_conc_refined_cards(0),
   _ct(ct),
-  _g1p(_g1->g1_policy()),
+  _g1p(_g1h->g1_policy()),
   _hot_card_cache(hot_card_cache),
   _prev_period_summary() {
 }
@@ -409,9 +409,9 @@
                             uint worker_i) {
   double rs_time_start = os::elapsedTime();
 
-  G1ScanObjsDuringScanRSClosure scan_cl(_g1, pss);
+  G1ScanObjsDuringScanRSClosure scan_cl(_g1h, pss);
   G1ScanRSForRegionClosure cl(_scan_state, &scan_cl, heap_region_codeblobs, worker_i);
-  _g1->collection_set_iterate_from(&cl, worker_i);
+  _g1h->collection_set_iterate_from(&cl, worker_i);
 
   double scan_rs_time_sec = (os::elapsedTime() - rs_time_start) -
                              cl.strong_code_root_scan_time_sec();
@@ -460,17 +460,17 @@
 };
 
 void G1RemSet::update_rem_set(G1ParScanThreadState* pss, uint worker_i) {
-  G1ScanObjsDuringUpdateRSClosure update_rs_cl(_g1, pss, worker_i);
-  G1RefineCardClosure refine_card_cl(_g1, &update_rs_cl);
+  G1ScanObjsDuringUpdateRSClosure update_rs_cl(_g1h, pss, worker_i);
+  G1RefineCardClosure refine_card_cl(_g1h, &update_rs_cl);
 
   G1GCParPhaseTimesTracker x(_g1p->phase_times(), G1GCPhaseTimes::UpdateRS, worker_i);
   if (G1HotCardCache::default_use_cache()) {
     // Apply the closure to the entries of the hot card cache.
     G1GCParPhaseTimesTracker y(_g1p->phase_times(), G1GCPhaseTimes::ScanHCC, worker_i);
-    _g1->iterate_hcc_closure(&refine_card_cl, worker_i);
+    _g1h->iterate_hcc_closure(&refine_card_cl, worker_i);
   }
   // Apply the closure to all remaining log entries.
-  _g1->iterate_dirty_card_closure(&refine_card_cl, worker_i);
+  _g1h->iterate_dirty_card_closure(&refine_card_cl, worker_i);
 
   G1GCPhaseTimes* p = _g1p->phase_times();
   p->record_thread_work_item(G1GCPhaseTimes::UpdateRS, worker_i, refine_card_cl.cards_scanned(), G1GCPhaseTimes::UpdateRSScannedCards);
@@ -496,29 +496,29 @@
 }
 
 void G1RemSet::cleanup_after_oops_into_collection_set_do() {
-  G1GCPhaseTimes* phase_times = _g1->g1_policy()->phase_times();
+  G1GCPhaseTimes* phase_times = _g1h->g1_policy()->phase_times();
 
   // Set all cards back to clean.
   double start = os::elapsedTime();
-  _scan_state->clear_card_table(_g1->workers());
+  _scan_state->clear_card_table(_g1h->workers());
   phase_times->record_clear_ct_time((os::elapsedTime() - start) * 1000.0);
 }
 
 inline void check_card_ptr(jbyte* card_ptr, G1CardTable* ct) {
 #ifdef ASSERT
-  G1CollectedHeap* g1 = G1CollectedHeap::heap();
-  assert(g1->is_in_exact(ct->addr_for(card_ptr)),
+  G1CollectedHeap* g1h = G1CollectedHeap::heap();
+  assert(g1h->is_in_exact(ct->addr_for(card_ptr)),
          "Card at " PTR_FORMAT " index " SIZE_FORMAT " representing heap at " PTR_FORMAT " (%u) must be in committed heap",
          p2i(card_ptr),
          ct->index_for(ct->addr_for(card_ptr)),
          p2i(ct->addr_for(card_ptr)),
-         g1->addr_to_region(ct->addr_for(card_ptr)));
+         g1h->addr_to_region(ct->addr_for(card_ptr)));
 #endif
 }
 
 void G1RemSet::refine_card_concurrently(jbyte* card_ptr,
                                         uint worker_i) {
-  assert(!_g1->is_gc_active(), "Only call concurrently");
+  assert(!_g1h->is_gc_active(), "Only call concurrently");
 
   check_card_ptr(card_ptr, _ct);
 
@@ -530,7 +530,7 @@
   // Construct the region representing the card.
   HeapWord* start = _ct->addr_for(card_ptr);
   // And find the region containing it.
-  HeapRegion* r = _g1->heap_region_containing(start);
+  HeapRegion* r = _g1h->heap_region_containing(start);
 
   // This check is needed for some uncommon cases where we should
   // ignore the card.
@@ -575,7 +575,7 @@
     } else if (card_ptr != orig_card_ptr) {
       // Original card was inserted and an old card was evicted.
       start = _ct->addr_for(card_ptr);
-      r = _g1->heap_region_containing(start);
+      r = _g1h->heap_region_containing(start);
 
       // Check whether the region formerly in the cache should be
       // ignored, as discussed earlier for the original card.  The
@@ -624,7 +624,7 @@
   MemRegion dirty_region(start, MIN2(scan_limit, end));
   assert(!dirty_region.is_empty(), "sanity");
 
-  G1ConcurrentRefineOopClosure conc_refine_cl(_g1, worker_i);
+  G1ConcurrentRefineOopClosure conc_refine_cl(_g1h, worker_i);
 
   bool card_processed =
     r->oops_on_card_seq_iterate_careful<false>(dirty_region, &conc_refine_cl);
@@ -652,7 +652,7 @@
 
 bool G1RemSet::refine_card_during_gc(jbyte* card_ptr,
                                      G1ScanObjsDuringUpdateRSClosure* update_rs_cl) {
-  assert(_g1->is_gc_active(), "Only call during GC");
+  assert(_g1h->is_gc_active(), "Only call during GC");
 
   check_card_ptr(card_ptr, _ct);
 
@@ -669,7 +669,7 @@
   // Construct the region representing the card.
   HeapWord* card_start = _ct->addr_for(card_ptr);
   // And find the region containing it.
-  uint const card_region_idx = _g1->addr_to_region(card_start);
+  uint const card_region_idx = _g1h->addr_to_region(card_start);
 
   _scan_state->add_dirty_region(card_region_idx);
   HeapWord* scan_limit = _scan_state->scan_top(card_region_idx);
@@ -684,7 +684,7 @@
   MemRegion dirty_region(card_start, MIN2(scan_limit, card_end));
   assert(!dirty_region.is_empty(), "sanity");
 
-  HeapRegion* const card_region = _g1->region_at(card_region_idx);
+  HeapRegion* const card_region = _g1h->region_at(card_region_idx);
   update_rs_cl->set_region(card_region);
   bool card_processed = card_region->oops_on_card_seq_iterate_careful<true>(dirty_region, update_rs_cl);
   assert(card_processed, "must be");