RFR: 8325467: Support methods with many arguments in C2 [v24]

Emanuel Peter epeter at openjdk.org
Mon Sep 1 08:37:07 UTC 2025


On Mon, 1 Sep 2025 07:49:26 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 63:
> 
>> 61: // RM_SIZE is the base size of a register mask in 32-bit words.
>> 62: // RM_SIZE_MIN is the theoretical minimum size of a register mask in 32-bit
>> 63: // words.
> 
> It seems this is a bad pattern that was already here before you. But it really makes me a little scared here.
> 
> Having two variable names differ in just an underscore `_` but with different semantics is a bit confusing to me. It is hard for the reader to keep track of what is what going forward. It would be really easy for someone to confuse the two in the future and have bugs creap in that way (just because of an underscore). It may be more useful to use the units in at least one of the two names.
> 
> I would love to see names like `RM_SIZE` and `RM_SIZE_IN_LONGS`, rather than `RM_SIZE` and `_RM_SIZE`.
> Even better would be `RM_SIZE_IN_INTS` and `RM_SIZE_IN_LONGS`. That way, you rould save a lot of comments. Maybe you could come up with even better names. "slots" and "words"?
> You could consider doing a renaming PR first before the patch here. Maybe you can even automate the renaming with a command/script, and then apply the same renaming to the changes here?

Oh gosh, I just realized: machine word of course depends on 32bit vs 64bit architecture. Yikes.
So maybe the names need to be stack-slots vs words? And there should probably be a quick reminder somewhere that words can be different sizes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2313237509


More information about the hotspot-compiler-dev mailing list