RFR: 8356328: Some C2 IR nodes miss size_of() function [v5]
Kuai Wei
kwei at openjdk.org
Tue May 20 06:14:00 UTC 2025
On Mon, 19 May 2025 09:33:25 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Post-review comment: Doesn't this mean that super-class `Node::size_of` gives us a wrong answer for any node that has its own fields?
>
> ```
> uint Node::size_of() const { return sizeof(*this); }
> ```
>
> So, this looks mechanically preventable by making `Node::size_of` pure virtual, and thus _forcing_ subclasses to implement its own `size_of`.
Good idea. I plan to check size_of/cmp/hash for every IR node. I may use a static analysis tool to do this job.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25081#issuecomment-2893078092
More information about the hotspot-compiler-dev
mailing list