@@ -1531,6 +1531,13 @@ void ShenandoahHeap::op_final_mark() {
1531
1531
verifier ()->verify_before_evacuation ();
1532
1532
}
1533
1533
1534
+ // Remember limit for updating refs. It's guaranteed that we get no from-space-refs written
1535
+ // from here on.
1536
+ for (uint i = 0 ; i < num_regions (); i++) {
1537
+ ShenandoahHeapRegion* r = get_region (i);
1538
+ r->set_update_watermark (r->top ());
1539
+ }
1540
+
1534
1541
set_evacuation_in_progress (true );
1535
1542
// From here on, we need to update references.
1536
1543
set_has_forwarded_objects (true );
@@ -2391,13 +2398,13 @@ class ShenandoahUpdateHeapRefsTask : public AbstractGangTask {
2391
2398
ShenandoahHeapRegion* r = _regions->next ();
2392
2399
ShenandoahMarkingContext* const ctx = _heap->complete_marking_context ();
2393
2400
while (r != NULL ) {
2394
- HeapWord* top_at_start_ur = r->concurrent_iteration_safe_limit ();
2395
- assert (top_at_start_ur >= r->bottom (), " sanity" );
2401
+ HeapWord* update_watermark = r->get_update_watermark ();
2402
+ assert (update_watermark >= r->bottom (), " sanity" );
2396
2403
if (r->is_active () && !r->is_cset ()) {
2397
- _heap->marked_object_oop_iterate (r, &cl, top_at_start_ur );
2404
+ _heap->marked_object_oop_iterate (r, &cl, update_watermark );
2398
2405
}
2399
2406
if (ShenandoahPacing) {
2400
- _heap->pacer ()->report_updaterefs (pointer_delta (top_at_start_ur , r->bottom ()));
2407
+ _heap->pacer ()->report_updaterefs (pointer_delta (update_watermark , r->bottom ()));
2401
2408
}
2402
2409
if (_heap->check_cancelled_gc_and_yield (_concurrent)) {
2403
2410
return ;
@@ -2435,10 +2442,6 @@ void ShenandoahHeap::op_init_updaterefs() {
2435
2442
ShenandoahGCPhase phase (ShenandoahPhaseTimings::init_update_refs_prepare);
2436
2443
2437
2444
make_parsable (true );
2438
- for (uint i = 0 ; i < num_regions (); i++) {
2439
- ShenandoahHeapRegion* r = get_region (i);
2440
- r->set_concurrent_iteration_safe_limit (r->top ());
2441
- }
2442
2445
2443
2446
// Reset iterator.
2444
2447
_update_refs_iterator.reset ();
0 commit comments