2727
2828#include " gc/g1/g1BufferNodeList.hpp"
2929#include " gc/g1/g1FreeIdSet.hpp"
30+ #include " gc/g1/g1CardTable.hpp"
3031#include " gc/g1/g1ConcurrentRefineStats.hpp"
3132#include " gc/shared/ptrQueue.hpp"
3233#include " memory/allocation.hpp"
@@ -41,9 +42,6 @@ class Thread;
4142class G1DirtyCardQueue : public PtrQueue {
4243 G1ConcurrentRefineStats* _refinement_stats;
4344
44- protected:
45- virtual void handle_completed_buffer ();
46-
4745public:
4846 G1DirtyCardQueue (G1DirtyCardQueueSet* qset);
4947
@@ -263,6 +261,19 @@ class G1DirtyCardQueueSet: public PtrQueueSet {
263261 // if none available.
264262 BufferNode* get_completed_buffer ();
265263
264+ // Called when queue is full or has no buffer.
265+ void handle_zero_index (G1DirtyCardQueue& queue);
266+
267+ // Enqueue the buffer, and optionally perform refinement by the mutator.
268+ // Mutator refinement is only done by Java threads, and only if there
269+ // are more than max_cards (possibly padded) cards in the completed
270+ // buffers. Updates stats.
271+ //
272+ // Mutator refinement, if performed, stops processing a buffer if
273+ // SuspendibleThreadSet::should_yield(), recording the incompletely
274+ // processed buffer for later processing of the remainder.
275+ void handle_completed_buffer (BufferNode* node, G1ConcurrentRefineStats* stats);
276+
266277public:
267278 G1DirtyCardQueueSet (BufferNode::Allocator* allocator);
268279 ~G1DirtyCardQueueSet ();
@@ -302,16 +313,8 @@ class G1DirtyCardQueueSet: public PtrQueueSet {
302313
303314 G1BufferNodeList take_all_completed_buffers ();
304315
305- // Helper for G1DirtyCardQueue::handle_completed_buffer().
306- // Enqueue the buffer, and optionally perform refinement by the mutator.
307- // Mutator refinement is only done by Java threads, and only if there
308- // are more than max_cards (possibly padded) cards in the completed
309- // buffers. Updates stats.
310- //
311- // Mutator refinement, if performed, stops processing a buffer if
312- // SuspendibleThreadSet::should_yield(), recording the incompletely
313- // processed buffer for later processing of the remainder.
314- void handle_completed_buffer (BufferNode* node, G1ConcurrentRefineStats* stats);
316+ using CardValue = G1CardTable::CardValue;
317+ void enqueue (G1DirtyCardQueue& queue, volatile CardValue* card_ptr);
315318
316319 // If there are more than stop_at cards in the completed buffers, pop
317320 // a buffer, refine its contents, and return true. Otherwise return
0 commit comments