< prev index next >

src/hotspot/share/gc/g1/g1BarrierSet.cpp

Print this page
rev 51332 : 8209118: Abstract SATBMarkQueueSet's ThreadLocalData access


  31 #include "gc/g1/heapRegion.hpp"
  32 #include "gc/g1/satbMarkQueue.hpp"
  33 #include "logging/log.hpp"
  34 #include "oops/access.inline.hpp"
  35 #include "oops/compressedOops.inline.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "runtime/interfaceSupport.inline.hpp"
  38 #include "runtime/mutexLocker.hpp"
  39 #include "runtime/thread.inline.hpp"
  40 #include "utilities/macros.hpp"
  41 #ifdef COMPILER1
  42 #include "gc/g1/c1/g1BarrierSetC1.hpp"
  43 #endif
  44 #ifdef COMPILER2
  45 #include "gc/g1/c2/g1BarrierSetC2.hpp"
  46 #endif
  47 
  48 class G1BarrierSetC1;
  49 class G1BarrierSetC2;
  50 
  51 SATBMarkQueueSet G1BarrierSet::_satb_mark_queue_set;
  52 DirtyCardQueueSet G1BarrierSet::_dirty_card_queue_set;
  53 
  54 G1BarrierSet::G1BarrierSet(G1CardTable* card_table) :
  55   CardTableBarrierSet(make_barrier_set_assembler<G1BarrierSetAssembler>(),
  56                       make_barrier_set_c1<G1BarrierSetC1>(),
  57                       make_barrier_set_c2<G1BarrierSetC2>(),
  58                       card_table,
  59                       BarrierSet::FakeRtti(BarrierSet::G1BarrierSet)) {}
  60 
  61 void G1BarrierSet::enqueue(oop pre_val) {
  62   // Nulls should have been already filtered.
  63   assert(oopDesc::is_oop(pre_val, true), "Error");
  64 
  65   if (!_satb_mark_queue_set.is_active()) return;
  66   Thread* thr = Thread::current();
  67   if (thr->is_Java_thread()) {
  68     G1ThreadLocalData::satb_mark_queue(thr).enqueue(pre_val);
  69   } else {
  70     MutexLockerEx x(Shared_SATB_Q_lock, Mutex::_no_safepoint_check_flag);
  71     _satb_mark_queue_set.shared_satb_queue()->enqueue(pre_val);




  31 #include "gc/g1/heapRegion.hpp"
  32 #include "gc/g1/satbMarkQueue.hpp"
  33 #include "logging/log.hpp"
  34 #include "oops/access.inline.hpp"
  35 #include "oops/compressedOops.inline.hpp"
  36 #include "oops/oop.inline.hpp"
  37 #include "runtime/interfaceSupport.inline.hpp"
  38 #include "runtime/mutexLocker.hpp"
  39 #include "runtime/thread.inline.hpp"
  40 #include "utilities/macros.hpp"
  41 #ifdef COMPILER1
  42 #include "gc/g1/c1/g1BarrierSetC1.hpp"
  43 #endif
  44 #ifdef COMPILER2
  45 #include "gc/g1/c2/g1BarrierSetC2.hpp"
  46 #endif
  47 
  48 class G1BarrierSetC1;
  49 class G1BarrierSetC2;
  50 
  51 G1SATBMarkQueueSet G1BarrierSet::_satb_mark_queue_set;
  52 DirtyCardQueueSet G1BarrierSet::_dirty_card_queue_set;
  53 
  54 G1BarrierSet::G1BarrierSet(G1CardTable* card_table) :
  55   CardTableBarrierSet(make_barrier_set_assembler<G1BarrierSetAssembler>(),
  56                       make_barrier_set_c1<G1BarrierSetC1>(),
  57                       make_barrier_set_c2<G1BarrierSetC2>(),
  58                       card_table,
  59                       BarrierSet::FakeRtti(BarrierSet::G1BarrierSet)) {}
  60 
  61 void G1BarrierSet::enqueue(oop pre_val) {
  62   // Nulls should have been already filtered.
  63   assert(oopDesc::is_oop(pre_val, true), "Error");
  64 
  65   if (!_satb_mark_queue_set.is_active()) return;
  66   Thread* thr = Thread::current();
  67   if (thr->is_Java_thread()) {
  68     G1ThreadLocalData::satb_mark_queue(thr).enqueue(pre_val);
  69   } else {
  70     MutexLockerEx x(Shared_SATB_Q_lock, Mutex::_no_safepoint_check_flag);
  71     _satb_mark_queue_set.shared_satb_queue()->enqueue(pre_val);


< prev index next >