164 }
165
166 G1HeapRegionAttr G1CollectedHeap::region_attr(const void* addr) const {
167 return _region_attr.at((HeapWord*)addr);
168 }
169
170 G1HeapRegionAttr G1CollectedHeap::region_attr(uint idx) const {
171 return _region_attr.get_by_index(idx);
172 }
173
174 void G1CollectedHeap::register_humongous_region_with_region_attr(uint index) {
175 _region_attr.set_humongous(index, region_at(index)->rem_set()->is_tracked());
176 }
177
178 void G1CollectedHeap::register_region_with_region_attr(HeapRegion* r) {
179 _region_attr.set_has_remset(r->hrm_index(), r->rem_set()->is_tracked());
180 }
181
182 void G1CollectedHeap::register_old_region_with_region_attr(HeapRegion* r) {
183 _region_attr.set_in_old(r->hrm_index(), r->rem_set()->is_tracked());
184 _rem_set->prepare_for_scan_heap_roots(r->hrm_index());
185 }
186
187 void G1CollectedHeap::register_optional_region_with_region_attr(HeapRegion* r) {
188 _region_attr.set_optional(r->hrm_index(), r->rem_set()->is_tracked());
189 }
190
191 #ifndef PRODUCT
192 // Support for G1EvacuationFailureALot
193
194 inline bool
195 G1CollectedHeap::evacuation_failure_alot_for_gc_type(bool for_young_gc,
196 bool during_initial_mark,
197 bool mark_or_rebuild_in_progress) {
198 bool res = false;
199 if (mark_or_rebuild_in_progress) {
200 res |= G1EvacuationFailureALotDuringConcMark;
201 }
202 if (during_initial_mark) {
203 res |= G1EvacuationFailureALotDuringInitialMark;
204 }
|
164 }
165
166 G1HeapRegionAttr G1CollectedHeap::region_attr(const void* addr) const {
167 return _region_attr.at((HeapWord*)addr);
168 }
169
170 G1HeapRegionAttr G1CollectedHeap::region_attr(uint idx) const {
171 return _region_attr.get_by_index(idx);
172 }
173
174 void G1CollectedHeap::register_humongous_region_with_region_attr(uint index) {
175 _region_attr.set_humongous(index, region_at(index)->rem_set()->is_tracked());
176 }
177
178 void G1CollectedHeap::register_region_with_region_attr(HeapRegion* r) {
179 _region_attr.set_has_remset(r->hrm_index(), r->rem_set()->is_tracked());
180 }
181
182 void G1CollectedHeap::register_old_region_with_region_attr(HeapRegion* r) {
183 _region_attr.set_in_old(r->hrm_index(), r->rem_set()->is_tracked());
184 _rem_set->exclude_region_from_scan(r->hrm_index());
185 }
186
187 void G1CollectedHeap::register_optional_region_with_region_attr(HeapRegion* r) {
188 _region_attr.set_optional(r->hrm_index(), r->rem_set()->is_tracked());
189 }
190
191 #ifndef PRODUCT
192 // Support for G1EvacuationFailureALot
193
194 inline bool
195 G1CollectedHeap::evacuation_failure_alot_for_gc_type(bool for_young_gc,
196 bool during_initial_mark,
197 bool mark_or_rebuild_in_progress) {
198 bool res = false;
199 if (mark_or_rebuild_in_progress) {
200 res |= G1EvacuationFailureALotDuringConcMark;
201 }
202 if (during_initial_mark) {
203 res |= G1EvacuationFailureALotDuringInitialMark;
204 }
|