Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @ 20481:c02ec279b062
8057768: Make heap region region type in G1 HeapRegion explicit
Reviewed-by: brutisso, tschatzl
author | brutisso |
---|---|
date | Tue, 16 Sep 2014 14:27:40 +0200 |
parents | 6701abbc4441 |
children | b840813adfcc |
comparison
equal
deleted
inserted
replaced
20478:00448aa81791 | 20481:c02ec279b062 |
---|---|
1662 } | 1662 } |
1663 | 1663 |
1664 // Add the heap region at the head of the non-incremental collection set | 1664 // Add the heap region at the head of the non-incremental collection set |
1665 void G1CollectorPolicy::add_old_region_to_cset(HeapRegion* hr) { | 1665 void G1CollectorPolicy::add_old_region_to_cset(HeapRegion* hr) { |
1666 assert(_inc_cset_build_state == Active, "Precondition"); | 1666 assert(_inc_cset_build_state == Active, "Precondition"); |
1667 assert(!hr->is_young(), "non-incremental add of young region"); | 1667 assert(hr->is_old(), "the region should be old"); |
1668 | 1668 |
1669 assert(!hr->in_collection_set(), "should not already be in the CSet"); | 1669 assert(!hr->in_collection_set(), "should not already be in the CSet"); |
1670 hr->set_in_collection_set(true); | 1670 hr->set_in_collection_set(true); |
1671 hr->set_next_in_collection_set(_collection_set); | 1671 hr->set_next_in_collection_set(_collection_set); |
1672 _collection_set = hr; | 1672 _collection_set = hr; |
1808 } | 1808 } |
1809 | 1809 |
1810 // Add the region at the RHS of the incremental cset | 1810 // Add the region at the RHS of the incremental cset |
1811 void G1CollectorPolicy::add_region_to_incremental_cset_rhs(HeapRegion* hr) { | 1811 void G1CollectorPolicy::add_region_to_incremental_cset_rhs(HeapRegion* hr) { |
1812 // We should only ever be appending survivors at the end of a pause | 1812 // We should only ever be appending survivors at the end of a pause |
1813 assert( hr->is_survivor(), "Logic"); | 1813 assert(hr->is_survivor(), "Logic"); |
1814 | 1814 |
1815 // Do the 'common' stuff | 1815 // Do the 'common' stuff |
1816 add_region_to_incremental_cset_common(hr); | 1816 add_region_to_incremental_cset_common(hr); |
1817 | 1817 |
1818 // Now add the region at the right hand side | 1818 // Now add the region at the right hand side |
1826 } | 1826 } |
1827 | 1827 |
1828 // Add the region to the LHS of the incremental cset | 1828 // Add the region to the LHS of the incremental cset |
1829 void G1CollectorPolicy::add_region_to_incremental_cset_lhs(HeapRegion* hr) { | 1829 void G1CollectorPolicy::add_region_to_incremental_cset_lhs(HeapRegion* hr) { |
1830 // Survivors should be added to the RHS at the end of a pause | 1830 // Survivors should be added to the RHS at the end of a pause |
1831 assert(!hr->is_survivor(), "Logic"); | 1831 assert(hr->is_eden(), "Logic"); |
1832 | 1832 |
1833 // Do the 'common' stuff | 1833 // Do the 'common' stuff |
1834 add_region_to_incremental_cset_common(hr); | 1834 add_region_to_incremental_cset_common(hr); |
1835 | 1835 |
1836 // Add the region at the left hand side | 1836 // Add the region at the left hand side |
1986 init_cset_region_lengths(eden_region_length, survivor_region_length); | 1986 init_cset_region_lengths(eden_region_length, survivor_region_length); |
1987 | 1987 |
1988 HeapRegion* hr = young_list->first_survivor_region(); | 1988 HeapRegion* hr = young_list->first_survivor_region(); |
1989 while (hr != NULL) { | 1989 while (hr != NULL) { |
1990 assert(hr->is_survivor(), "badly formed young list"); | 1990 assert(hr->is_survivor(), "badly formed young list"); |
1991 hr->set_young(); | 1991 // There is a convention that all the young regions in the CSet |
1992 // are tagged as "eden", so we do this for the survivors here. We | |
1993 // use the special set_eden_pre_gc() as it doesn't check that the | |
1994 // region is free (which is not the case here). | |
1995 hr->set_eden_pre_gc(); | |
1992 hr = hr->get_next_young_region(); | 1996 hr = hr->get_next_young_region(); |
1993 } | 1997 } |
1994 | 1998 |
1995 // Clear the fields that point to the survivor list - they are all young now. | 1999 // Clear the fields that point to the survivor list - they are all young now. |
1996 young_list->clear_survivors(); | 2000 young_list->clear_survivors(); |