170 if (is_concurrent_young_mark_in_progress() && is_in_young(obj) && !marking_context()->allocated_after_mark_start(obj)) {
171 // We are marking young, this object is in young, and it is below the TAMS
172 return true;
173 }
174
175 if (is_in_old(obj)) {
176 // Card marking barriers are required for objects in the old generation
177 return true;
178 }
179
180 if (has_forwarded_objects()) {
181 // Object may have pointers that need to be updated
182 return true;
183 }
184
185 return false;
186 }
187
188 void ShenandoahGenerationalHeap::evacuate_collection_set(ShenandoahGeneration* generation, bool concurrent) {
189 ShenandoahRegionIterator regions;
190 ShenandoahGenerationalEvacuationTask task(this, generation, ®ions, concurrent, false /* only promote regions */);
191 workers()->run_task(&task);
192 }
193
194 void ShenandoahGenerationalHeap::promote_regions_in_place(ShenandoahGeneration* generation, bool concurrent) {
195 ShenandoahRegionIterator regions;
196 ShenandoahGenerationalEvacuationTask task(this, generation, ®ions, concurrent, true /* only promote regions */);
197 workers()->run_task(&task);
198 }
199
200 oop ShenandoahGenerationalHeap::evacuate_object(oop p, Thread* thread) {
201 assert(thread == Thread::current(), "Expected thread parameter to be current thread.");
202 if (ShenandoahThreadLocalData::is_oom_during_evac(thread)) {
203 // This thread went through the OOM during evac protocol and it is safe to return
204 // the forward pointer. It must not attempt to evacuate anymore.
205 return ShenandoahBarrierSet::resolve_forwarded(p);
206 }
207
208 assert(ShenandoahThreadLocalData::is_evac_allowed(thread), "must be enclosed in oom-evac scope");
209
210 ShenandoahHeapRegion* from_region = heap_region_containing(p);
|
170 if (is_concurrent_young_mark_in_progress() && is_in_young(obj) && !marking_context()->allocated_after_mark_start(obj)) {
171 // We are marking young, this object is in young, and it is below the TAMS
172 return true;
173 }
174
175 if (is_in_old(obj)) {
176 // Card marking barriers are required for objects in the old generation
177 return true;
178 }
179
180 if (has_forwarded_objects()) {
181 // Object may have pointers that need to be updated
182 return true;
183 }
184
185 return false;
186 }
187
188 void ShenandoahGenerationalHeap::evacuate_collection_set(ShenandoahGeneration* generation, bool concurrent) {
189 ShenandoahRegionIterator regions;
190 ShenandoahGenerationalEvacuationTask task(this, generation, ®ions, concurrent,
191 (ShenandoahGCStateCheckHotpatch ? collection_set()->is_empty() : false) /* only promote regions */);
192 workers()->run_task(&task);
193 }
194
195 void ShenandoahGenerationalHeap::promote_regions_in_place(ShenandoahGeneration* generation, bool concurrent) {
196 ShenandoahRegionIterator regions;
197 ShenandoahGenerationalEvacuationTask task(this, generation, ®ions, concurrent, true /* only promote regions */);
198 workers()->run_task(&task);
199 }
200
201 oop ShenandoahGenerationalHeap::evacuate_object(oop p, Thread* thread) {
202 assert(thread == Thread::current(), "Expected thread parameter to be current thread.");
203 if (ShenandoahThreadLocalData::is_oom_during_evac(thread)) {
204 // This thread went through the OOM during evac protocol and it is safe to return
205 // the forward pointer. It must not attempt to evacuate anymore.
206 return ShenandoahBarrierSet::resolve_forwarded(p);
207 }
208
209 assert(ShenandoahThreadLocalData::is_evac_allowed(thread), "must be enclosed in oom-evac scope");
210
211 ShenandoahHeapRegion* from_region = heap_region_containing(p);
|