80 // Apply the closure to the elements of "node" from it's index to |
80 // Apply the closure to the elements of "node" from it's index to |
81 // buffer_size. If all closure applications return true, then |
81 // buffer_size. If all closure applications return true, then |
82 // returns true. Stops processing after the first closure |
82 // returns true. Stops processing after the first closure |
83 // application that returns false, and returns false from this |
83 // application that returns false, and returns false from this |
84 // function. If "consume" is true, the node's index is updated to |
84 // function. If "consume" is true, the node's index is updated to |
85 // follow the last processed element. |
85 // exclude the processed elements, e.g. up to the element for which |
|
86 // the closure returned false. |
86 bool apply_closure_to_buffer(CardTableEntryClosure* cl, |
87 bool apply_closure_to_buffer(CardTableEntryClosure* cl, |
87 BufferNode* node, |
88 BufferNode* node, |
88 bool consume, |
89 bool consume, |
89 uint worker_i = 0); |
90 uint worker_i = 0); |
90 |
91 |
119 // mutator threads to do card-processing work. |
120 // mutator threads to do card-processing work. |
120 static uint num_par_ids(); |
121 static uint num_par_ids(); |
121 |
122 |
122 static void handle_zero_index_for_thread(JavaThread* t); |
123 static void handle_zero_index_for_thread(JavaThread* t); |
123 |
124 |
124 // If there exists some completed buffer, pop it, then apply the |
125 // If there are more than stop_at completed buffers, pop one, apply |
125 // specified closure to its active elements. If all active elements |
126 // the specified closure to its active elements, and return true. |
126 // are processed, returns "true". If no completed buffers exist, |
127 // Otherwise return false. |
127 // returns false. If a completed buffer exists, but is only |
128 // |
128 // partially completed before a "yield" happens, the partially |
129 // A completely processed buffer is freed. However, if a closure |
129 // completed buffer (with its index updated to exclude the processed |
130 // invocation returns false, processing is stopped and the partially |
130 // elements) is returned to the completed buffer set, and this call |
131 // processed buffer (with its index updated to exclude the processed |
131 // returns false. |
132 // elements, e.g. up to the element for which the closure returned |
|
133 // false) is returned to the completed buffer set. |
|
134 // |
|
135 // If during_pause is true, stop_at must be zero, and the closure |
|
136 // must never return false. |
132 bool apply_closure_to_completed_buffer(CardTableEntryClosure* cl, |
137 bool apply_closure_to_completed_buffer(CardTableEntryClosure* cl, |
133 uint worker_i, |
138 uint worker_i, |
134 size_t stop_at, |
139 size_t stop_at, |
135 bool during_pause); |
140 bool during_pause); |
136 |
141 |