@@ -144,43 +144,8 @@ oop ShenandoahBarrierSet::load_reference_barrier_mutator_work(oop obj, T* load_a
144
144
if (obj == fwd) {
145
145
assert (_heap->is_gc_in_progress_mask (ShenandoahHeap::EVACUATION | ShenandoahHeap::TRAVERSAL),
146
146
" evac should be in progress" );
147
-
148
- ShenandoahEvacOOMScope oom_evac_scope;
149
-
150
- Thread* thread = Thread::current ();
151
- oop res_oop = _heap->evacuate_object (obj, thread);
152
-
153
- // Since we are already here and paid the price of getting through runtime call adapters
154
- // and acquiring oom-scope, it makes sense to try and evacuate more adjacent objects,
155
- // thus amortizing the overhead. For sparsely live heaps, scan costs easily dominate
156
- // total assist costs, and can introduce a lot of evacuation latency. This is why we
157
- // only scan for _nearest_ N objects, regardless if they are eligible for evac or not.
158
- // The scan itself should also avoid touching the non-marked objects below TAMS, because
159
- // their metadata (notably, klasses) may be incorrect already.
160
-
161
- size_t max = ShenandoahEvacAssist;
162
- if (max > 0 ) {
163
- // Traversal is special: it uses incomplete marking context, because it coalesces evac with mark.
164
- // Other code uses complete marking context, because evac happens after the mark.
165
- ShenandoahMarkingContext* ctx = _heap->is_concurrent_traversal_in_progress () ?
166
- _heap->marking_context () : _heap->complete_marking_context ();
167
-
168
- ShenandoahHeapRegion* r = _heap->heap_region_containing (obj);
169
- assert (r->is_cset (), " sanity" );
170
-
171
- HeapWord* cur = cast_from_oop<HeapWord*>(obj) + obj->size ();
172
-
173
- size_t count = 0 ;
174
- while ((cur < r->top ()) && ctx->is_marked (oop (cur)) && (count++ < max)) {
175
- oop cur_oop = oop (cur);
176
- if (cur_oop == resolve_forwarded_not_null_mutator (cur_oop)) {
177
- _heap->evacuate_object (cur_oop, thread);
178
- }
179
- cur = cur + cur_oop->size ();
180
- }
181
- }
182
-
183
- fwd = res_oop;
147
+ ShenandoahEvacOOMScope scope;
148
+ fwd = _heap->evacuate_object (obj, Thread::current ());
184
149
}
185
150
186
151
if (load_addr != NULL && fwd != obj) {
0 commit comments