1 /*
2 * Copyright (c) 2014, 2025, 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 *
157 // be refined concurrently. Calculation is done on a best-effort basis.
158 size_t num_cards_pending() const;
159 // Number of cards newly generated by references into evacuation failed regions.
160 // Calculation is done on a best-effort basis.
161 size_t num_cards_from_evac_failure() const;
162 // Sum of cards marked by evacuation. Contains both pending cards as well as cards
163 // into the next collection set (e.g. survivors).
164 size_t num_cards_marked() const;
165
166 // Pass locally gathered statistics to global state. Returns the total number of
167 // HeapWords copied.
168 size_t flush_stats(size_t* surviving_young_words, uint num_workers);
169
170 #if TASKQUEUE_STATS
171 PartialArrayTaskStats* partial_array_task_stats();
172 #endif // TASKQUEUE_STATS
173
174 private:
175 void do_partial_array(PartialArrayState* state, bool stolen);
176 void start_partial_objarray(oop from, oop to);
177
178 HeapWord* allocate_copy_slow(G1HeapRegionAttr* dest_attr,
179 Klass* klass,
180 size_t word_sz,
181 uint age,
182 uint node_index);
183
184 void undo_allocation(G1HeapRegionAttr dest_addr,
185 HeapWord* obj_ptr,
186 size_t word_sz,
187 uint node_index);
188
189 void update_bot_after_copying(oop obj, size_t word_sz);
190
191 void do_iterate_object(oop const obj,
192 oop const old,
193 Klass* const klass,
194 G1HeapRegionAttr const region_attr,
195 G1HeapRegionAttr const dest_attr,
196 uint age);
|
1 /*
2 * Copyright (c) 2014, 2026, 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 *
157 // be refined concurrently. Calculation is done on a best-effort basis.
158 size_t num_cards_pending() const;
159 // Number of cards newly generated by references into evacuation failed regions.
160 // Calculation is done on a best-effort basis.
161 size_t num_cards_from_evac_failure() const;
162 // Sum of cards marked by evacuation. Contains both pending cards as well as cards
163 // into the next collection set (e.g. survivors).
164 size_t num_cards_marked() const;
165
166 // Pass locally gathered statistics to global state. Returns the total number of
167 // HeapWords copied.
168 size_t flush_stats(size_t* surviving_young_words, uint num_workers);
169
170 #if TASKQUEUE_STATS
171 PartialArrayTaskStats* partial_array_task_stats();
172 #endif // TASKQUEUE_STATS
173
174 private:
175 void do_partial_array(PartialArrayState* state, bool stolen);
176 void start_partial_objarray(oop from, oop to);
177 void process_array_chunk(objArrayOop obj, size_t start, size_t end);
178
179 HeapWord* allocate_copy_slow(G1HeapRegionAttr* dest_attr,
180 Klass* klass,
181 size_t word_sz,
182 uint age,
183 uint node_index);
184
185 void undo_allocation(G1HeapRegionAttr dest_addr,
186 HeapWord* obj_ptr,
187 size_t word_sz,
188 uint node_index);
189
190 void update_bot_after_copying(oop obj, size_t word_sz);
191
192 void do_iterate_object(oop const obj,
193 oop const old,
194 Klass* const klass,
195 G1HeapRegionAttr const region_attr,
196 G1HeapRegionAttr const dest_attr,
197 uint age);
|