RFR: Fix satb barrier for object array copy [v4]

Kelvin Nilsen kdnilsen at openjdk.org
Fri Mar 31 16:23:18 UTC 2023


On Fri, 31 Mar 2023 15:38:56 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.inline.hpp line 461:
>> 
>>> 459:       assert(_heap->mode()->is_generational(), "Invariant");
>>> 460:       ShenandoahHeapRegion* r = _heap->heap_region_containing(array_addr);
>>> 461:       if (r->is_old() && (array_addr < _heap->marking_context()->top_at_mark_start(r))) {
>> 
>> Why not use `!_heap->marking_context()->allocated_after_mark_start(array_addr)` as other branches do? Or replace other `!_heap->marking_context()->allocated_after_mark_start(array_addr)` with `array_addr < _heap->marking_context()->top_at_mark_start(r))` to avoid a second region look up?
>
> Thanks.  I'll replace all.  (I was initially thinking I should minimize my impact on code unrelated to my change, but agree as written makes it hard to read.)

done

-------------

PR Review Comment: https://git.openjdk.org/shenandoah/pull/237#discussion_r1154664088


More information about the shenandoah-dev mailing list