[riscv-port] RFR: 8277391: riscv: Remove the USE_LIBRARY_BASED_TLS_ONLY macro to use tls instead of pthread_getspecific [v2]
Fei Yang
fyang at openjdk.java.net
Tue Nov 23 09:08:59 UTC 2021
On Tue, 23 Nov 2021 08:39:28 GMT, zhengxiaolinX <duke at openjdk.java.net> wrote:
> > After some reconsideration, I think we can go one step further: simply keep the changes in file src/hotspot/share/utilities/globalDefinitions_gcc.hpp and remote all other changes in this PR.
> > Then USE_LIBRARY_BASED_TLS_ONLY macro won't be defined and Thread::current() will return '_ZN6Thread12_thr_currentE' in that case. This will be the same in functionality as the newly add assembly function '_ZN10JavaThread25riscv64_get_thread_helperEv'.
> > I have checked with Yadong, the reason for defining USE_LIBRARY_BASED_TLS_ONLY macro is to workaround some host compiler bug when accessing TLS variables in the very early days. This should not affect us now.
>
> I think I get your point - I wonder if that `remote` should actually be a `revert`? If it is - that's great - I think this is a pretty and concise solution if we need to clobber all volatile registers anyway. Let me revise this patch and change the titles. But calling a `call_VM_leaf_base()` is a bit duplicated because this function would save another bunch of registers like x5 and x31 again, so I would recommend directly using a pair of `movptr_with_offset` and `jalr` - though it might be insignificant.
Sorry for the typo. Should be "remove". Please do.
We should keep your original changes about the comment for MacroAssembler::get_thread(Register thread) at the same time :-)
-------------
PR: https://git.openjdk.java.net/riscv-port/pull/7
More information about the riscv-port-dev
mailing list