Mercurial > hg > graal-compiler
comparison src/share/vm/runtime/thread.cpp @ 11893:ec267141f753
more javadoc and output tweaks for dynamic counters
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Fri, 04 Oct 2013 11:56:18 +0200 |
parents | d7964e96b0b0 |
children | cefad50507d8 |
comparison
equal
deleted
inserted
replaced
11892:4ac39f060a9d | 11893:ec267141f753 |
---|---|
1412 // ======= JavaThread ======== | 1412 // ======= JavaThread ======== |
1413 | 1413 |
1414 #ifdef GRAAL | 1414 #ifdef GRAAL |
1415 | 1415 |
1416 #if GRAAL_COUNTERS_SIZE > 0 | 1416 #if GRAAL_COUNTERS_SIZE > 0 |
1417 jlong JavaThread::_graal_old_counters[GRAAL_COUNTERS_SIZE]; | 1417 jlong JavaThread::_graal_old_thread_counters[GRAAL_COUNTERS_SIZE]; |
1418 | 1418 |
1419 bool graal_counters_include(oop threadObj) { | 1419 bool graal_counters_include(oop threadObj) { |
1420 return !GRAAL_COUNTERS_EXCLUDE_COMPILER_THREADS || threadObj == NULL || threadObj->klass() != SystemDictionary::CompilerThread_klass(); | 1420 return !GRAAL_COUNTERS_EXCLUDE_COMPILER_THREADS || threadObj == NULL || threadObj->klass() != SystemDictionary::CompilerThread_klass(); |
1421 } | 1421 } |
1422 | 1422 |
1423 void JavaThread::collect_counters(typeArrayOop array) { | 1423 void JavaThread::collect_counters(typeArrayOop array) { |
1424 MutexLocker tl(Threads_lock); | 1424 MutexLocker tl(Threads_lock); |
1425 for (int i = 0; i < array->length(); i++) { | 1425 for (int i = 0; i < array->length(); i++) { |
1426 array->long_at_put(i, _graal_old_counters[i]); | 1426 array->long_at_put(i, _graal_old_thread_counters[i]); |
1427 } | 1427 } |
1428 for (JavaThread* tp = Threads::first(); tp != NULL; tp = tp->next()) { | 1428 for (JavaThread* tp = Threads::first(); tp != NULL; tp = tp->next()) { |
1429 if (graal_counters_include(tp->threadObj())) { | 1429 if (graal_counters_include(tp->threadObj())) { |
1430 for (int i = 0; i < array->length(); i++) { | 1430 for (int i = 0; i < array->length(); i++) { |
1431 array->long_at_put(i, array->long_at(i) + tp->_graal_counters[i]); | 1431 array->long_at_put(i, array->long_at(i) + tp->_graal_counters[i]); |
1477 _in_deopt_handler = 0; | 1477 _in_deopt_handler = 0; |
1478 _doing_unsafe_access = false; | 1478 _doing_unsafe_access = false; |
1479 _stack_guard_state = stack_guard_unused; | 1479 _stack_guard_state = stack_guard_unused; |
1480 #ifdef GRAAL | 1480 #ifdef GRAAL |
1481 _graal_alternate_call_target = NULL; | 1481 _graal_alternate_call_target = NULL; |
1482 #if GRAAL_COUNTERS_SIZE > 0 | |
1482 for (int i = 0; i < GRAAL_COUNTERS_SIZE; i++) { | 1483 for (int i = 0; i < GRAAL_COUNTERS_SIZE; i++) { |
1483 _graal_counters[i] = 0; | 1484 _graal_counters[i] = 0; |
1484 } | 1485 } |
1485 #endif | 1486 #endif // GRAAL_COUNTER_SIZE > 0 |
1487 #endif // GRAAL | |
1486 _exception_oop = NULL; | 1488 _exception_oop = NULL; |
1487 _exception_pc = 0; | 1489 _exception_pc = 0; |
1488 _exception_handler_pc = 0; | 1490 _exception_handler_pc = 0; |
1489 _is_method_handle_return = 0; | 1491 _is_method_handle_return = 0; |
1490 _jvmti_thread_state= NULL; | 1492 _jvmti_thread_state= NULL; |
1673 if (_thread_stat != NULL) delete _thread_stat; | 1675 if (_thread_stat != NULL) delete _thread_stat; |
1674 | 1676 |
1675 #if defined(GRAAL) && (GRAAL_COUNTERS_SIZE > 0) | 1677 #if defined(GRAAL) && (GRAAL_COUNTERS_SIZE > 0) |
1676 if (graal_counters_include(threadObj())) { | 1678 if (graal_counters_include(threadObj())) { |
1677 for (int i = 0; i < GRAAL_COUNTERS_SIZE; i++) { | 1679 for (int i = 0; i < GRAAL_COUNTERS_SIZE; i++) { |
1678 _graal_old_counters[i] += _graal_counters[i]; | 1680 _graal_old_thread_counters[i] += _graal_counters[i]; |
1679 } | 1681 } |
1680 } | 1682 } |
1681 #endif | 1683 #endif |
1682 } | 1684 } |
1683 | 1685 |