diff src/share/vm/runtime/thread.cpp @ 18547:fa981f5bb53a

reenable -XX:+GraalCountersExcludeCompiler option
author Lukas Stadler <lukas.stadler@oracle.com>
date Sun, 23 Nov 2014 12:58:18 -0800
parents 40074f6ac788
children 43e2cc9a4fde
line wrap: on
line diff
--- a/src/share/vm/runtime/thread.cpp	Wed Nov 26 17:14:49 2014 +0100
+++ b/src/share/vm/runtime/thread.cpp	Sun Nov 23 12:58:18 2014 -0800
@@ -1431,8 +1431,9 @@
 
 jlong* JavaThread::_graal_old_thread_counters;
 
-bool graal_counters_include(oop threadObj) {
-  return !GraalCountersExcludeCompiler || threadObj == NULL || threadObj->klass() != SystemDictionary::CompilerThread_klass();
+bool graal_counters_include(JavaThread* thread) {
+  oop threadObj = thread->threadObj();
+  return !GraalCountersExcludeCompiler || (!thread->is_Compiler_thread() && (threadObj == NULL || threadObj->klass() != SystemDictionary::CompilerThread_klass()));
 }
 
 void JavaThread::collect_counters(typeArrayOop array) {
@@ -1442,7 +1443,7 @@
       array->long_at_put(i, _graal_old_thread_counters[i]);
     }
     for (JavaThread* tp = Threads::first(); tp != NULL; tp = tp->next()) {
-      if (graal_counters_include(tp->threadObj())) {
+      if (graal_counters_include(tp)) {
         for (int i = 0; i < array->length(); i++) {
           array->long_at_put(i, array->long_at(i) + tp->_graal_counters[i]);
         }
@@ -1696,7 +1697,7 @@
 
 #ifdef GRAAL
   if (GraalCounterSize > 0) {
-    if (graal_counters_include(threadObj())) {
+    if (graal_counters_include(this)) {
       for (int i = 0; i < GraalCounterSize; i++) {
         _graal_old_thread_counters[i] += _graal_counters[i];
       }