99
100 // Protected by the _cbl_mon.
101 FreeIdSet* _free_ids;
102
103 // The number of completed buffers processed by mutator and rs thread,
104 // respectively.
105 jint _processed_buffers_mut;
106 jint _processed_buffers_rs_thread;
107
108 // Current buffer node used for parallel iteration.
109 BufferNode* volatile _cur_par_buffer_node;
110 public:
111 DirtyCardQueueSet(bool notify_when_complete = true);
112
113 void initialize(CardTableEntryClosure* cl,
114 Monitor* cbl_mon,
115 Mutex* fl_lock,
116 int process_completed_threshold,
117 int max_completed_queue,
118 Mutex* lock,
119 DirtyCardQueueSet* fl_owner = NULL);
120
121 // The number of parallel ids that can be claimed to allow collector or
122 // mutator threads to do card-processing work.
123 static uint num_par_ids();
124
125 static void handle_zero_index_for_thread(JavaThread* t);
126
127 // If there exists some completed buffer, pop it, then apply the
128 // specified closure to all its elements, nulling out those elements
129 // processed. If all elements are processed, returns "true". If no
130 // completed buffers exist, returns false. If a completed buffer exists,
131 // but is only partially completed before a "yield" happens, the
132 // partially completed buffer (with its processed elements set to NULL)
133 // is returned to the completed buffer set, and this call returns false.
134 bool apply_closure_to_completed_buffer(CardTableEntryClosure* cl,
135 uint worker_i = 0,
136 int stop_at = 0,
137 bool during_pause = false);
138
139 // Helper routine for the above.
|
99
100 // Protected by the _cbl_mon.
101 FreeIdSet* _free_ids;
102
103 // The number of completed buffers processed by mutator and rs thread,
104 // respectively.
105 jint _processed_buffers_mut;
106 jint _processed_buffers_rs_thread;
107
108 // Current buffer node used for parallel iteration.
109 BufferNode* volatile _cur_par_buffer_node;
110 public:
111 DirtyCardQueueSet(bool notify_when_complete = true);
112
113 void initialize(CardTableEntryClosure* cl,
114 Monitor* cbl_mon,
115 Mutex* fl_lock,
116 int process_completed_threshold,
117 int max_completed_queue,
118 Mutex* lock,
119 DirtyCardQueueSet* fl_owner,
120 bool init_free_ids = false);
121
122 // The number of parallel ids that can be claimed to allow collector or
123 // mutator threads to do card-processing work.
124 static uint num_par_ids();
125
126 static void handle_zero_index_for_thread(JavaThread* t);
127
128 // If there exists some completed buffer, pop it, then apply the
129 // specified closure to all its elements, nulling out those elements
130 // processed. If all elements are processed, returns "true". If no
131 // completed buffers exist, returns false. If a completed buffer exists,
132 // but is only partially completed before a "yield" happens, the
133 // partially completed buffer (with its processed elements set to NULL)
134 // is returned to the completed buffer set, and this call returns false.
135 bool apply_closure_to_completed_buffer(CardTableEntryClosure* cl,
136 uint worker_i = 0,
137 int stop_at = 0,
138 bool during_pause = false);
139
140 // Helper routine for the above.
|