< prev index next >

src/share/vm/gc/g1/g1RemSet.cpp

Print this page
rev 13237 : imported patch 8183226-periodic-rem-set-summary-accesses-uninitialized-stuff
rev 13238 : imported patch 8183226-eridk-sjohanss-review
rev 13239 : imported patch 8183128-cleanup-refinecardtableentryclosure

@@ -34,10 +34,11 @@
 #include "gc/g1/g1RemSet.inline.hpp"
 #include "gc/g1/g1SATBCardTableModRefBS.inline.hpp"
 #include "gc/g1/heapRegion.inline.hpp"
 #include "gc/g1/heapRegionManager.inline.hpp"
 #include "gc/g1/heapRegionRemSet.hpp"
+#include "gc/g1/suspendibleThreadSet.hpp"
 #include "gc/shared/gcTraceTime.inline.hpp"
 #include "memory/iterator.hpp"
 #include "memory/resourceArea.hpp"
 #include "oops/oop.inline.hpp"
 #include "utilities/align.hpp"

@@ -281,10 +282,11 @@
 G1RemSet::G1RemSet(G1CollectedHeap* g1,
                    CardTableModRefBS* ct_bs,
                    G1HotCardCache* hot_card_cache) :
   _g1(g1),
   _scan_state(new G1RemSetScanState()),
+  _refine_card_concurrently_cl(),
   _num_conc_refined_cards(0),
   _ct_bs(ct_bs),
   _g1p(_g1->g1_policy()),
   _hot_card_cache(hot_card_cache),
   _prev_period_summary(),

@@ -444,10 +446,21 @@
   p->record_thread_work_item(G1GCPhaseTimes::ScanRS, worker_i, cl.cards_skipped(), G1GCPhaseTimes::SkippedCards);
 
   p->record_time_secs(G1GCPhaseTimes::CodeRoots, worker_i, cl.strong_code_root_scan_time_sec());
 }
 
+bool G1RefineCardConcurrentlyClosure::do_card_ptr(jbyte* card_ptr, uint worker_i) {
+  G1CollectedHeap::heap()->g1_rem_set()->refine_card_concurrently(card_ptr, worker_i);
+
+  if (SuspendibleThreadSet::should_yield()) {
+    // Caller will actually yield.
+    return false;
+  }
+  // Otherwise, we finished successfully; return true.
+  return true;
+}
+
 // Closure used for updating RSets and recording references that
 // point into the collection set. Only called during an
 // evacuation pause.
 class G1RefineCardClosure: public CardTableEntryClosure {
   G1RemSet* _g1rs;

@@ -517,21 +530,18 @@
   update_rem_set(&into_cset_dcq, pss, worker_i);
   scan_rem_set(pss, heap_region_codeblobs, worker_i);;
 }
 
 void G1RemSet::prepare_for_oops_into_collection_set_do() {
-  _g1->set_refine_cte_cl_concurrency(false);
   DirtyCardQueueSet& dcqs = JavaThread::dirty_card_queue_set();
   dcqs.concatenate_logs();
 
   _scan_state->reset();
 }
 
 void G1RemSet::cleanup_after_oops_into_collection_set_do() {
   G1GCPhaseTimes* phase_times = _g1->g1_policy()->phase_times();
-  // Cleanup after copy
-  _g1->set_refine_cte_cl_concurrency(true);
 
   // Set all cards back to clean.
   double start = os::elapsedTime();
   _scan_state->clear_card_table(_g1->workers());
   phase_times->record_clear_ct_time((os::elapsedTime() - start) * 1000.0);
< prev index next >