Skip to content

Commit c88f94c

Browse files
committed
8356394: Remove USE_LIBRARY_BASED_TLS_ONLY macro
Reviewed-by: dholmes, kbarrett, lucy
1 parent 591e71e commit c88f94c

File tree

3 files changed

+1
-21
lines changed

3 files changed

+1
-21
lines changed

src/hotspot/share/classfile/symbolTable.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,9 @@ static volatile bool _has_items_to_clean = false;
8888

8989
static volatile bool _alt_hash = false;
9090

91-
#ifdef USE_LIBRARY_BASED_TLS_ONLY
92-
static volatile bool _lookup_shared_first = false;
93-
#else
9491
// "_lookup_shared_first" can get highly contended with many cores if multiple threads
95-
// are updating "lookup success history" in a global shared variable. If built-in TLS is available, use it.
92+
// are updating "lookup success history" in a global shared variable, so use built-in TLS
9693
static THREAD_LOCAL bool _lookup_shared_first = false;
97-
#endif
9894

9995
// Static arena for symbols that are not deallocated
10096
Arena* SymbolTable::_arena = nullptr;

src/hotspot/share/runtime/thread.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@
5252
#include "jfr/jfr.hpp"
5353
#endif
5454

55-
#ifndef USE_LIBRARY_BASED_TLS_ONLY
56-
// Current thread is maintained as a thread-local variable
5755
THREAD_LOCAL Thread* Thread::_thr_current = nullptr;
58-
#endif
5956

6057
// ======= Thread ========
6158
// Base class for all threads: VMThread, WatcherThread, ConcurrentMarkSweepThread,
@@ -158,20 +155,16 @@ void Thread::initialize_tlab() {
158155
}
159156

160157
void Thread::initialize_thread_current() {
161-
#ifndef USE_LIBRARY_BASED_TLS_ONLY
162158
assert(_thr_current == nullptr, "Thread::current already initialized");
163159
_thr_current = this;
164-
#endif
165160
assert(ThreadLocalStorage::thread() == nullptr, "ThreadLocalStorage::thread already initialized");
166161
ThreadLocalStorage::set_thread(this);
167162
assert(Thread::current() == ThreadLocalStorage::thread(), "TLS mismatch!");
168163
}
169164

170165
void Thread::clear_thread_current() {
171166
assert(Thread::current() == ThreadLocalStorage::thread(), "TLS mismatch!");
172-
#ifndef USE_LIBRARY_BASED_TLS_ONLY
173167
_thr_current = nullptr;
174-
#endif
175168
ThreadLocalStorage::set_thread(nullptr);
176169
}
177170

src/hotspot/share/runtime/thread.hpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,8 @@ class Thread: public ThreadShadow {
113113
friend class JavaThread;
114114
private:
115115

116-
#ifndef USE_LIBRARY_BASED_TLS_ONLY
117116
// Current thread is maintained as a thread-local variable
118117
static THREAD_LOCAL Thread* _thr_current;
119-
#endif
120118

121119
// On AArch64, the high order 32 bits are used by a "patching epoch" number
122120
// which reflects if this thread has executed the required fences, after
@@ -660,14 +658,7 @@ inline Thread* Thread::current() {
660658
}
661659

662660
inline Thread* Thread::current_or_null() {
663-
#ifndef USE_LIBRARY_BASED_TLS_ONLY
664661
return _thr_current;
665-
#else
666-
if (ThreadLocalStorage::is_initialized()) {
667-
return ThreadLocalStorage::thread();
668-
}
669-
return nullptr;
670-
#endif
671662
}
672663

673664
inline Thread* Thread::current_or_null_safe() {

0 commit comments

Comments
 (0)