< prev index next >

src/share/vm/gc/g1/g1CollectedHeap.cpp

Print this page

        

@@ -743,23 +743,23 @@
       } else {
         curr_region->set_closed_archive();
       }
       _hr_printer.alloc(curr_region);
       _old_set.add(curr_region);
+      HeapWord* top;
+      HeapRegion* next_region;
       if (curr_region != last_region) {
-        HeapWord* top = curr_region->end();
-        curr_region->set_top(top);
-        curr_region->set_first_dead(top);
-        curr_region->set_end_of_live(top);
-        curr_region = _hrm.next_region_in_heap(curr_region);
+        top = curr_region->end();
+        next_region = _hrm.next_region_in_heap(curr_region);
       } else {
-        HeapWord* top = last_address + 1;
+        top = last_address + 1;
+        next_region = NULL;
+      }
         curr_region->set_top(top);
         curr_region->set_first_dead(top);
         curr_region->set_end_of_live(top);
-        curr_region = NULL;
-      }
+      curr_region = next_region;
     }
 
     // Notify mark-sweep of the archive
     G1ArchiveAllocator::set_range_archive(curr_range, open);
   }
< prev index next >