RFR: 8294729: [s390] Implement nmethod entry barriers

Lutz Schmidt lucy at openjdk.org
Wed Oct 26 20:00:38 UTC 2022


On Fri, 7 Oct 2022 10:42:20 GMT, Lutz Schmidt <lucy at openjdk.org> wrote:

>> This draft PR implements native method barriers on s390. When complete, this will fix the build, and bring the other benefits of [JDK-8290025](https://bugs.openjdk.org/browse/JDK-8290025) to that platform.
>
> 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!

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

PR: https://git.openjdk.org/jdk/pull/10558


More information about the hotspot-dev mailing list