hotspot Cdiff src/share/vm/runtime/thread.cpp (original) (raw)

src/share/vm/runtime/thread.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/runtime/thread.cpp Print this page


*** 97,106 **** --- 97,110 ---- #if INCLUDE_ALL_GCS #include "gc/cms/concurrentMarkSweepThread.hpp" #include "gc/g1/concurrentMarkThread.inline.hpp" #include "gc/parallel/pcTasks.hpp" #endif // INCLUDE_ALL_GCS


*** 1384,1393 **** --- 1388,1424 ---- st->cr(); }
// ======= JavaThread ========
+ #if INCLUDE_JVMCI + + jlong* JavaThread::_jvmci_old_thread_counters; + + bool jvmci_counters_include(JavaThread* thread) { + oop threadObj = thread->threadObj(); + return !JVMCICountersExcludeCompiler || !thread->is_Compiler_thread(); + } + + void JavaThread::collect_counters(typeArrayOop array) { + if (JVMCICounterSize > 0) { + MutexLocker tl(Threads_lock); + for (int i = 0; i < array->length(); i++) { + array->long_at_put(i, _jvmci_old_thread_counters[i]); + } + for (JavaThread* tp = Threads::first(); tp != NULL; tp = tp->next()) { + if (jvmci_counters_include(tp)) { + for (int i = 0; i < array->length(); i++) { + array->long_at_put(i, array->long_at(i) + tp->_jvmci_counters[i]); + } + } + } + } + } + + #endif + // A JavaThread is a normal Java thread
void JavaThread::initialize() { // Initialize fields

*** 1416,1425 **** --- 1447,1470 ---- _array_for_gc = NULL; _suspend_equivalent = false; _in_deopt_handler = 0; _doing_unsafe_access = false; _stack_guard_state = stack_guard_unused;


*** 1590,1599 **** --- 1635,1655 ----

// All Java related clean up happens in exit
ThreadSafepointState::destroy(this);
if (_thread_profiler != NULL) delete _thread_profiler;
if (_thread_stat != NULL) delete _thread_stat;

+


*** 2133,2143 **** assert(Threads_lock->is_locked(), "Threads_lock should be locked by safepoint code"); assert(SafepointSynchronize::is_at_safepoint(), "all threads are stopped");

// Do not throw asynchronous exceptions against the compiler thread
// (the compiler thread should not be a Java thread -- fix in 1.4.2)

! if (is_Compiler_thread()) return;

{
  // Actually throw the Throwable against the target Thread - however
  // only if there is no thread death exception installed already.
  if (_pending_async_exception == NULL || !_pending_async_exception->is_a(SystemDictionary::ThreadDeath_klass())) {

--- 2189,2199 ---- assert(Threads_lock->is_locked(), "Threads_lock should be locked by safepoint code"); assert(SafepointSynchronize::is_at_safepoint(), "all threads are stopped");

// Do not throw asynchronous exceptions against the compiler thread
// (the compiler thread should not be a Java thread -- fix in 1.4.2)

! if (!can_call_java()) return;

{
  // Actually throw the Throwable against the target Thread - however
  // only if there is no thread death exception installed already.
  if (_pending_async_exception == NULL || !_pending_async_exception->is_a(SystemDictionary::ThreadDeath_klass())) {

*** 2612,2627 **** if (!has_last_Java_frame()) return; // BiasedLocking needs an updated RegisterMap for the revoke monitors pass StackFrameStream fst(this, UseBiasedLocking); for (; !fst.is_done(); fst.next()) { if (fst.current()->should_be_deoptimized()) { - if (LogCompilation && xtty != NULL) { - nmethod* nm = fst.current()->cb()->as_nmethod_or_null(); - xtty->elem("deoptimized thread='" UINTX_FORMAT "' compile_id='%d'", - this->name(), nm != NULL ? nm->compile_id() : -1); - }

    Deoptimization::deoptimize(this, *fst.current(), fst.register_map());
  }
}

}

--- 2668,2677 ----


*** 2656,2665 **** --- 2706,2717 ---- // since there may be more than one thread using each ThreadProfiler.

// Traverse the GCHandles
Thread::oops_do(f, cld_f, cf);

*** 3173,3182 **** --- 3225,3238 ---- #ifndef PRODUCT _ideal_graph_printer = NULL; #endif }


*** 3378,3387 **** --- 3434,3452 ---- _number_of_non_daemon_threads = 0;

// Initialize global data structures and create system classes in heap
vm_init_globals();

*** 3504,3514 **** // Compute system loader. Note that this has to occur after set_init_completed, since // valid exceptions may be thrown in the process. // Note that we do not use CHECK_0 here since we are inside an EXCEPTION_MARK and // set_init_completed has just been called, causing exceptions not to be shortcut // anymore. We call vm_exit_during_initialization directly instead. ! SystemDictionary::compute_java_system_loader(CHECK_JNI_ERR);

#if INCLUDE_ALL_GCS // Support for ConcurrentMarkSweep. This should be cleaned up // and better encapsulated. The ugly nested if test would go away // once things are properly refactored. XXX YSR --- 3569,3579 ---- // Compute system loader. Note that this has to occur after set_init_completed, since // valid exceptions may be thrown in the process. // Note that we do not use CHECK_0 here since we are inside an EXCEPTION_MARK and // set_init_completed has just been called, causing exceptions not to be shortcut // anymore. We call vm_exit_during_initialization directly instead. ! SystemDictionary::compute_java_system_loader(CHECK_(JNI_ERR));

#if INCLUDE_ALL_GCS // Support for ConcurrentMarkSweep. This should be cleaned up // and better encapsulated. The ugly nested if test would go away // once things are properly refactored. XXX YSR


*** 3552,3563 ****

if (CleanChunkPoolAsync) {
  Chunk::start_chunk_pool_cleaner_task();
}

// initialize compiler(s)

! #if defined(COMPILER1) || defined(COMPILER2) || defined(SHARK) CompileBroker::compilation_init(); #endif

// Pre-initialize some JSR292 core classes to avoid deadlock during class loading.
// It is done after compilers are initialized, because otherwise compilations of

--- 3617,3641 ----

if (CleanChunkPoolAsync) {
  Chunk::start_chunk_pool_cleaner_task();
}

*** 3961,3970 **** --- 4039,4054 ----

notify_vm_shutdown();

delete thread;

*** 4177,4187 ****

int i = 0;
{
  MutexLockerEx ml(doLock ? Threads_lock : NULL);
  ALL_JAVA_THREADS(p) {

! if (p->is_Compiler_thread()) continue;

    address pending = (address)p->current_pending_monitor();
    if (pending == monitor) {             // found a match
      if (i < count) result->append(p);   // save the first count matches
      i++;

--- 4261,4271 ----

int i = 0;
{
  MutexLockerEx ml(doLock ? Threads_lock : NULL);
  ALL_JAVA_THREADS(p) {

! if (!p->can_call_java()) continue;

    address pending = (address)p->current_pending_monitor();
    if (pending == monitor) {             // found a match
      if (i < count) result->append(p);   // save the first count matches
      i++;

*** 4234,4244 ****

// Threads::print_on() is called at safepoint by VM_PrintThreads operation. void Threads::print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks) { char buf[32]; ! st->print_cr("%s", os::local_time_string(buf, sizeof(buf)));

st->print_cr("Full thread dump %s (%s %s):",
             Abstract_VM_Version::vm_name(),
             Abstract_VM_Version::vm_release(),
             Abstract_VM_Version::vm_info_string());

--- 4318,4328 ----

// Threads::print_on() is called at safepoint by VM_PrintThreads operation. void Threads::print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks) { char buf[32]; ! st->print_raw_cr(os::local_time_string(buf, sizeof(buf)));

st->print_cr("Full thread dump %s (%s %s):",
             Abstract_VM_Version::vm_name(),
             Abstract_VM_Version::vm_release(),
             Abstract_VM_Version::vm_info_string());

src/share/vm/runtime/thread.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File