--- old/src/share/vm/runtime/java.cpp 2015-11-04 23:06:34.926056609 -0500 +++ new/src/share/vm/runtime/java.cpp 2015-11-04 23:06:33.425972075 -0500 @@ -511,8 +511,7 @@ } void vm_exit(int code) { - Thread* thread = ThreadLocalStorage::is_initialized() ? - ThreadLocalStorage::get_thread_slow() : NULL; + Thread* thread = Thread::current_or_null(); if (thread == NULL) { // we have serious problems -- just exit vm_direct_exit(code); @@ -550,8 +549,7 @@ // Calling 'exit_globals()' will disable thread-local-storage and cause all // kinds of assertions to trigger in debug mode. if (is_init_completed()) { - Thread* thread = ThreadLocalStorage::is_initialized() ? - ThreadLocalStorage::get_thread_slow() : NULL; + Thread* thread = Thread::current_or_null(); if (thread != NULL && thread->is_Java_thread()) { // We are leaving the VM, set state to native (in case any OS exit // handlers call back to the VM) @@ -605,7 +603,7 @@ // If there are exceptions on this thread it must be cleared // first and here. Any future calls to EXCEPTION_MARK requires // that no pending exceptions exist. - Thread *THREAD = Thread::current(); + Thread *THREAD = Thread::current_or_null(); if (HAS_PENDING_EXCEPTION) { CLEAR_PENDING_EXCEPTION; }