< prev index next >
src/share/vm/runtime/thread.cpp
Print this page
rev 12310 : [mq]: gcinterface.patch
*** 99,113 ****
#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
--- 99,108 ----
*** 1913,1923 ****
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
--- 1908,1918 ----
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
*** 3355,3365 ****
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
--- 3350,3360 ----
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
*** 3532,3541 ****
--- 3527,3542 ----
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()) {
*** 4346,4373 ****
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.
--- 4347,4356 ----
*** 4508,4518 ****
#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();
}
--- 4491,4501 ----
#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();
}
*** 4565,4575 ****
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);
--- 4548,4558 ----
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 >