RFR: 8325467: Support methods with many arguments in C2 [v24]
Emanuel Peter
epeter at openjdk.org
Tue Sep 2 14:25:14 UTC 2025
On Mon, 1 Sep 2025 16:31:58 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:
>> src/hotspot/share/opto/regmask.hpp line 170:
>>
>>> 168: // variable indicates how many words we offset with. We consider all
>>> 169: // registers before the offset to not be included in the register mask.
>>> 170: unsigned int _offset;
>>
>> Does that mean we make different slices of the mask?
>
> 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 😅
>> src/hotspot/share/opto/regmask.hpp line 217:
>>
>>> 215: // necessarily representing stack locations) to 1. Here is how the above
>>> 216: // register mask looks like after clearing, setting _all_stack to true, and
>>> 217: // successfully rolling over:
>>
>> I'm still struggling to follow here. Maybe `_offset` is not clear to me yet. What is the value here for it? How is it changed with the `rollover`?
>
> This `_offset` stuff is really only for a very specific use case in `PhaseChaitin::Select`, so I understand it can be hard to follow. The value for `_offset` in the example after rollover is 5 = `_rm_size`, since we have rolled over once. When we roll over the next time, the `_offset` is 10, and so on.
Ok, just make sure you document it in the example :)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2316251262
PR Review Comment: https://git.openjdk.org/jdk/pull/20404#discussion_r2316252858
More information about the hotspot-compiler-dev
mailing list