< prev index next >

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

Print this page




  24 
  25 #include "precompiled.hpp"
  26 #include "jvm.h"
  27 #include "gc/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc/g1/satbMarkQueue.hpp"
  29 #include "gc/shared/collectedHeap.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "oops/oop.inline.hpp"
  32 #include "runtime/mutexLocker.hpp"
  33 #include "runtime/safepoint.hpp"
  34 #include "runtime/thread.hpp"
  35 #include "runtime/threadSMR.hpp"
  36 #include "runtime/vmThread.hpp"
  37 
  38 SATBMarkQueue::SATBMarkQueue(SATBMarkQueueSet* qset, bool permanent) :
  39   // SATB queues are only active during marking cycles. We create
  40   // them with their active field set to false. If a thread is
  41   // created during a cycle and its SATB queue needs to be activated
  42   // before the thread starts running, we'll need to set its active
  43   // field to true. This is done in G1SATBCardTableLoggingModRefBS::
  44   // on_thread_create().
  45   PtrQueue(qset, permanent, false /* active */)
  46 { }
  47 
  48 void SATBMarkQueue::flush() {
  49   // Filter now to possibly save work later.  If filtering empties the
  50   // buffer then flush_impl can deallocate the buffer.
  51   filter();
  52   flush_impl();
  53 }
  54 
  55 // Return true if a SATB buffer entry refers to an object that
  56 // requires marking.
  57 //
  58 // The entry must point into the G1 heap.  In particular, it must not
  59 // be a NULL pointer.  NULL pointers are pre-filtered and never
  60 // inserted into a SATB buffer.
  61 //
  62 // An entry that is below the NTAMS pointer for the containing heap
  63 // region requires marking. Such an entry must point to a valid object.
  64 //




  24 
  25 #include "precompiled.hpp"
  26 #include "jvm.h"
  27 #include "gc/g1/g1CollectedHeap.inline.hpp"
  28 #include "gc/g1/satbMarkQueue.hpp"
  29 #include "gc/shared/collectedHeap.hpp"
  30 #include "memory/allocation.inline.hpp"
  31 #include "oops/oop.inline.hpp"
  32 #include "runtime/mutexLocker.hpp"
  33 #include "runtime/safepoint.hpp"
  34 #include "runtime/thread.hpp"
  35 #include "runtime/threadSMR.hpp"
  36 #include "runtime/vmThread.hpp"
  37 
  38 SATBMarkQueue::SATBMarkQueue(SATBMarkQueueSet* qset, bool permanent) :
  39   // SATB queues are only active during marking cycles. We create
  40   // them with their active field set to false. If a thread is
  41   // created during a cycle and its SATB queue needs to be activated
  42   // before the thread starts running, we'll need to set its active
  43   // field to true. This is done in G1SATBCardTableLoggingModRefBS::
  44   // on_thread_attach().
  45   PtrQueue(qset, permanent, false /* active */)
  46 { }
  47 
  48 void SATBMarkQueue::flush() {
  49   // Filter now to possibly save work later.  If filtering empties the
  50   // buffer then flush_impl can deallocate the buffer.
  51   filter();
  52   flush_impl();
  53 }
  54 
  55 // Return true if a SATB buffer entry refers to an object that
  56 // requires marking.
  57 //
  58 // The entry must point into the G1 heap.  In particular, it must not
  59 // be a NULL pointer.  NULL pointers are pre-filtered and never
  60 // inserted into a SATB buffer.
  61 //
  62 // An entry that is below the NTAMS pointer for the containing heap
  63 // region requires marking. Such an entry must point to a valid object.
  64 //


< prev index next >