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

Thomas Stuefe stuefe at openjdk.java.net
Mon Mar 14 08:06:46 UTC 2022


On Fri, 11 Mar 2022 07:52:16 GMT, Johannes Bechberger <duke at 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

Hi Florian,

> If you have a PR, please Cc: me on it, I will have a look.

Thanks a lot, Florian! I got it to work under Linux x64.

My error was that I had declared the label in C++ as `extern void* SafeFetch_continuation`. Declaring it as `extern char _SafeFetch32_continuation[] __attribute__ ((visibility ("hidden")));` as you suggested does the trick. I'm not sure I understand the difference.

>> extern "C"

> It doesn't hurt, but the Itanium ABI does not mangle such global data symbols, so it's not strictly needed.

I don't understand this remark, what does Itanium have to do with this?

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

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


More information about the serviceability-dev mailing list