1.1 --- a/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Tue Sep 16 11:03:19 2014 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp Tue Sep 16 14:27:40 2014 +0200 1.3 @@ -1664,7 +1664,7 @@ 1.4 // Add the heap region at the head of the non-incremental collection set 1.5 void G1CollectorPolicy::add_old_region_to_cset(HeapRegion* hr) { 1.6 assert(_inc_cset_build_state == Active, "Precondition"); 1.7 - assert(!hr->is_young(), "non-incremental add of young region"); 1.8 + assert(hr->is_old(), "the region should be old"); 1.9 1.10 assert(!hr->in_collection_set(), "should not already be in the CSet"); 1.11 hr->set_in_collection_set(true); 1.12 @@ -1810,7 +1810,7 @@ 1.13 // Add the region at the RHS of the incremental cset 1.14 void G1CollectorPolicy::add_region_to_incremental_cset_rhs(HeapRegion* hr) { 1.15 // We should only ever be appending survivors at the end of a pause 1.16 - assert( hr->is_survivor(), "Logic"); 1.17 + assert(hr->is_survivor(), "Logic"); 1.18 1.19 // Do the 'common' stuff 1.20 add_region_to_incremental_cset_common(hr); 1.21 @@ -1828,7 +1828,7 @@ 1.22 // Add the region to the LHS of the incremental cset 1.23 void G1CollectorPolicy::add_region_to_incremental_cset_lhs(HeapRegion* hr) { 1.24 // Survivors should be added to the RHS at the end of a pause 1.25 - assert(!hr->is_survivor(), "Logic"); 1.26 + assert(hr->is_eden(), "Logic"); 1.27 1.28 // Do the 'common' stuff 1.29 add_region_to_incremental_cset_common(hr); 1.30 @@ -1988,7 +1988,11 @@ 1.31 HeapRegion* hr = young_list->first_survivor_region(); 1.32 while (hr != NULL) { 1.33 assert(hr->is_survivor(), "badly formed young list"); 1.34 - hr->set_young(); 1.35 + // There is a convention that all the young regions in the CSet 1.36 + // are tagged as "eden", so we do this for the survivors here. We 1.37 + // use the special set_eden_pre_gc() as it doesn't check that the 1.38 + // region is free (which is not the case here). 1.39 + hr->set_eden_pre_gc(); 1.40 hr = hr->get_next_young_region(); 1.41 } 1.42