RFR: 8322815: Eliminate -Wparentheses warnings in shenandoah code

Aleksey Shipilev shade at openjdk.org
Wed Jan 3 17:15:46 UTC 2024


On Wed, 3 Jan 2024 11:51:11 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> 8322815: Eliminate -Wparentheses warnings in shenandoah code
>> 
>> Please review this change to eliminate some -Wparentheses warnings. This
>> involved simply adding a few parentheses to make some implicit operator
>> precedence explicit.
>> 
>> Testing: local (linux-x64) build with shenandoah included and ran
>> hotspot:tier1 with -XX:+UseShenandoahGC.
>
> src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp line 710:
> 
>> 708:       ShenandoahHeap::atomic_update_oop(resolved, p, obj);
>> 709:       assert(_heap->cancelled_gc() ||
>> 710:              (_mark_context->is_marked(resolved) && !_heap->in_collection_set(resolved)),
> 
> The change for this PR seems fine, but the whole assert looks weird, and lacks richer diagnostics Shenandoah asserts do. I believe the forwardee is explicitly marked, given it is a new copy after TAMS. So the whole thing might be just:
> 
> 
>   shenandoah_assert_not_in_cset_except(p, resolved, _heap->cancelled_gc());
> 
> 
> Right, @zhengyu123? We should do that in separate PR.

Doing this in #17245. @kimbarrett, feel free to drop this hunk from the patch, that PR is going to rewrite the assert

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17214#discussion_r1440693532


More information about the hotspot-gc-dev mailing list