< prev index next >

src/share/vm/gc/g1/dirtyCardQueue.hpp

Print this page
rev 10335 : imported patch bufnode_params

@@ -50,25 +50,26 @@
   ~DirtyCardQueue();
 
   // Process queue entries and release resources.
   void flush() { flush_impl(); }
 
-  // Apply the closure to all elements, and reset the index to make the
-  // buffer empty.  If a closure application returns "false", return
-  // "false" immediately, halting the iteration.  If "consume" is true,
-  // deletes processed entries from logs.
+  // Apply the closure to all active elements, from index to size.  If
+  // all closure applications return true, then returns true.  Stops
+  // processing after the first false closure application and returns
+  // false.  If "consume" is true, index is updated to follow the last
+  // processed element.
   bool apply_closure(CardTableEntryClosure* cl,
                      bool consume = true,
                      uint worker_i = 0);
 
-  // Apply the closure to all elements of "buf", down to "index"
-  // (inclusive.)  If returns "false", then a closure application returned
-  // "false", and we return immediately.  If "consume" is true, entries are
-  // set to NULL as they are processed, so they will not be processed again
-  // later.
+  // Apply the closure to all active elements of "node", from it's
+  // index to sz.  If all closure applications return true, then
+  // returns true.  Stops processing after the first false closure
+  // application and returns false.  If "consume" is true, the node's
+  // index is updated to follow the last processed element.
   static bool apply_closure_to_buffer(CardTableEntryClosure* cl,
-                                      void** buf, size_t index, size_t sz,
+                                      BufferNode* node, size_t sz,
                                       bool consume = true,
                                       uint worker_i = 0);
   void **get_buf() { return _buf;}
   size_t get_index() { return _index;}
   void reinitialize() { _buf = 0; _sz = 0; _index = 0;}

@@ -93,11 +94,11 @@
   CardTableEntryClosure* _mut_process_closure;
 
   DirtyCardQueue _shared_dirty_card_queue;
 
   // Override.
-  bool mut_process_buffer(void** buf);
+  bool mut_process_buffer(BufferNode* node);
 
   // Protected by the _cbl_mon.
   FreeIdSet* _free_ids;
 
   // The number of completed buffers processed by mutator and rs thread,

@@ -105,10 +106,13 @@
   jint _processed_buffers_mut;
   jint _processed_buffers_rs_thread;
 
   // Current buffer node used for parallel iteration.
   BufferNode* volatile _cur_par_buffer_node;
+
+  void concatenate_log(DirtyCardQueue& dcq);
+
 public:
   DirtyCardQueueSet(bool notify_when_complete = true);
 
   void initialize(CardTableEntryClosure* cl,
                   Monitor* cbl_mon,

@@ -124,30 +128,28 @@
   static uint num_par_ids();
 
   static void handle_zero_index_for_thread(JavaThread* t);
 
   // If there exists some completed buffer, pop it, then apply the
-  // specified closure to all its elements, nulling out those elements
-  // processed.  If all elements are processed, returns "true".  If no
-  // completed buffers exist, returns false.  If a completed buffer exists,
-  // but is only partially completed before a "yield" happens, the
-  // partially completed buffer (with its processed elements set to NULL)
-  // is returned to the completed buffer set, and this call returns false.
+  // specified closure to its active elements.  If all active elements
+  // are processed, returns "true".  If no completed buffers exist,
+  // returns false.  If a completed buffer exists, but is only
+  // partially completed before a "yield" happens, the partially
+  // completed buffer (with its index updated to exclude the processed
+  // eleemnts) is returned to the completed buffer set, and this call
+  // returns false.
   bool apply_closure_to_completed_buffer(CardTableEntryClosure* cl,
                                          uint worker_i,
                                          size_t stop_at,
                                          bool during_pause);
 
   BufferNode* get_completed_buffer(size_t stop_at);
 
-  // Applies the current closure to all completed buffers,
-  // non-consumptively.
-  void apply_closure_to_all_completed_buffers(CardTableEntryClosure* cl);
-
   void reset_for_par_iteration() { _cur_par_buffer_node = _completed_buffers_head; }
   // Applies the current closure to all completed buffers, non-consumptively.
-  // Parallel version.
+  // Can be used in parallel, all callers using the iteration state initialized
+  // by reset_for_par_iteration.
   void par_apply_closure_to_all_completed_buffers(CardTableEntryClosure* cl);
 
   DirtyCardQueue* shared_dirty_card_queue() {
     return &_shared_dirty_card_queue;
   }
< prev index next >