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

src/share/vm/runtime/thread.cpp

Print this page

        

*** 60,70 **** #include "runtime/biasedLocking.hpp" #include "runtime/commandLineFlagConstraintList.hpp" #include "runtime/commandLineFlagWriteableList.hpp" #include "runtime/commandLineFlagRangeList.hpp" #include "runtime/deoptimization.hpp" - #include "runtime/fprofiler.hpp" #include "runtime/frame.inline.hpp" #include "runtime/globals.hpp" #include "runtime/init.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/java.hpp" --- 60,69 ----
*** 744,766 **** _jmp_ring[index]._file = file; _jmp_ring[index]._line = line; } #endif // PRODUCT - // Called by flat profiler - // Callers have already called wait_for_ext_suspend_completion - // The assertion for that is currently too complex to put here: - bool JavaThread::profile_last_Java_frame(frame* _fr) { - bool gotframe = false; - // self suspension saves needed state. - if (has_last_Java_frame() && _anchor.walkable()) { - *_fr = pd_last_frame(); - gotframe = true; - } - return gotframe; - } - void Thread::interrupt(Thread* thread) { debug_only(check_for_dangling_thread_pointer(thread);) os::interrupt(thread); } --- 743,752 ----
*** 1370,1387 **** MutexLocker mu(Terminator_lock); while (watcher_thread() != NULL) { // This wait should make safepoint checks, wait without a timeout, // and wait as a suspend-equivalent condition. - // - // Note: If the FlatProfiler is running, then this thread is waiting - // for the WatcherThread to terminate and the WatcherThread, via the - // FlatProfiler task, is waiting for the external suspend request on - // this thread to complete. wait_for_ext_suspend_completion() will - // eventually timeout, but that takes time. Making this wait a - // suspend-equivalent condition solves that timeout problem. - // Terminator_lock->wait(!Mutex::_no_safepoint_check_flag, 0, Mutex::_as_suspend_equivalent_flag); } } --- 1356,1365 ----
*** 1494,1513 **** for (int ji = 0; ji < jump_ring_buffer_size; ji++) { record_jump(NULL, NULL, NULL, 0); } #endif // PRODUCT - set_thread_profiler(NULL); - if (FlatProfiler::is_active()) { - // This is where we would decide to either give each thread it's own profiler - // or use one global one from FlatProfiler, - // or up to some count of the number of profiled threads, etc. - ThreadProfiler* pp = new ThreadProfiler(); - pp->engage(); - set_thread_profiler(pp); - } - // Setup safepoint state info for this thread ThreadSafepointState::create(this); debug_only(_java_call_counter = 0); --- 1472,1481 ----
*** 1649,1659 **** delete deferred; } // 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; #if INCLUDE_JVMCI if (JVMCICounterSize > 0) { if (jvmci_counters_include(this)) { --- 1617,1626 ----
*** 1764,1780 **** Handle uncaught_exception(this, this->pending_exception()); this->clear_pending_exception(); Handle threadObj(this, this->threadObj()); assert(threadObj.not_null(), "Java thread object should be created"); - if (get_thread_profiler() != NULL) { - get_thread_profiler()->disengage(); - ResourceMark rm; - get_thread_profiler()->print(get_thread_name()); - } - - // FIXIT: This code should be moved into else part, when reliable 1.2/1.3 check is in place { EXCEPTION_MARK; CLEAR_PENDING_EXCEPTION; --- 1731,1740 ----
*** 1972,1987 **** assert(dirty_queue.is_active(), "dirty card queue should be active"); } #endif // INCLUDE_ALL_GCS void JavaThread::cleanup_failed_attach_current_thread() { - if (get_thread_profiler() != NULL) { - get_thread_profiler()->disengage(); - ResourceMark rm; - get_thread_profiler()->print(get_thread_name()); - } - if (active_handles() != NULL) { JNIHandleBlock* block = active_handles(); set_active_handles(NULL); JNIHandleBlock::release_block(block); } --- 1932,1941 ----
*** 2761,2773 **** void JavaThread::oops_do(OopClosure* f, CodeBlobClosure* cf) { // Verify that the deferred card marks have been flushed. assert(deferred_card_mark().is_empty(), "Should be empty during GC"); - // The ThreadProfiler oops_do is done from FlatProfiler::oops_do - // since there may be more than one thread using each ThreadProfiler. - // Traverse the GCHandles Thread::oops_do(f, cf); JVMCI_ONLY(f->do_oop((oop*)&_pending_failed_speculation);) --- 2715,2724 ----
*** 3808,3818 **** // stack trace if appropriate. Simply exit VM. vm_exit(1); } #endif // INCLUDE_MANAGEMENT - if (Arguments::has_profile()) FlatProfiler::engage(main_thread, true); if (MemProfiling) MemProfiler::engage(); StatSampler::engage(); if (CheckJNICalls) JniPeriodicChecker::engage(); BiasedLocking::init(); --- 3759,3768 ----
*** 4098,4108 **** // + Call java.lang.Shutdown.shutdown(), which will invoke Java level // shutdown hooks, run finalizers if finalization-on-exit // + Call before_exit(), prepare for VM exit // > run VM level shutdown hooks (they are registered through JVM_OnExit(), // currently the only user of this mechanism is File.deleteOnExit()) ! // > stop flat profiler, StatSampler, watcher thread, CMS threads, // post thread end and vm death events to JVMTI, // stop signal thread // + Call JavaThread::exit(), it will: // > release JNI handle blocks, remove stack guard pages // > remove this thread from Threads list --- 4048,4058 ---- // + Call java.lang.Shutdown.shutdown(), which will invoke Java level // shutdown hooks, run finalizers if finalization-on-exit // + Call before_exit(), prepare for VM exit // > run VM level shutdown hooks (they are registered through JVM_OnExit(), // currently the only user of this mechanism is File.deleteOnExit()) ! // > stop StatSampler, watcher thread, CMS threads, // post thread end and vm death events to JVMTI, // stop signal thread // + Call JavaThread::exit(), it will: // > release JNI handle blocks, remove stack guard pages // > remove this thread from Threads list
*** 4127,4144 **** // Wait until we are the last non-daemon thread to execute { MutexLocker nu(Threads_lock); while (Threads::number_of_non_daemon_threads() > 1) // This wait should make safepoint checks, wait without a timeout, // and wait as a suspend-equivalent condition. - // - // Note: If the FlatProfiler is running and this thread is waiting - // for another non-daemon thread to finish, then the FlatProfiler - // is waiting for the external suspend request on this thread to - // complete. wait_for_ext_suspend_completion() will eventually - // timeout, but that takes time. Making this wait a suspend- - // equivalent condition solves that timeout problem. - // Threads_lock->wait(!Mutex::_no_safepoint_check_flag, 0, Mutex::_as_suspend_equivalent_flag); } // Hang forever on exit if we are reporting an error. --- 4077,4086 ----
src/share/vm/runtime/thread.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File