--- old/src/share/vm/gc/g1/g1CollectedHeap.cpp 2017-08-08 17:40:28.267390181 -0400 +++ new/src/share/vm/gc/g1/g1CollectedHeap.cpp 2017-08-08 17:40:26.967316299 -0400 @@ -662,8 +662,8 @@ } bool G1CollectedHeap::alloc_archive_regions(MemRegion* ranges, - size_t count, - bool open) { + size_t count, + bool open) { assert(!is_init_completed(), "Expect to be called at JVM init time"); assert(ranges != NULL, "MemRegion array NULL"); assert(count != 0, "No MemRegions provided"); @@ -719,7 +719,7 @@ // Perform the actual region allocation, exiting if it fails. // Then note how much new space we have allocated. if (!_hrm.allocate_containing_regions(curr_range, &commits, workers())) { - return false; + return false; } increase_used(word_size * HeapWordSize); if (commits != 0) { @@ -745,19 +745,19 @@ } _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; - curr_region->set_top(top); - curr_region->set_first_dead(top); - curr_region->set_end_of_live(top); - curr_region = NULL; + 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 = next_region; } // Notify mark-sweep of the archive