Merge
authormgerdin
Mon, 02 May 2016 16:53:03 +0200
changeset 38163 f231a9615b65
parent 38161 1c7dd1e39fcf (diff)
parent 38162 4e2c3433a3ae (current diff)
child 38165 7eb8388bb4f7
Merge
--- a/hotspot/src/share/vm/gc/g1/g1RemSet.cpp	Wed Apr 27 16:11:45 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1RemSet.cpp	Mon May 02 16:53:03 2016 +0200
@@ -215,27 +215,27 @@
 
   // Clear the card table of "dirty" regions.
   void clear_card_table(WorkGang* workers) {
-   if (_cur_dirty_region == 0) {
-     return;
-   }
+    if (_cur_dirty_region == 0) {
+      return;
+    }
 
-   size_t const num_chunks = align_size_up(_cur_dirty_region * HeapRegion::CardsPerRegion, G1ClearCardTableTask::chunk_size()) / G1ClearCardTableTask::chunk_size();
-   uint const num_workers = (uint)MIN2(num_chunks, (size_t)workers->active_workers());
-   size_t const chunk_length = G1ClearCardTableTask::chunk_size() / HeapRegion::CardsPerRegion;
+    size_t const num_chunks = align_size_up(_cur_dirty_region * HeapRegion::CardsPerRegion, G1ClearCardTableTask::chunk_size()) / G1ClearCardTableTask::chunk_size();
+    uint const num_workers = (uint)MIN2(num_chunks, (size_t)workers->active_workers());
+    size_t const chunk_length = G1ClearCardTableTask::chunk_size() / HeapRegion::CardsPerRegion;
 
-   // Iterate over the dirty cards region list.
-   G1ClearCardTableTask cl(G1CollectedHeap::heap(), _dirty_region_buffer, _cur_dirty_region, chunk_length);
+    // Iterate over the dirty cards region list.
+    G1ClearCardTableTask cl(G1CollectedHeap::heap(), _dirty_region_buffer, _cur_dirty_region, chunk_length);
 
-   log_debug(gc, ergo)("Running %s using %u workers for " SIZE_FORMAT " "
-                       "units of work for " SIZE_FORMAT " regions.",
-                       cl.name(), num_workers, num_chunks, _cur_dirty_region);
-   workers->run_task(&cl, num_workers);
+    log_debug(gc, ergo)("Running %s using %u workers for " SIZE_FORMAT " "
+                        "units of work for " SIZE_FORMAT " regions.",
+                        cl.name(), num_workers, num_chunks, _cur_dirty_region);
+    workers->run_task(&cl, num_workers);
 
 #ifndef PRODUCT
-   // Need to synchronize with concurrent cleanup since it needs to
-   // finish its card table clearing before we can verify.
-   G1CollectedHeap::heap()->wait_while_free_regions_coming();
-   G1CollectedHeap::heap()->verifier()->verify_card_table_cleanup();
+    // Need to synchronize with concurrent cleanup since it needs to
+    // finish its card table clearing before we can verify.
+    G1CollectedHeap::heap()->wait_while_free_regions_coming();
+    G1CollectedHeap::heap()->verifier()->verify_card_table_cleanup();
 #endif
   }
 };
--- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp	Wed Apr 27 16:11:45 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp	Mon May 02 16:53:03 2016 +0200
@@ -265,8 +265,7 @@
   _first_all_fine_prts(NULL), _last_all_fine_prts(NULL),
   _n_fine_entries(0), _n_coarse_entries(0),
   _fine_eviction_start(0),
-  _sparse_table(hr),
-  _coarse_dirty(false)
+  _sparse_table(hr)
 {
   typedef PerRegionTable* PerRegionTablePtr;
 
@@ -505,7 +504,6 @@
   size_t max_hrm_index = (size_t) max->hr()->hrm_index();
   if (!_coarse_map.at(max_hrm_index)) {
     _coarse_map.at_put(max_hrm_index, true);
-    _coarse_dirty = true;
     _n_coarse_entries++;
   }
 
@@ -521,10 +519,9 @@
   log_develop_trace(gc, remset, scrub)("Scrubbing region %u:", _hr->hrm_index());
 
   log_develop_trace(gc, remset, scrub)("   Coarse map: before = " SIZE_FORMAT "...", _n_coarse_entries);
-  if (_coarse_dirty) {
+  if (_n_coarse_entries > 0) {
     live_data->remove_nonlive_regions(&_coarse_map);
     _n_coarse_entries = _coarse_map.count_one_bits();
-    _coarse_dirty = _n_coarse_entries != 0;
   }
   log_develop_trace(gc, remset, scrub)("   after = " SIZE_FORMAT ".", _n_coarse_entries);
 
@@ -651,9 +648,8 @@
 
   _first_all_fine_prts = _last_all_fine_prts = NULL;
   _sparse_table.clear();
-  if (_coarse_dirty) {
+  if (_n_coarse_entries > 0) {
     _coarse_map.clear();
-    _coarse_dirty = false;
   }
   _n_fine_entries = 0;
   _n_coarse_entries = 0;
--- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp	Wed Apr 27 16:11:45 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp	Mon May 02 16:53:03 2016 +0200
@@ -79,7 +79,6 @@
   HeapRegion*      _hr;
 
   // These are protected by "_m".
-  bool        _coarse_dirty;
   BitMap      _coarse_map;
   size_t      _n_coarse_entries;
   static jint _n_coarsenings;