RFR: 8377713: Shenandoah: Convert ShenandoahReferenceProcessor to use Atomic<T> [v2]
William Kemper
wkemper at openjdk.org
Thu Feb 26 21:29:38 UTC 2026
On Tue, 24 Feb 2026 18:00:17 GMT, Ben Taylor <btaylor at openjdk.org> wrote:
>> Modernizes the code as has been done in other areas of Shenandoah and G1 GCs.
>>
>> The same tier1 tests pass before and after this change on x86_64 and aarch64 linux when run with -XX:+UseShenandoahGC
>
> Ben Taylor has updated the pull request incrementally with one additional commit since the last revision:
>
> Change add_then_fetch - 1 to fetch_then_add
src/hotspot/share/gc/shenandoah/shenandoahReferenceProcessor.cpp line 579:
> 577: void ShenandoahReferenceProcessor::enqueue_references_locked() {
> 578: // Prepend internal pending list to external pending list
> 579: shenandoah_assert_not_in_cset_except(&_pending_list, _pending_list.load_relaxed(), ShenandoahHeap::heap()->cancelled_gc() || !ShenandoahLoadRefBarrier);
Not sure about this one. The first argument to `shenandoah_assert_not_in_cset_except` is a `void *`, so it will take just about anything. The argument is meant to be the "interior location" (i.e., address of the field holding the pointer given in the second argument). With this change, we are passing the address of the `Atomic` wrapper class, but I think we should be passing the address of the _value_ it is holding. So maybe `&_pending_list.load_relaxed()`?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29767#discussion_r2861367609
More information about the shenandoah-dev
mailing list