212
213 void verify_young_cset_indices() const NOT_DEBUG_RETURN;
214
215 double predict_region_elapsed_time_ms(HeapRegion* hr);
216
217 // Update the incremental collection set information when adding a region.
218 void add_young_region_common(HeapRegion* hr);
219
220 // Add old region "hr" to the collection set.
221 void add_old_region(HeapRegion* hr);
222 void free_optional_regions();
223
224 // Add old region "hr" to optional collection set.
225 void add_optional_region(HeapRegion* hr);
226
227 void move_candidates_to_collection_set(uint num_regions);
228
229 // Finalize the young part of the initial collection set. Relabel survivor regions
230 // as Eden and calculate a prediction on how long the evacuation of all young regions
231 // will take.
232 double finalize_young_part(double target_pause_time_ms, G1SurvivorRegions* survivors);
233 // Perform any final calculations on the incremental collection set fields before we
234 // can use them.
235 void finalize_incremental_building();
236
237 // Select the old regions of the initial collection set and determine how many optional
238 // regions we might be able to evacuate in this pause.
239 void finalize_old_part(double time_remaining_ms);
240 public:
241 G1CollectionSet(G1CollectedHeap* g1h, G1Policy* policy);
242 ~G1CollectionSet();
243
244 // Initializes the collection set giving the maximum possible length of the collection set.
245 void initialize(uint max_region_length);
246
247 void clear_candidates();
248
249 void set_candidates(G1CollectionSetCandidates* candidates) {
250 assert(_candidates == NULL, "Trying to replace collection set candidates.");
251 _candidates = candidates;
252 }
282 void iterate_incremental_part_from(HeapRegionClosure* cl, uint worker_id, uint total_workers) const;
283
284 // Iterate over the entire collection set (all increments calculated so far), applying
285 // the given HeapRegionClosure on all of them.
286 void iterate(HeapRegionClosure* cl) const;
287
288 void iterate_optional(HeapRegionClosure* cl) const;
289
290 size_t recorded_rs_lengths() { return _recorded_rs_lengths; }
291
292 size_t bytes_used_before() const {
293 return _bytes_used_before;
294 }
295
296 void reset_bytes_used_before() {
297 _bytes_used_before = 0;
298 }
299
300 // Finalize the initial collection set consisting of all young regions potentially a
301 // few old gen regions.
302 void finalize_initial_collection_set(double target_pause_time_ms, G1SurvivorRegions* survivor);
303 // Finalize the next collection set from the set of available optional old gen regions.
304 bool finalize_optional_for_evacuation(double remaining_pause_time);
305 // Abandon (clean up) optional collection set regions that were not evacuated in this
306 // pause.
307 void abandon_optional_collection_set(G1ParScanThreadStateSet* pss);
308
309 // Update information about hr in the aggregated information for
310 // the incrementally built collection set.
311 void update_young_region_prediction(HeapRegion* hr, size_t new_rs_length);
312
313 // Add eden region to the collection set.
314 void add_eden_region(HeapRegion* hr);
315
316 // Add survivor region to the collection set.
317 void add_survivor_regions(HeapRegion* hr);
318
319 #ifndef PRODUCT
320 bool verify_young_ages();
321
322 void print(outputStream* st);
|
212
213 void verify_young_cset_indices() const NOT_DEBUG_RETURN;
214
215 double predict_region_elapsed_time_ms(HeapRegion* hr);
216
217 // Update the incremental collection set information when adding a region.
218 void add_young_region_common(HeapRegion* hr);
219
220 // Add old region "hr" to the collection set.
221 void add_old_region(HeapRegion* hr);
222 void free_optional_regions();
223
224 // Add old region "hr" to optional collection set.
225 void add_optional_region(HeapRegion* hr);
226
227 void move_candidates_to_collection_set(uint num_regions);
228
229 // Finalize the young part of the initial collection set. Relabel survivor regions
230 // as Eden and calculate a prediction on how long the evacuation of all young regions
231 // will take.
232 double finalize_young_part(double target_pause_time_ms);
233 // Perform any final calculations on the incremental collection set fields before we
234 // can use them.
235 void finalize_incremental_building();
236
237 // Select the old regions of the initial collection set and determine how many optional
238 // regions we might be able to evacuate in this pause.
239 void finalize_old_part(double time_remaining_ms);
240 public:
241 G1CollectionSet(G1CollectedHeap* g1h, G1Policy* policy);
242 ~G1CollectionSet();
243
244 // Initializes the collection set giving the maximum possible length of the collection set.
245 void initialize(uint max_region_length);
246
247 void clear_candidates();
248
249 void set_candidates(G1CollectionSetCandidates* candidates) {
250 assert(_candidates == NULL, "Trying to replace collection set candidates.");
251 _candidates = candidates;
252 }
282 void iterate_incremental_part_from(HeapRegionClosure* cl, uint worker_id, uint total_workers) const;
283
284 // Iterate over the entire collection set (all increments calculated so far), applying
285 // the given HeapRegionClosure on all of them.
286 void iterate(HeapRegionClosure* cl) const;
287
288 void iterate_optional(HeapRegionClosure* cl) const;
289
290 size_t recorded_rs_lengths() { return _recorded_rs_lengths; }
291
292 size_t bytes_used_before() const {
293 return _bytes_used_before;
294 }
295
296 void reset_bytes_used_before() {
297 _bytes_used_before = 0;
298 }
299
300 // Finalize the initial collection set consisting of all young regions potentially a
301 // few old gen regions.
302 void finalize_initial_collection_set(double target_pause_time_ms);
303 // Finalize the next collection set from the set of available optional old gen regions.
304 bool finalize_optional_for_evacuation(double remaining_pause_time);
305 // Abandon (clean up) optional collection set regions that were not evacuated in this
306 // pause.
307 void abandon_optional_collection_set(G1ParScanThreadStateSet* pss);
308
309 // Update information about hr in the aggregated information for
310 // the incrementally built collection set.
311 void update_young_region_prediction(HeapRegion* hr, size_t new_rs_length);
312
313 // Add eden region to the collection set.
314 void add_eden_region(HeapRegion* hr);
315
316 // Add survivor region to the collection set.
317 void add_survivor_regions(HeapRegion* hr);
318
319 #ifndef PRODUCT
320 bool verify_young_ages();
321
322 void print(outputStream* st);
|