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

Daniel Lundén dlunden at openjdk.org
Thu Apr 3 11:46:10 UTC 2025


On Mon, 31 Mar 2025 13:20:12 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

>> Daniel Lundén has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Extend example with offset register mask
>
> src/hotspot/share/opto/optoreg.hpp line 237:
> 
>> 235:   }
>> 236:   OptoRegPair(OptoReg::Name f) : OptoRegPair(OptoReg::Bad, f) {}
>> 237:   OptoRegPair() : OptoRegPair(OptoReg::Bad, OptoReg::Bad) {}
> 
> This is preexisting, but since the changeset touches the code: these two "partial" constructors seem unused, please consider removing them (but double-check in that case that they are unused for all platforms).

Thanks, removed (and double-checked usage)

> src/hotspot/share/opto/regmask.hpp line 545:
> 
>> 543: 
>> 544:   // Overlap test. Non-zero if any registers in common, including all-stack.
>> 545:   bool overlap(const RegMask &rm) const {
> 
> Please review the frequency of the different tests in this function. I ran an instrumented version and found the test in Case 4 to succeed (return true) more often that Case 2 and Case 3.

Thanks, I made a note to run some benchmarks for this and gather statistics. It is critical that we run case 1 first (results in a significant performance gain), but perhaps we can gain a little by ordering the rare cases as well.

> src/hotspot/share/utilities/globalDefinitions.hpp line 1363:
> 
>> 1361: // synchronized statements in Java.
>> 1362: const int BoxLockNode_slot_limit = 200;
>> 1363: 
> 
> This definition seems too C2-specific to be put in this shared file, could it be moved e.g. to `optoreg.hpp`?

Thanks, I was unsure where to put this definition. It doesn't really relate to `OptoReg` and is rather a limitation for `RegMask`s, so I now simply put it as a constant in `regmask.hpp`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2026826903
PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2026826440
PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2026823410


More information about the hotspot-compiler-dev mailing list