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

Kelvin Nilsen kdnilsen at openjdk.org
Fri Mar 31 15:43:25 UTC 2023


On Thu, 30 Mar 2023 23:22:05 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> Kelvin Nilsen has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits:
>> 
>>  - Merge remote-tracking branch 'github/master' into fix-satb-barrier-for-object-array-copy
>>  - Fix typo in comment
>>  - Tidy up branch to make consistent with recompute-generation_usage PR
>>  - Integrate improvements to region-usage-accounting after full gc
>>  - Change name of phase5_restore_generation_usage
>>  - Fix comparison between array address and TAMS for old-gen collection
>>  - Merge remote-tracking branch 'GitFarmBranch/fix-satb-barrier-for-objectarray-copy' into fix-satb-barrier-for-object-array-copy
>>  - Restore generation budgets following fullgc
>>  - Fix implementation of SATB barrier for objectarray copy
>>    
>>    Original code ommitted SATB barrier for old-gen arrays that were above
>>    the old-gen TAMS.  That was an error.
>
> 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.)

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

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


More information about the shenandoah-dev mailing list