hotspot/src/share/vm/gc/g1/g1CollectionSet.cpp
changeset 38162 4e2c3433a3ae
parent 38109 6503703df058
child 38183 cb68e4923223
--- a/hotspot/src/share/vm/gc/g1/g1CollectionSet.cpp	Mon May 02 12:44:25 2016 +0200
+++ b/hotspot/src/share/vm/gc/g1/g1CollectionSet.cpp	Wed Apr 27 16:11:45 2016 +0200
@@ -301,15 +301,17 @@
   uint eden_region_length = young_list->eden_length();
   init_region_lengths(eden_region_length, survivor_region_length);
 
-  HeapRegion* hr = young_list->first_survivor_region();
-  while (hr != NULL) {
+  const GrowableArray<HeapRegion*>* survivor_regions = _g1->young_list()->survivor_regions();
+  for (GrowableArrayIterator<HeapRegion*> it = survivor_regions->begin();
+       it != survivor_regions->end();
+       ++it) {
+    HeapRegion* hr = *it;
     assert(hr->is_survivor(), "badly formed young list");
     // There is a convention that all the young regions in the CSet
     // are tagged as "eden", so we do this for the survivors here. We
     // use the special set_eden_pre_gc() as it doesn't check that the
     // region is free (which is not the case here).
     hr->set_eden_pre_gc();
-    hr = hr->get_next_young_region();
   }
 
   verify_young_cset_indices();