hotspot/src/share/vm/gc_implementation/g1/satbQueue.hpp
changeset 27251 7d667f91ec8d
parent 25492 d27050bdfb04
child 28507 354ef83ee258
equal deleted inserted replaced
27250:cc55c7b61f08 27251:7d667f91ec8d
    76 
    76 
    77   void verify_oops_in_buffer() NOT_DEBUG_RETURN;
    77   void verify_oops_in_buffer() NOT_DEBUG_RETURN;
    78 };
    78 };
    79 
    79 
    80 class SATBMarkQueueSet: public PtrQueueSet {
    80 class SATBMarkQueueSet: public PtrQueueSet {
    81   ObjectClosure* _closure;
    81   ObjectClosure** _closures;  // One per ParGCThread.
    82   ObjectClosure** _par_closures;  // One per ParGCThread.
       
    83 
    82 
    84   ObjPtrQueue _shared_satb_queue;
    83   ObjPtrQueue _shared_satb_queue;
    85 
       
    86   // Utility function to support sequential and parallel versions.  If
       
    87   // "par" is true, then "worker" is the par thread id; if "false", worker
       
    88   // is ignored.
       
    89   bool apply_closure_to_completed_buffer_work(bool par, uint worker);
       
    90 
    84 
    91 #ifdef ASSERT
    85 #ifdef ASSERT
    92   void dump_active_states(bool expected_active);
    86   void dump_active_states(bool expected_active);
    93   void verify_active_states(bool expected_active);
    87   void verify_active_states(bool expected_active);
    94 #endif // ASSERT
    88 #endif // ASSERT
   109   void set_active_all_threads(bool active, bool expected_active);
   103   void set_active_all_threads(bool active, bool expected_active);
   110 
   104 
   111   // Filter all the currently-active SATB buffers.
   105   // Filter all the currently-active SATB buffers.
   112   void filter_thread_buffers();
   106   void filter_thread_buffers();
   113 
   107 
   114   // Register "blk" as "the closure" for all queues.  Only one such closure
   108   // Register closure for the given worker thread. The "apply_closure_to_completed_buffer"
   115   // is allowed.  The "apply_closure_to_completed_buffer" method will apply
   109   // method will apply this closure to a completed buffer, and "iterate_closure_all_threads"
   116   // this closure to a completed buffer, and "iterate_closure_all_threads"
       
   117   // applies it to partially-filled buffers (the latter should only be done
   110   // applies it to partially-filled buffers (the latter should only be done
   118   // with the world stopped).
   111   // with the world stopped).
   119   void set_closure(ObjectClosure* closure);
   112   void set_closure(uint worker, ObjectClosure* closure);
   120   // Set the parallel closures: pointer is an array of pointers to
       
   121   // closures, one for each parallel GC thread.
       
   122   void set_par_closure(int i, ObjectClosure* closure);
       
   123 
   113 
   124   // If there exists some completed buffer, pop it, then apply the
   114   // If there exists some completed buffer, pop it, then apply the
   125   // registered closure to all its elements, and return true.  If no
   115   // registered closure to all its elements, and return true.  If no
   126   // completed buffers exist, return false.
   116   // completed buffers exist, return false.
   127   bool apply_closure_to_completed_buffer() {
   117   bool apply_closure_to_completed_buffer(uint worker);
   128     return apply_closure_to_completed_buffer_work(false, 0);
       
   129   }
       
   130   // Parallel version of the above.
       
   131   bool par_apply_closure_to_completed_buffer(uint worker) {
       
   132     return apply_closure_to_completed_buffer_work(true, worker);
       
   133   }
       
   134 
   118 
   135   // Apply the given closure on enqueued and currently-active buffers
   119   // Apply the given closure on enqueued and currently-active buffers
   136   // respectively. Both methods are read-only, i.e., they do not
   120   // respectively. Both methods are read-only, i.e., they do not
   137   // modify any of the buffers.
   121   // modify any of the buffers.
   138   void iterate_completed_buffers_read_only(ObjectClosure* cl);
   122   void iterate_completed_buffers_read_only(ObjectClosure* cl);