@@ -84,7 +84,6 @@ struct G1HeapRegionAttr {
8484
8585 bool remset_is_tracked () const { return _remset_is_tracked != 0 ; }
8686
87- void set_new_survivor () { _type = NewSurvivor; }
8887 bool is_pinned () const { return _is_pinned != 0 ; }
8988
9089 void set_old () { _type = Old; }
@@ -132,10 +131,10 @@ class G1HeapRegionAttrBiasedMappedArray : public G1BiasedMappedArray<G1HeapRegio
132131 set_by_index (index, G1HeapRegionAttr (G1HeapRegionAttr::Optional, remset_is_tracked));
133132 }
134133
135- void set_new_survivor_region (uintptr_t index) {
134+ void set_new_survivor_region (uintptr_t index, bool region_is_pinned ) {
136135 assert (get_by_index (index).is_default (),
137136 " Region attributes at index " INTPTR_FORMAT " should be default but is %s" , index, get_by_index (index).get_type_str ());
138- get_ref_by_index (index)-> set_new_survivor ( );
137+ set_by_index (index, G1HeapRegionAttr (G1HeapRegionAttr::NewSurvivor, true , region_is_pinned) );
139138 }
140139
141140 void set_humongous_candidate (uintptr_t index) {
@@ -170,12 +169,10 @@ class G1HeapRegionAttrBiasedMappedArray : public G1BiasedMappedArray<G1HeapRegio
170169 set_by_index (index, G1HeapRegionAttr (G1HeapRegionAttr::Young, true , is_pinned));
171170 }
172171
173- void set_in_old (uintptr_t index, bool remset_is_tracked) {
172+ void set_in_old (uintptr_t index, bool remset_is_tracked, bool is_pinned ) {
174173 assert (get_by_index (index).is_default (),
175174 " Region attributes at index " INTPTR_FORMAT " should be default but is %s" , index, get_by_index (index).get_type_str ());
176- // We do not select regions with pinned objects into the collection set.
177- const bool region_is_pinned = false ;
178- set_by_index (index, G1HeapRegionAttr (G1HeapRegionAttr::Old, remset_is_tracked, region_is_pinned));
175+ set_by_index (index, G1HeapRegionAttr (G1HeapRegionAttr::Old, remset_is_tracked, is_pinned));
179176 }
180177
181178 bool is_in_cset_or_humongous_candidate (HeapWord* addr) const { return at (addr).is_in_cset_or_humongous_candidate (); }
0 commit comments