RFR: 8342560: GenShen: Fix confusing method name

Y. Srinivas Ramakrishna ysr at openjdk.org
Thu Oct 17 21:49:24 UTC 2024


On Thu, 17 Oct 2024 21:43:03 GMT, Y. Srinivas Ramakrishna <ysr at openjdk.org> wrote:

>> Rename `is_old` to make it more clear that this about pointers that are outside the scope of a young collection.
>
> src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 394:
> 
>> 392: }
>> 393: 
>> 394: inline bool ShenandoahHeap::is_not_in_active_young_collection(oop obj) const {
> 
> This sounds to me more like: `is_in_old_when_active_young()`.
> 
> The "not" is the name makes the negative of its semantics suspect. Think of the sense of what one might believe if one identified the negation with `is_in_active_young_collection()` which I'd take to be `active_generation()->is_young() && is_in_young(obj)`, rather than the actual negation of the condition which would be: `!active_generation()->is_young() || !is_in_old(obj)`.

Can we verify that the predicate is stable in the context of an arbitrary current caller?

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/517#discussion_r1805482200


More information about the shenandoah-dev mailing list