RFR: 8282475: SafeFetch should not rely on existence of Thread::current

Johannes Bechberger duke at openjdk.java.net
Mon Mar 7 12:29:03 UTC 2022


On Mon, 7 Mar 2022 12:07:13 GMT, David Holmes <dholmes at openjdk.org> 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.
>
> src/hotspot/share/runtime/threadWXSetters.inline.hpp line 33:
> 
>> 31: #if defined(__APPLE__) && defined(AARCH64)
>> 32: 
>> 33: #include "runtime/thread.inline.hpp" // dependencies require this include
> 
> I can't see how this include is needed now.

I tried to replace it with os.hpp (and os.inline.hpp) but it caused a linker error.

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

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


More information about the serviceability-dev mailing list