--- old/src/hotspot/share/prims/jvmtiEnter.xsl Sat Nov 18 16:55:17 2017 +++ new/src/hotspot/share/prims/jvmtiEnter.xsl Sat Nov 18 16:55:16 2017 @@ -45,6 +45,7 @@ # include "prims/jvmtiEnter.hpp" # include "prims/jvmtiRawMonitor.hpp" # include "prims/jvmtiUtil.hpp" +# include "runtime/threadSMR.hpp" @@ -769,40 +770,19 @@ - oop thread_oop = JNIHandles::resolve_external_guard( + err = JvmtiExport::cv_external_thread_to_JavaThread(tlh.list(), - ); - if (thread_oop == NULL) { + , &java_thread, NULL); + if (err != JVMTI_ERROR_NONE) { - JVMTI_ERROR_INVALID_THREAD - - jthread resolved to NULL - jthread = " PTR_FORMAT " + err + - jthread did not convert to a JavaThread - jthread = " PTR_FORMAT " , p2i() } - if (!thread_oop->is_a(SystemDictionary::Thread_klass())) { - - JVMTI_ERROR_INVALID_THREAD - - oop is not a thread - jthread = " PTR_FORMAT " - , p2i() - - - } - java_thread = java_lang_Thread::thread(thread_oop); - if (java_thread == NULL) { - - - - JVMTI_ERROR_THREAD_NOT_ALIVE - - - not a Java thread - jthread = " PTR_FORMAT " - , p2i() - - - } - @@ -809,7 +789,8 @@ - JavaThread* java_thread; + JavaThread* java_thread = NULL; + ThreadsListHandle tlh(this_thread);