From 50832b6804d15ea5ddfe99a2753a09111b5bfe37 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Wed, 5 Aug 2015 00:31:02 +0000 Subject: [PATCH] Revert "ART: Use bionic TLS slot for thread-self" This reverts commit b81535875ff46d1630c76091fe969a9eb7fc4d16. Breaking tests, need to investigate. Change-Id: Iab8c4f6136e6cb9bd6cf3c3495aa33962ef890ee --- build/Android.common_build.mk | 5 ----- runtime/thread-inl.h | 8 -------- runtime/thread.cc | 4 ---- 3 files changed, 17 deletions(-) diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk index 3a1bd0995..05cfc4217 100644 --- a/build/Android.common_build.mk +++ b/build/Android.common_build.mk @@ -209,11 +209,6 @@ ART_C_INCLUDES := \ external/vixl/src \ external/zlib \ -# We optimize Thread::Current() with a direct TLS access. This requires access to a private -# Bionic header. -# Note: technically we only need this on device, but this avoids the duplication of the includes. -ART_C_INCLUDES += bionic/libc/private - # Base set of cflags used by all things ART. art_cflags := \ -fno-rtti \ diff --git a/runtime/thread-inl.h b/runtime/thread-inl.h index 53f95a641..39ef68a42 100644 --- a/runtime/thread-inl.h +++ b/runtime/thread-inl.h @@ -19,10 +19,6 @@ #include "thread.h" -#ifdef HAVE_ANDROID_OS -#include // Access to our own TLS slot. -#endif - #include #include "base/casts.h" @@ -45,11 +41,7 @@ inline Thread* Thread::Current() { if (!is_started_) { return nullptr; } else { -#ifdef HAVE_ANDROID_OS - void* thread = __get_tls()[TLS_SLOT_ART_THREAD_SELF]; -#else void* thread = pthread_getspecific(Thread::pthread_key_self_); -#endif return reinterpret_cast(thread); } } diff --git a/runtime/thread.cc b/runtime/thread.cc index d5b2870f3..6949b0bd3 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -527,11 +527,7 @@ bool Thread::Init(ThreadList* thread_list, JavaVMExt* java_vm, JNIEnvExt* jni_en InitCardTable(); InitTid(); -#ifdef HAVE_ANDROID_OS - __get_tls()[TLS_SLOT_ART_THREAD_SELF] = this; -#else CHECK_PTHREAD_CALL(pthread_setspecific, (Thread::pthread_key_self_, this), "attach self"); -#endif DCHECK_EQ(Thread::Current(), this); tls32_.thin_lock_thread_id = thread_list->AllocThreadId(this); -- 2.11.0