RFR: 8319799: Recursive lightweight locking: x86 implementation [v12]

Daniel D. Daugherty dcubed at openjdk.org
Fri Jan 26 21:38:48 UTC 2024


On Thu, 25 Jan 2024 08:44:24 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> src/hotspot/cpu/x86/c2_CodeStubs_x86.cpp line 77:
>> 
>>> 75: 
>>> 76: int C2FastUnlockLightweightStub::max_size() const {
>>> 77:   return 128;
>> 
>> Is this still 128?
>
> This is just used to preallocate the buffer when emitting stubs. Unused space gets truncated / used by the next stubs emission. (If I recall correctly the buffer is grown with at least 4KB at a time if offset() + next_stub->max_size() > buffer_end.) 
> 
> I remember it being somewhere around ~100 bytes depending on ASSERT. So 128 seemed like a good enough number to ensure that the stub could always be emitted. 
> 
> But maybe there is value in being more precise so that (assembler) changes which change (grow) the code emission size are captured early.

Hmmm... It seems strange and against existing style to have the single value
and not one value for `DEBUG` and a smaller value for `NOT_DEBUG`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16607#discussion_r1467068245


More information about the hotspot-dev mailing list