299 |
299 |
300 uint survivor_region_length = young_list->survivor_length(); |
300 uint survivor_region_length = young_list->survivor_length(); |
301 uint eden_region_length = young_list->eden_length(); |
301 uint eden_region_length = young_list->eden_length(); |
302 init_region_lengths(eden_region_length, survivor_region_length); |
302 init_region_lengths(eden_region_length, survivor_region_length); |
303 |
303 |
304 HeapRegion* hr = young_list->first_survivor_region(); |
304 const GrowableArray<HeapRegion*>* survivor_regions = _g1->young_list()->survivor_regions(); |
305 while (hr != NULL) { |
305 for (GrowableArrayIterator<HeapRegion*> it = survivor_regions->begin(); |
|
306 it != survivor_regions->end(); |
|
307 ++it) { |
|
308 HeapRegion* hr = *it; |
306 assert(hr->is_survivor(), "badly formed young list"); |
309 assert(hr->is_survivor(), "badly formed young list"); |
307 // There is a convention that all the young regions in the CSet |
310 // There is a convention that all the young regions in the CSet |
308 // are tagged as "eden", so we do this for the survivors here. We |
311 // are tagged as "eden", so we do this for the survivors here. We |
309 // use the special set_eden_pre_gc() as it doesn't check that the |
312 // use the special set_eden_pre_gc() as it doesn't check that the |
310 // region is free (which is not the case here). |
313 // region is free (which is not the case here). |
311 hr->set_eden_pre_gc(); |
314 hr->set_eden_pre_gc(); |
312 hr = hr->get_next_young_region(); |
|
313 } |
315 } |
314 |
316 |
315 verify_young_cset_indices(); |
317 verify_young_cset_indices(); |
316 |
318 |
317 // Clear the fields that point to the survivor list - they are all young now. |
319 // Clear the fields that point to the survivor list - they are all young now. |