< prev index next >

src/share/vm/gc_implementation/g1/satbQueue.hpp

Print this page




  32 class SATBMarkQueueSet;
  33 
  34 // Base class for processing the contents of a SATB buffer.
  35 class SATBBufferClosure : public StackObj {
  36 protected:
  37   ~SATBBufferClosure() { }
  38 
  39 public:
  40   // Process the SATB entries in the designated buffer range.
  41   virtual void do_buffer(void** buffer, size_t size) = 0;
  42 };
  43 
  44 // A ptrQueue whose elements are "oops", pointers to object heads.
  45 class ObjPtrQueue: public PtrQueue {
  46   friend class SATBMarkQueueSet;
  47 
  48 private:
  49   // Filter out unwanted entries from the buffer.
  50   void filter();
  51 



  52 public:
  53   ObjPtrQueue(PtrQueueSet* qset, bool perm = false) :
  54     // SATB queues are only active during marking cycles. We create
  55     // them with their active field set to false. If a thread is
  56     // created during a cycle and its SATB queue needs to be activated
  57     // before the thread starts running, we'll need to set its active
  58     // field to true. This is done in JavaThread::initialize_queues().
  59     PtrQueue(qset, perm, false /* active */) { }
  60 
  61   // Process queue entries and free resources.
  62   void flush();
  63 
  64   // Apply cl to the active part of the buffer.
  65   // Prerequisite: Must be at a safepoint.
  66   void apply_closure_and_empty(SATBBufferClosure* cl);
  67 
  68   // Overrides PtrQueue::should_enqueue_buffer(). See the method's
  69   // definition for more information.
  70   virtual bool should_enqueue_buffer();
  71 




  32 class SATBMarkQueueSet;
  33 
  34 // Base class for processing the contents of a SATB buffer.
  35 class SATBBufferClosure : public StackObj {
  36 protected:
  37   ~SATBBufferClosure() { }
  38 
  39 public:
  40   // Process the SATB entries in the designated buffer range.
  41   virtual void do_buffer(void** buffer, size_t size) = 0;
  42 };
  43 
  44 // A ptrQueue whose elements are "oops", pointers to object heads.
  45 class ObjPtrQueue: public PtrQueue {
  46   friend class SATBMarkQueueSet;
  47 
  48 private:
  49   // Filter out unwanted entries from the buffer.
  50   void filter();
  51 
  52   template <class HeapType>
  53   void filter_impl();
  54 
  55 public:
  56   ObjPtrQueue(PtrQueueSet* qset, bool perm = false) :
  57     // SATB queues are only active during marking cycles. We create
  58     // them with their active field set to false. If a thread is
  59     // created during a cycle and its SATB queue needs to be activated
  60     // before the thread starts running, we'll need to set its active
  61     // field to true. This is done in JavaThread::initialize_queues().
  62     PtrQueue(qset, perm, false /* active */) { }
  63 
  64   // Process queue entries and free resources.
  65   void flush();
  66 
  67   // Apply cl to the active part of the buffer.
  68   // Prerequisite: Must be at a safepoint.
  69   void apply_closure_and_empty(SATBBufferClosure* cl);
  70 
  71   // Overrides PtrQueue::should_enqueue_buffer(). See the method's
  72   // definition for more information.
  73   virtual bool should_enqueue_buffer();
  74 


< prev index next >