< prev index next >

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

Print this page
rev 13232 : imported patch parallel-fullgc-stefanj
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

@@ -93,32 +93,10 @@
 // and allocate_new_tlab, which are the "entry" points to the
 // allocation code from the rest of the JVM.  (Note that this does not
 // apply to TLAB allocation, which is not part of this interface: it
 // is done by clients of this interface.)
 
-// Local to this file.
-
-class RefineCardTableEntryClosure: public CardTableEntryClosure {
-  bool _concurrent;
-public:
-  RefineCardTableEntryClosure() : _concurrent(true) { }
-
-  bool do_card_ptr(jbyte* card_ptr, uint worker_i) {
-    G1CollectedHeap::heap()->g1_rem_set()->refine_card_concurrently(card_ptr, worker_i);
-
-    if (_concurrent && SuspendibleThreadSet::should_yield()) {
-      // Caller will actually yield.
-      return false;
-    }
-    // Otherwise, we finished successfully; return true.
-    return true;
-  }
-
-  void set_concurrent(bool b) { _concurrent = b; }
-};
-
-
 class RedirtyLoggedCardTableEntryClosure : public CardTableEntryClosure {
  private:
   size_t _num_dirtied;
   G1CollectedHeap* _g1h;
   G1SATBCardTableLoggingModRefBS* _g1_bs;

@@ -1580,11 +1558,10 @@
   _bot(NULL),
   _hot_card_cache(NULL),
   _g1_rem_set(NULL),
   _cg1r(NULL),
   _g1mm(NULL),
-  _refine_cte_cl(NULL),
   _preserved_marks_set(true /* in_c_heap */),
   _secondary_free_list("Secondary Free List", new SecondaryFreeRegionListMtSafeChecker()),
   _old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
   _humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
   _humongous_reclaim_candidates(),

@@ -1659,14 +1636,12 @@
 
   return result;
 }
 
 jint G1CollectedHeap::initialize_concurrent_refinement() {
-  _refine_cte_cl = new RefineCardTableEntryClosure();
-
   jint ecode = JNI_OK;
-  _cg1r = ConcurrentG1Refine::create(_refine_cte_cl, &ecode);
+  _cg1r = ConcurrentG1Refine::create(_g1_rem_set->refine_card_concurrently_closure(), &ecode);
   return ecode;
 }
 
 jint G1CollectedHeap::initialize() {
   CollectedHeap::pre_initialize();

@@ -1819,11 +1794,11 @@
   jint ecode = initialize_concurrent_refinement();
   if (ecode != JNI_OK) {
     return ecode;
   }
   
-  JavaThread::dirty_card_queue_set().initialize(_refine_cte_cl,
+  JavaThread::dirty_card_queue_set().initialize(_g1_rem_set->refine_card_concurrently_closure(),
                                                 DirtyCardQ_CBL_mon,
                                                 DirtyCardQ_FL_lock,
                                                 (int)concurrent_g1_refine()->yellow_zone(),
                                                 (int)concurrent_g1_refine()->red_zone(),
                                                 Shared_DirtyCardQ_lock,

@@ -5165,14 +5140,10 @@
          "inconsistent used_unlocked(), "
          "value: " SIZE_FORMAT " recalculated: " SIZE_FORMAT,
          used_unlocked(), recalculate_used());
 }
 
-void G1CollectedHeap::set_refine_cte_cl_concurrency(bool concurrent) {
-  _refine_cte_cl->set_concurrent(concurrent);
-}
-
 bool G1CollectedHeap::is_in_closed_subset(const void* p) const {
   HeapRegion* hr = heap_region_containing(p);
   return hr->is_in(p);
 }
 
< prev index next >