Integrated: 8373420: C2: Add true/false_proj*() methods for IfNode as a replacement for proj_out*(true/false)
Christian Hagedorn
chagedorn at openjdk.org
Wed Dec 17 11:21:09 UTC 2025
On Wed, 10 Dec 2025 13:13:44 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> There are a lot of places in the code where we call `proj_out*(true/false)` on an `IfNode`. In some cases, we then cast the returned `ProjNode` back to `IfProjNode` or `IfTrueNode/IfFalseNode`. I often visit such code and now decided to clean this up.
>
> The patch proposes new `IfNode::true/false_proj*()` methods that return `IfTrueNode/IfFalseNode` directly. I walked through all `proj_out*()` calls and replaced those that used a direct `true/false` or `1/0` as argument.
>
> There are still more things to clean up in this area, for example, when we return `ProjNode` even though it should be an `IfProjNode` which requires more casting. But let's do that step by step in follow-up clean ups.
>
> Thanks,
> Christian
This pull request has now been integrated.
Changeset: e4636d69
Author: Christian Hagedorn <chagedorn at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/e4636d69e7e41477619a163e97fd3af2e5942dde
Stats: 66 lines in 11 files changed: 20 ins; 4 del; 42 mod
8373420: C2: Add true/false_proj*() methods for IfNode as a replacement for proj_out*(true/false)
Reviewed-by: dfenacci, roland, epeter
-------------
PR: https://git.openjdk.org/jdk/pull/28745
More information about the hotspot-compiler-dev
mailing list