RFR: 8345580: Remove const from Node::_idx which is modified [v2]

Emanuel Peter epeter at openjdk.org
Wed Jan 8 14:04:42 UTC 2025


On Wed, 8 Jan 2025 13:57:39 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> Yagmur Eren has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   remove casting trick in set_idx
>
> The original intent is to avoid mistaken modification of the field, so I think it may be beneficial to change all accesses to a getter and limit the accessibility of the setter using friend. It should be done as a separate patch, I'm quite scared of the aggressiveness of the C++ compiler and not sure we always compile correctly.

@merykitty 
> The original intent is to avoid mistaken modification of the field

Correct

> I think it may be beneficial to change all accesses to a getter and limit the accessibility of the setter using friend

I agree in principle - but we access `_idx` everywhere. That would really make backports much harder 🙈

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

PR Comment: https://git.openjdk.org/jdk/pull/22646#issuecomment-2577746934


More information about the hotspot-compiler-dev mailing list