[runtime] Fix MONO_ARCH_ENABLE_MONO_LMF_VAR
authorVlad Brezae <brezaevlad@gmail.com>
Fri, 16 Dec 2016 01:00:18 +0000 (03:00 +0200)
committerVlad Brezae <brezaevlad@gmail.com>
Fri, 16 Dec 2016 19:28:47 +0000 (21:28 +0200)
commitda1e7bb0091f98f9512465c93a1fc48024dde6e7
treec29014dee6dd4a8e2719a24cd34fe16a0d895270
parent38da415de8ec4b0c39281b4ace20f0bf2cbf1ee7
[runtime] Fix MONO_ARCH_ENABLE_MONO_LMF_VAR

Using MONO_ARCH_ENABLE_MONO_LMF_VAR requires that we have means of getting the address of a tls variable (which is always the case when using __thread, but not necessarily when using pthread). Make sure that using it is properly guarded.

In the future we might want to remove MONO_ARCH_ENABLE_LMF_VAR and always try to use a tls variable for the lmf. Additionally we should benchmark what combinations work best and stick to them on all platforms. (ex when using fast tls we might consider using lmf_get + lmf_set if possible, when using fallbacks we might always want to use the lmf_addr to void multiple calls, always use lmf_ir etc).
mono/mini/mini-runtime.c
mono/utils/mono-tls.c
mono/utils/mono-tls.h