RFR: 8294729: [s390] Implement nmethod entry barriers
Martin Doerr
mdoerr at openjdk.org
Wed Oct 26 20:00:38 UTC 2022
On Fri, 7 Oct 2022 10:51:23 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:
>> src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp line 93:
>>
>>> 91: // Compare to current patched value:
>>> 92: __ z_cfi(tmp, /* to be patched */ -1); // 6 bytes (2 + 4 byte imm val)
>>> 93:
>>
>> What about the value at `thread_disarmed_offset()`? Is it 4 bytes or 8 bytes? If it is 4 bytes, you should load it with
>> `z_l(tmp, ...);` or
>> `z_ly(tmp, ...);` if the offset might be negative.
>> Similar size considerations on the compare:
>> `z_cfi(tmp, ...);` is good for 4-byte value.
>> `z_cgfi(tmp, ...);` is good for 8-byte values. Caution: signed compare. Sign-extension of the immediate may produce unexpected behaviour.
>
> One more thing:
> What's the value range of thread_disarmed? Does it use less than 16 bits in all cases? Then you could exploit a storage-immediate variant of compare if the offset is positive:
> `z_clfhsi(in_bytes(bs_nm->thread_disarmed_offset()), Z_thread, /* to be patched */ -1);` 4-byte
> `z_clghsi(in_bytes(bs_nm->thread_disarmed_offset()), Z_thread, /* to be patched */ -1);` 8-byte
> 2-byte immediate in both cases. Caution: sign extension!
> No need for a tmp register anymore!
`_nmethod_disarm_value` is 64 bit of which the high order 32 bits are only used on aarch64. Other platforms use a 4 Byte access, so `z_cfi` is correct.
-------------
PR: https://git.openjdk.org/jdk/pull/10558
More information about the hotspot-dev
mailing list