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

Daniel Lundén dlunden at openjdk.org
Tue Sep 2 14:41:58 UTC 2025


On Tue, 2 Sep 2025 14:20:58 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> I don't quite understand the question, can you please elaborate? The `_offset` means we shift the register mask to the right, so that the first bit of the first `_RM_UP` element no longer represents `OptoReg` 0 (but rather `OptoReg` `_offset * BitsPerWord`).
>
> Hmm ok. Now I went to `rm_up` and thought that you would do `i - _offset`. But that's not what happens.
> 
> Hmm but then here there is a subtraction:
> 
>   bool Member(OptoReg::Name reg) const {
>     reg = reg - offset_bits();
> 
> 
> Is that consistent? I hope you understand why I'm confused 😅

Yes, the subtraction is consistent, because if the register mask is offset, we can no longer use the OptoReg to directly index the mask. Small simplified example: register mask with 5 bits, offset by 10. First bit (index 0) represents OptoReg 10, second bit (index 1) represents OptoReg 11, etc. If we call `Member(15)`, we need to subtract the offset so we look at the correct index in the register mask (index 5).

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

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


More information about the hotspot-compiler-dev mailing list