< prev index next >
src/hotspot/share/gc/parallel/psCompactionManager.cpp
8224665: Parallel GC: Use WorkGang (7: remove task manager)
/*
! * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
/*
! * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
***************
*
*/
#include "precompiled.hpp"
#include "classfile/systemDictionary.hpp"
- #include "gc/parallel/gcTaskManager.hpp"
#include "gc/parallel/objectStartArray.hpp"
#include "gc/parallel/parMarkBitMap.inline.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
#include "gc/parallel/psCompactionManager.inline.hpp"
#include "gc/parallel/psOldGen.hpp"
***************
reset_bitmap_query_cache();
}
void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
! assert(PSParallelCompact::gc_task_manager() != NULL,
"Needed for initialization");
_mark_bitmap = mbm;
! uint parallel_gc_threads = PSParallelCompact::gc_task_manager()->workers();
assert(_manager_array == NULL, "Attempt to initialize twice");
_manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads+1, mtGC);
guarantee(_manager_array != NULL, "Could not allocate manager_array");
reset_bitmap_query_cache();
}
void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
! assert(ParallelScavengeHeap::heap() != NULL,
"Needed for initialization");
_mark_bitmap = mbm;
! uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().total_workers();
assert(_manager_array == NULL, "Attempt to initialize twice");
_manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads+1, mtGC);
guarantee(_manager_array != NULL, "Could not allocate manager_array");
***************
// The VMThread gets its own ParCompactionManager, which is not available
// for work stealing.
_manager_array[parallel_gc_threads] = new ParCompactionManager();
guarantee(_manager_array[parallel_gc_threads] != NULL,
"Could not create ParCompactionManager");
! assert(PSParallelCompact::gc_task_manager()->workers() != 0,
"Not initialized?");
}
void ParCompactionManager::reset_all_bitmap_query_caches() {
! uint parallel_gc_threads = PSParallelCompact::gc_task_manager()->workers();
for (uint i=0; i<=parallel_gc_threads; i++) {
_manager_array[i]->reset_bitmap_query_cache();
}
}
// The VMThread gets its own ParCompactionManager, which is not available
// for work stealing.
_manager_array[parallel_gc_threads] = new ParCompactionManager();
guarantee(_manager_array[parallel_gc_threads] != NULL,
"Could not create ParCompactionManager");
! assert(ParallelScavengeHeap::heap()->workers().total_workers() != 0,
"Not initialized?");
}
void ParCompactionManager::reset_all_bitmap_query_caches() {
! uint parallel_gc_threads = ParallelScavengeHeap::heap()->workers().total_workers();
for (uint i=0; i<=parallel_gc_threads; i++) {
_manager_array[i]->reset_bitmap_query_cache();
}
}
< prev index next >