RFR: 8328306: AArch64: MacOS lazy JIT "write xor execute" switching [v2]

Dean Long dlong at openjdk.org
Fri Aug 15 23:58:31 UTC 2025


On Tue, 12 Aug 2025 09:22:57 GMT, Andrew Dinn <adinn at openjdk.org> wrote:

>> Andrew Haley has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
>>   
>>   Co-authored-by: Bernhard Urban-Forster <lewurm at gmail.com>
>
> src/hotspot/share/code/nmethod.cpp line 2394:
> 
>> 2392: 
>> 2393: bool nmethod::is_unloading() {
>> 2394:   MACOS_AARCH64_ONLY(os::thread_wx_enable_write());
> 
> This is very opaque. Why is the write enable placed here rather than lower down where we drop past the return true and return false cases and potentially start monkeying around with state updates?
> 
> Currently, it looks as if the fact that a caller has tested the state may imply that said caller might write to the nmethod even when we determine the state via the first two checks. Is that really true? If so then an explanation as to why would be highly appropriate.

Yes, we should be able to move it down to right before the cmpxchg.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26562#discussion_r2280039748


More information about the hotspot-dev mailing list