On Fri, 11 Mar 2022 07:52:16 GMT, Johannes Bechberger <d...@openjdk.java.net> 
wrote:

>> The WXMode for the current thread (on MacOS aarch64) is currently stored in 
>> the thread class which is unnecessary as the WXMode is bound to the current 
>> OS thread, not the current instance of the thread class.
>> This pull request moves the storage of the current WXMode into a thread 
>> local global variable in `os` and changes all related code. SafeFetch 
>> depended on the existence of a thread object only because of the WXMode. 
>> This pull request therefore removes the dependency, making SafeFetch usable 
>> in more contexts.
>
> Johannes Bechberger has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Remove two unnecessary lines

On 3/11/22 10:12, Thomas Stuefe wrote:
>     We could also redefine SafeFetch on MacOS/AArch64 to not need WX. We 
> could do this by statically generating SafeFetch on that platform, and it 
> wouldn't be in the JIT region at all. Why not just do that?
> 
> Do you mean using inline assembly?

I'd use out-of-line assembly, as I do for atomic compare-and-swap
on linux:

https://github.com/openjdk/jdk/blob/master/src/hotspot/os_cpu/linux_aarch64/atomic_linux_aarch64.S

But I guess inline would work.

-- 
Andrew Haley  (he/him)
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

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

PR: https://git.openjdk.java.net/jdk/pull/7727

Reply via email to