RFR: 8339346: GenShen: Remove even more stale TODOs

William Kemper wkemper at openjdk.org
Wed Sep 4 00:21:43 UTC 2024


On Wed, 4 Sep 2024 00:06:19 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahMarkingContext.hpp line 73:
>> 
>>> 71: 
>>> 72:   inline bool allocated_after_mark_start(oop obj) const;
>>> 73:   inline bool allocated_after_mark_start(const HeapWord* addr) const;
>> 
>> Any reason to remove the arg const-ness? Seems to hold and gives you a sense of the methods not modifying the args. Do we gain anything from removing the arg-constness? (I do see the "TODO" comment, but I'd erro towards removing the TODO comment and leaving the arg const-ness in place.
>
> Agree with Ramki here, unless there's a reason we prefer non-const args.

I believe it is confusing because `oop` is a `typedef` for a pointer `oopDesc*`. So, the `const` here applies to the typedef and not to the underlying type (that is, we could still call non-const methods on `oop` inside the function, but we cannot change what `oop` points to). Also, these `const` modifiers are not present upstream.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/491#discussion_r1742835181


More information about the shenandoah-dev mailing list