8202649: Move the Parallel GC specific task creation functions out of Threads

Reviewed-by: ehelin, pliden
This commit is contained in:
Stefan Karlsson 2018-05-07 16:12:07 +02:00
parent 99072b90d7
commit c590979683
8 changed files with 50 additions and 51 deletions

View file

@ -114,9 +114,6 @@
#include "utilities/macros.hpp"
#include "utilities/preserveException.hpp"
#include "utilities/vmError.hpp"
#if INCLUDE_PARALLELGC
#include "gc/parallel/pcTasks.hpp"
#endif
#if INCLUDE_JVMCI
#include "jvmci/jvmciCompiler.hpp"
#include "jvmci/jvmciRuntime.hpp"
@ -3436,13 +3433,25 @@ void Threads::non_java_threads_do(ThreadClosure* tc) {
// If CompilerThreads ever become non-JavaThreads, add them here
}
// All JavaThreads + all non-JavaThreads (i.e., every thread in the system).
void Threads::threads_do(ThreadClosure* tc) {
// All JavaThreads
void Threads::java_threads_do(ThreadClosure* tc) {
assert_locked_or_safepoint(Threads_lock);
// ALL_JAVA_THREADS iterates through all JavaThreads.
ALL_JAVA_THREADS(p) {
tc->do_thread(p);
}
}
void Threads::java_threads_and_vm_thread_do(ThreadClosure* tc) {
assert_locked_or_safepoint(Threads_lock);
java_threads_do(tc);
tc->do_thread(VMThread::vm_thread());
}
// All JavaThreads + all non-JavaThreads (i.e., every thread in the system).
void Threads::threads_do(ThreadClosure* tc) {
assert_locked_or_safepoint(Threads_lock);
java_threads_do(tc);
non_java_threads_do(tc);
}
@ -4465,24 +4474,6 @@ void Threads::possibly_parallel_oops_do(bool is_par, OopClosure* f, CodeBlobClos
possibly_parallel_threads_do(is_par, &tc);
}
#if INCLUDE_PARALLELGC
// 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_PARALLELGC
void Threads::nmethods_do(CodeBlobClosure* cf) {
ALL_JAVA_THREADS(p) {
// This is used by the code cache sweeper to mark nmethods that are active