8213224: Move code related to GC threads calculation out of AdaptiveSizePolicy

Consolidate code related to GC threads calculation into a single class

Reviewed-by: tschatzl, pliden
This commit is contained in:
Man Cao 2018-12-07 12:46:31 +08:00
parent 714b05023e
commit df4b7015bf
18 changed files with 387 additions and 306 deletions

View file

@ -27,6 +27,7 @@
#include "gc/parallel/gcTaskThread.hpp"
#include "gc/shared/gcId.hpp"
#include "gc/shared/workerManager.hpp"
#include "gc/shared/workerPolicy.hpp"
#include "logging/log.hpp"
#include "logging/logStream.hpp"
#include "memory/allocation.hpp"
@ -494,9 +495,9 @@ GCTaskManager::~GCTaskManager() {
void GCTaskManager::set_active_gang() {
_active_workers =
AdaptiveSizePolicy::calc_active_workers(workers(),
active_workers(),
Threads::number_of_non_daemon_threads());
WorkerPolicy::calc_active_workers(workers(),
active_workers(),
Threads::number_of_non_daemon_threads());
assert(!all_workers_active() || active_workers() == ParallelGCThreads,
"all_workers_active() is incorrect: "