< prev index next >

src/share/vm/runtime/thread.cpp

Print this page
rev 11777 : [mq]: gcinterface.patch
rev 11778 : [mq]: service.patch

*** 100,114 **** #include "utilities/defaultStream.hpp" #include "utilities/dtrace.hpp" #include "utilities/events.hpp" #include "utilities/macros.hpp" #include "utilities/preserveException.hpp" - #if INCLUDE_ALL_GCS - #include "gc/cms/concurrentMarkSweepThread.hpp" - #include "gc/g1/concurrentMarkThread.inline.hpp" - #include "gc/parallel/pcTasks.hpp" - #endif // INCLUDE_ALL_GCS #if INCLUDE_JVMCI #include "jvmci/jvmciCompiler.hpp" #include "jvmci/jvmciRuntime.hpp" #endif #ifdef COMPILER1 --- 100,109 ----
*** 1911,1921 **** JvmtiExport::cleanup_thread(this); } // We must flush any deferred card marks before removing a thread from // the list of active threads. ! Universe::heap()->flush_deferred_store_barrier(this); assert(deferred_card_mark().is_empty(), "Should have been flushed"); #if INCLUDE_ALL_GCS // We must flush the G1-related buffers before removing a thread // from the list of active threads. We must do this after any deferred --- 1906,1916 ---- JvmtiExport::cleanup_thread(this); } // We must flush any deferred card marks before removing a thread from // the list of active threads. ! GC::gc()->heap()->flush_deferred_store_barrier(this); assert(deferred_card_mark().is_empty(), "Should have been flushed"); #if INCLUDE_ALL_GCS // We must flush the G1-related buffers before removing a thread // from the list of active threads. We must do this after any deferred
*** 3353,3363 **** tc->do_thread(p); } // Someday we could have a table or list of all non-JavaThreads. // For now, just manually iterate through them. tc->do_thread(VMThread::vm_thread()); ! Universe::heap()->gc_threads_do(tc); WatcherThread *wt = WatcherThread::watcher_thread(); // Strictly speaking, the following NULL check isn't sufficient to make sure // the data for WatcherThread is still valid upon being examined. However, // considering that WatchThread terminates when the VM is on the way to // exit at safepoint, the chance of the above is extremely small. The right --- 3348,3358 ---- tc->do_thread(p); } // Someday we could have a table or list of all non-JavaThreads. // For now, just manually iterate through them. tc->do_thread(VMThread::vm_thread()); ! GC::gc()->heap()->gc_threads_do(tc); WatcherThread *wt = WatcherThread::watcher_thread(); // Strictly speaking, the following NULL check isn't sufficient to make sure // the data for WatcherThread is still valid upon being examined. However, // considering that WatchThread terminates when the VM is on the way to // exit at safepoint, the chance of the above is extremely small. The right
*** 3530,3539 **** --- 3525,3540 ---- jint parse_result = Arguments::parse(args); if (parse_result != JNI_OK) return parse_result; os::init_before_ergo(); + Arguments::select_gc(); + jint gc_result = GC::initialize(); + if (gc_result != JNI_OK) { + return gc_result; + } + jint ergo_result = Arguments::apply_ergo(); if (ergo_result != JNI_OK) return ergo_result; // Final check of all ranges after ergonomics which may change values. if (!CommandLineFlagRangeList::check_ranges()) {
*** 3718,3728 **** // 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. // Initialize reference pending list locker ! bool needs_locker_thread = Universe::heap()->needs_reference_pending_list_locker_thread(); ReferencePendingListLocker::initialize(needs_locker_thread, CHECK_JNI_ERR); // Signal Dispatcher needs to be started before VMInit event is posted os::signal_init(); --- 3719,3729 ---- // 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. // Initialize reference pending list locker ! bool needs_locker_thread = GC::gc()->heap()->needs_reference_pending_list_locker_thread(); ReferencePendingListLocker::initialize(needs_locker_thread, CHECK_JNI_ERR); // Signal Dispatcher needs to be started before VMInit event is posted os::signal_init();
*** 4341,4368 **** if (vmt->claim_oops_do(is_par, cp)) { vmt->oops_do(f, cf); } } - #if INCLUDE_ALL_GCS - // Used by ParallelScavenge - void Threads::create_thread_roots_tasks(GCTaskQueue* q) { - ALL_JAVA_THREADS(p) { - q->enqueue(new ThreadRootsTask(p)); - } - q->enqueue(new ThreadRootsTask(VMThread::vm_thread())); - } - - // Used by Parallel Old - void Threads::create_thread_roots_marking_tasks(GCTaskQueue* q) { - ALL_JAVA_THREADS(p) { - q->enqueue(new ThreadRootsMarkingTask(p)); - } - q->enqueue(new ThreadRootsMarkingTask(VMThread::vm_thread())); - } - #endif // INCLUDE_ALL_GCS - void Threads::nmethods_do(CodeBlobClosure* cf) { ALL_JAVA_THREADS(p) { // This is used by the code cache sweeper to mark nmethods that are active // on the stack of a Java thread. Ignore the sweeper thread itself to avoid // marking CodeCacheSweeperThread::_scanned_compiled_method as active. --- 4342,4351 ----
*** 4503,4513 **** #endif // INCLUDE_SERVICES } VMThread::vm_thread()->print_on(st); st->cr(); ! Universe::heap()->print_gc_threads_on(st); WatcherThread* wt = WatcherThread::watcher_thread(); if (wt != NULL) { wt->print_on(st); st->cr(); } --- 4486,4496 ---- #endif // INCLUDE_SERVICES } VMThread::vm_thread()->print_on(st); st->cr(); ! GC::gc()->heap()->print_gc_threads_on(st); WatcherThread* wt = WatcherThread::watcher_thread(); if (wt != NULL) { wt->print_on(st); st->cr(); }
*** 4560,4570 **** st->print_cr("Other Threads:"); print_on_error(VMThread::vm_thread(), st, current, buf, buflen, &found_current); print_on_error(WatcherThread::watcher_thread(), st, current, buf, buflen, &found_current); PrintOnErrorClosure print_closure(st, current, buf, buflen, &found_current); ! Universe::heap()->gc_threads_do(&print_closure); if (!found_current) { st->cr(); st->print("=>" PTR_FORMAT " (exited) ", p2i(current)); current->print_on_error(st, buf, buflen); --- 4543,4553 ---- st->print_cr("Other Threads:"); print_on_error(VMThread::vm_thread(), st, current, buf, buflen, &found_current); print_on_error(WatcherThread::watcher_thread(), st, current, buf, buflen, &found_current); PrintOnErrorClosure print_closure(st, current, buf, buflen, &found_current); ! GC::gc()->heap()->gc_threads_do(&print_closure); if (!found_current) { st->cr(); st->print("=>" PTR_FORMAT " (exited) ", p2i(current)); current->print_on_error(st, buf, buflen);
< prev index next >