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

Emanuel Peter epeter at openjdk.org
Wed Apr 23 07:15:56 UTC 2025


On Mon, 7 Apr 2025 15:15:18 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:

>> src/hotspot/share/opto/regmask.hpp line 40:
>> 
>>> 38: // stack slots used by BoxLockNodes. We reach this limit by, e.g., deeply
>>> 39: // nesting synchronized statements in Java.
>>> 40: const int BoxLockNode_slot_limit = 200;
>> 
>> Where does this number come from? I've added arbitrary constants like this, and sometimes it is hard to give a good justification. But at least writing down what was your thinking might help someone else if they come across it later. Do you have a sense how large it should be at least or at most?
>
> It is indeed arbitrary (and should be very generous for all practical cases). We need a limit so that we can compute an upper bound for register mask sizes. I've updated the comment now, does it make more sense?

Nice!
Optional: make it upper case to emphasize that it is a constant at the use site.
Suggestion:

const int BoxLockNode_SLOT_LIMIT = 200;

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

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


More information about the hotspot-compiler-dev mailing list