comparison 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
comparison
equal deleted inserted replaced
18533:25a21e1794ec 18547:fa981f5bb53a
1429 1429
1430 #ifdef GRAAL 1430 #ifdef GRAAL
1431 1431
1432 jlong* JavaThread::_graal_old_thread_counters; 1432 jlong* JavaThread::_graal_old_thread_counters;
1433 1433
1434 bool graal_counters_include(oop threadObj) { 1434 bool graal_counters_include(JavaThread* thread) {
1435 return !GraalCountersExcludeCompiler || threadObj == NULL || threadObj->klass() != SystemDictionary::CompilerThread_klass(); 1435 oop threadObj = thread->threadObj();
1436 return !GraalCountersExcludeCompiler || (!thread->is_Compiler_thread() && (threadObj == NULL || threadObj->klass() != SystemDictionary::CompilerThread_klass()));
1436 } 1437 }
1437 1438
1438 void JavaThread::collect_counters(typeArrayOop array) { 1439 void JavaThread::collect_counters(typeArrayOop array) {
1439 if (GraalCounterSize > 0) { 1440 if (GraalCounterSize > 0) {
1440 MutexLocker tl(Threads_lock); 1441 MutexLocker tl(Threads_lock);
1441 for (int i = 0; i < array->length(); i++) { 1442 for (int i = 0; i < array->length(); i++) {
1442 array->long_at_put(i, _graal_old_thread_counters[i]); 1443 array->long_at_put(i, _graal_old_thread_counters[i]);
1443 } 1444 }
1444 for (JavaThread* tp = Threads::first(); tp != NULL; tp = tp->next()) { 1445 for (JavaThread* tp = Threads::first(); tp != NULL; tp = tp->next()) {
1445 if (graal_counters_include(tp->threadObj())) { 1446 if (graal_counters_include(tp)) {
1446 for (int i = 0; i < array->length(); i++) { 1447 for (int i = 0; i < array->length(); i++) {
1447 array->long_at_put(i, array->long_at(i) + tp->_graal_counters[i]); 1448 array->long_at_put(i, array->long_at(i) + tp->_graal_counters[i]);
1448 } 1449 }
1449 } 1450 }
1450 } 1451 }
1694 if (_thread_profiler != NULL) delete _thread_profiler; 1695 if (_thread_profiler != NULL) delete _thread_profiler;
1695 if (_thread_stat != NULL) delete _thread_stat; 1696 if (_thread_stat != NULL) delete _thread_stat;
1696 1697
1697 #ifdef GRAAL 1698 #ifdef GRAAL
1698 if (GraalCounterSize > 0) { 1699 if (GraalCounterSize > 0) {
1699 if (graal_counters_include(threadObj())) { 1700 if (graal_counters_include(this)) {
1700 for (int i = 0; i < GraalCounterSize; i++) { 1701 for (int i = 0; i < GraalCounterSize; i++) {
1701 _graal_old_thread_counters[i] += _graal_counters[i]; 1702 _graal_old_thread_counters[i] += _graal_counters[i];
1702 } 1703 }
1703 } 1704 }
1704 FREE_C_HEAP_ARRAY(jlong, _graal_counters, mtInternal); 1705 FREE_C_HEAP_ARRAY(jlong, _graal_counters, mtInternal);