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

Daniel Lundén dlunden at openjdk.org
Mon Apr 7 15:22:14 UTC 2025


On Mon, 7 Apr 2025 07:08:25 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Daniel Lundén has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Revise overlap comments for frequency of cases
>
> src/hotspot/share/opto/regmask.hpp line 86:
> 
>> 84:       (((RM_SIZE_MIN << 5) +                // Slots for machine registers
>> 85:         (max_method_parameter_length * 2) + // Slots for incoming arguments
>> 86:         (max_method_parameter_length * 2) + // Slots for outgoing arguments
> 
> Why `*2`? Is that for 64 bit arguments that are split into two 32 bit words?

According to the JVM spec, a method can have at most 255 (32-bit) `int` parameters, and `long` and `double` contribute two parameter slots. For some reason, C2 64-bit aligns even 32-bit parameters, leading to this `*2`. Could be worth looking into in a future RFE, but I'm not touching that in this changeset 😅.

> src/hotspot/share/opto/regmask.hpp line 104:
> 
>> 102:     // the machine registers and usually all parameters that need to be passed
>> 103:     // on the stack (stack registers) up to some interesting limit. On Intel,
>> 104:     // the limit is something like 90+ parameters.
> 
> Here you fixed the comment, so probably the other one needs to be fixed too ;)

Yes, thanks!

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

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


More information about the hotspot-compiler-dev mailing list