1 /*
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
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.
141 bool apply_closure_to_completed_buffer_helper(CardTableEntryClosure* cl,
142 uint worker_i,
143 BufferNode* nd);
144
145 BufferNode* get_completed_buffer(int stop_at);
146
147 // Applies the current closure to all completed buffers,
148 // non-consumptively.
149 void apply_closure_to_all_completed_buffers(CardTableEntryClosure* cl);
150
151 void reset_for_par_iteration() { _cur_par_buffer_node = _completed_buffers_head; }
152 // Applies the current closure to all completed buffers, non-consumptively.
153 // Parallel version.
154 void par_apply_closure_to_all_completed_buffers(CardTableEntryClosure* cl);
155
156 DirtyCardQueue* shared_dirty_card_queue() {
157 return &_shared_dirty_card_queue;
158 }
159
160 // Deallocate any completed log buffers
161 void clear();
162
163 // If a full collection is happening, reset partial logs, and ignore
|
1 /*
2 * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
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 BufferNode* get_completed_buffer(int stop_at);
141
142 // Applies the current closure to all completed buffers,
143 // non-consumptively.
144 void apply_closure_to_all_completed_buffers(CardTableEntryClosure* cl);
145
146 void reset_for_par_iteration() { _cur_par_buffer_node = _completed_buffers_head; }
147 // Applies the current closure to all completed buffers, non-consumptively.
148 // Parallel version.
149 void par_apply_closure_to_all_completed_buffers(CardTableEntryClosure* cl);
150
151 DirtyCardQueue* shared_dirty_card_queue() {
152 return &_shared_dirty_card_queue;
153 }
154
155 // Deallocate any completed log buffers
156 void clear();
157
158 // If a full collection is happening, reset partial logs, and ignore
|