RFR: 8356328: Some C2 IR nodes miss size_of() function [v4]
Christian Hagedorn
chagedorn at openjdk.org
Thu May 15 13:44:55 UTC 2025
On Fri, 9 May 2025 02:45:48 GMT, kuaiwei <duke at openjdk.org> wrote:
>> I wrote a test to check if every C2 IR node has correct size_of() function. And I found some of them are missed. They added new fields and not add size_of() to reflect new size. In linux, it does not cause issue so far, because gcc allocate more space for alignment and can keep these additional `bool` flags. But it will report failure on windows. And if anyone modified base class, it will cause problem.
>>
>> PS, My test is in https://github.com/openjdk/jdk/compare/master...kuaiwei:jdk:test/check_node_size , but it has many hack on IR nodes to make test to run.
>
> kuaiwei has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove cmp()/hash() for Opaque node
Two minor comments, otherwise looks good.Thanks for double-checking the occurrences again!
src/hotspot/share/opto/intrinsicnode.hpp line 202:
> 200: virtual const Type* Value(PhaseGVN* phase) const;
> 201: virtual uint size_of() const { return sizeof(EncodeISOArrayNode); }
> 202: virtual uint hash() const { return Node::hash() + ascii; }
Was like that before but since you're touching the code now, can you also add a leading `_` for the `ascii` field?
src/hotspot/share/opto/machnode.hpp line 546:
> 544:
> 545: private:
> 546: bool _do_polling;
While touching this class, maybe move this field declaration up to the start of the class.
-------------
Marked as reviewed by chagedorn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/25081#pullrequestreview-2843729696
PR Review Comment: https://git.openjdk.org/jdk/pull/25081#discussion_r2091195536
PR Review Comment: https://git.openjdk.org/jdk/pull/25081#discussion_r2091199648
More information about the hotspot-compiler-dev
mailing list