src/hotspot/share/gc/g1/g1BarrierSet.cpp
changeset 51390 135285dfc551
parent 51368 adcb0bb3d1e9
child 51441 2e91d927e00c
--- a/src/hotspot/share/gc/g1/g1BarrierSet.cpp	Mon Aug 13 13:24:55 2018 -0700
+++ b/src/hotspot/share/gc/g1/g1BarrierSet.cpp	Mon Aug 13 18:21:26 2018 -0400
@@ -48,27 +48,30 @@
 class G1BarrierSetC1;
 class G1BarrierSetC2;
 
-G1SATBMarkQueueSet G1BarrierSet::_satb_mark_queue_set;
-DirtyCardQueueSet G1BarrierSet::_dirty_card_queue_set;
-
 G1BarrierSet::G1BarrierSet(G1CardTable* card_table) :
   CardTableBarrierSet(make_barrier_set_assembler<G1BarrierSetAssembler>(),
                       make_barrier_set_c1<G1BarrierSetC1>(),
                       make_barrier_set_c2<G1BarrierSetC2>(),
                       card_table,
-                      BarrierSet::FakeRtti(BarrierSet::G1BarrierSet)) {}
+                      BarrierSet::FakeRtti(BarrierSet::G1BarrierSet)),
+  _satb_mark_queue_set(),
+  _dirty_card_queue_set()
+{}
 
 void G1BarrierSet::enqueue(oop pre_val) {
   // Nulls should have been already filtered.
   assert(oopDesc::is_oop(pre_val, true), "Error");
 
-  if (!_satb_mark_queue_set.is_active()) return;
+  G1SATBMarkQueueSet& queue_set = satb_mark_queue_set();
+  if (!queue_set.is_active()) {
+    return;
+  }
   Thread* thr = Thread::current();
   if (thr->is_Java_thread()) {
     G1ThreadLocalData::satb_mark_queue(thr).enqueue(pre_val);
   } else {
     MutexLockerEx x(Shared_SATB_Q_lock, Mutex::_no_safepoint_check_flag);
-    _satb_mark_queue_set.shared_satb_queue()->enqueue(pre_val);
+    queue_set.shared_satb_queue()->enqueue(pre_val);
   }
 }