RFR: 8325467: Support methods with many arguments in C2 [v24]
Daniel Lundén
dlunden at openjdk.org
Mon Sep 1 16:18:01 UTC 2025
On Mon, 1 Sep 2025 08:08:27 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Daniel Lundén has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 35 commits:
>>
>> - Restore modified java/lang/invoke tests
>> - Sort includes (new requirement)
>> - Merge remote-tracking branch 'upstream/master' into many-arguments-8325467+pr-updates
>> - Add clarifying comments at definitions of register mask sizes
>> - Fix implicit zero and nullptr checks
>> - Add deep copy comment
>> - Merge remote-tracking branch 'upstream/master' into many-arguments-8325467+pr-updates
>> - Fix typo
>> - Updates after Emanuel's comments
>> - Refactor and improve TestNestedSynchronize.java
>> - ... and 25 more: https://git.openjdk.org/jdk/compare/b39c7369...80c6cf47
>
> src/hotspot/share/opto/regmask.hpp line 161:
>
>> 159: // cases, we can allow read-only sharing.
>> 160: bool _read_only = false;
>> 161: #endif
>
> Can you explain why this happens? Is this something we could clean up? It smells a bit like tech-dept. But maybe it is a really necessary performance optimization. Would be nice if there was an explanation which one it is ;)
The main issue is that register masks are stored as part of certain nodes, and nodes get copied by `Node::clone`. If someone in the future decide to add a register mask to some type of node, and forget to add a special case (like what I've now added for `MachProj`) in `Node::clone` for the node type, this safeguard will catch it and complain.
Register masks are used in peculiar ways throughout C2, and there may be other unexpected cases as well that this safeguard catches. I doubt the `_read_only` part has a measurable performance effect, I only added it because it was easy and couldn't hurt.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2314305615
More information about the hotspot-compiler-dev
mailing list