RFR: 8356328: Some C2 IR nodes miss size_of() function

kuaiwei duke at openjdk.org
Sat May 17 05:26:57 UTC 2025


On Thu, 8 May 2025 08:36:56 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Good catch! It would currently only be a problem when we clone nodes which is probably hard to check statically (could, for example, be part of a loop body and then be cloned).
>> 
>> Some questions:
>> - Have you also checked the Mach nodes?
>> - Have you also checked that `cmp()` is overridden in case `hash()` is not `NO_HASH` for those nodes that specify at least one field?
>> 
>> Just a side node, you can also just use `sizeof(*this)` which is often done in the code.
>
>> @chhagedorn I checked `machnode.hpp` manually and found some of them still miss `size_of()` . I added them in new patch. Thanks.
> 
> Nice!
> 
>> I checked node list in share/opto/classes.hpp, so MachNode/MachNullCheckNode/MachProjNode are checked. For mach nodes created by adlc, I found adlc will always add size_of function.
> 
> Thanks for checking that.
> 
>> I haven't checked cmp() and hash() , I will check if my test can cover these.
> 
> Sounds good, thanks!

@chhagedorn @TobiHartmann Thanks for your review.

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

PR Comment: https://git.openjdk.org/jdk/pull/25081#issuecomment-2888097786


More information about the hotspot-compiler-dev mailing list