hotspot/src/share/vm/runtime/thread.cpp
changeset 35825 7c7652ee137b
parent 35495 e27da438fa13
child 36178 9739f8c767da
child 36074 11263906664c
--- a/hotspot/src/share/vm/runtime/thread.cpp	Wed Feb 03 12:16:44 2016 +0100
+++ b/hotspot/src/share/vm/runtime/thread.cpp	Fri Jan 22 15:25:40 2016 +0100
@@ -31,6 +31,7 @@
 #include "code/codeCacheExtensions.hpp"
 #include "code/scopeDesc.hpp"
 #include "compiler/compileBroker.hpp"
+#include "compiler/compileTask.hpp"
 #include "gc/shared/gcId.hpp"
 #include "gc/shared/gcLocker.inline.hpp"
 #include "gc/shared/workgroup.hpp"
@@ -2884,6 +2885,20 @@
   print_thread_state_on(st);
   _safepoint_state->print_on(st);
 #endif // PRODUCT
+  if (is_Compiler_thread()) {
+    CompilerThread* ct = (CompilerThread*)this;
+    if (ct->task() != NULL) {
+      st->print("   Compiling: ");
+      ct->task()->print(st, NULL, true, false);
+    } else {
+      st->print("   No compile task");
+    }
+    st->cr();
+  }
+}
+
+void JavaThread::print_name_on_error(outputStream* st, char *buf, int buflen) const {
+  st->print("%s", get_thread_name_string(buf, buflen));
 }
 
 // Called by fatal error handler. The difference between this and
@@ -4386,7 +4401,6 @@
     wt->print_on(st);
     st->cr();
   }
-  CompileBroker::print_compiler_threads_on(st);
   st->flush();
 }
 
@@ -4439,8 +4453,24 @@
     current->print_on_error(st, buf, buflen);
     st->cr();
   }
+  st->cr();
+  st->print_cr("Threads with active compile tasks:");
+  print_threads_compiling(st, buf, buflen);
 }
 
+void Threads::print_threads_compiling(outputStream* st, char* buf, int buflen) {
+  ALL_JAVA_THREADS(thread) {
+    if (thread->is_Compiler_thread()) {
+      CompilerThread* ct = (CompilerThread*) thread;
+      if (ct->task() != NULL) {
+        thread->print_name_on_error(st, buf, buflen);
+        ct->task()->print(st, NULL, true, true);
+      }
+    }
+  }
+}
+
+
 // Internal SpinLock and Mutex
 // Based on ParkEvent