mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-18 10:04:42 +02:00
8272520: Inline GenericTaskQueue::initialize() to the constructor
Reviewed-by: kbarrett, iwalulya
This commit is contained in:
parent
ed57cf1cf3
commit
2aaf795270
10 changed files with 4 additions and 23 deletions
|
@ -1511,7 +1511,6 @@ G1CollectedHeap::G1CollectedHeap() :
|
||||||
|
|
||||||
for (uint i = 0; i < n_queues; i++) {
|
for (uint i = 0; i < n_queues; i++) {
|
||||||
G1ScannerTasksQueue* q = new G1ScannerTasksQueue();
|
G1ScannerTasksQueue* q = new G1ScannerTasksQueue();
|
||||||
q->initialize();
|
|
||||||
_task_queues->register_queue(i, q);
|
_task_queues->register_queue(i, q);
|
||||||
::new (&_evacuation_failed_info_array[i]) EvacuationFailedInfo();
|
::new (&_evacuation_failed_info_array[i]) EvacuationFailedInfo();
|
||||||
}
|
}
|
||||||
|
|
|
@ -445,7 +445,6 @@ G1ConcurrentMark::G1ConcurrentMark(G1CollectedHeap* g1h,
|
||||||
|
|
||||||
for (uint i = 0; i < _max_num_tasks; ++i) {
|
for (uint i = 0; i < _max_num_tasks; ++i) {
|
||||||
G1CMTaskQueue* task_queue = new G1CMTaskQueue();
|
G1CMTaskQueue* task_queue = new G1CMTaskQueue();
|
||||||
task_queue->initialize();
|
|
||||||
_task_queues->register_queue(i, task_queue);
|
_task_queues->register_queue(i, task_queue);
|
||||||
|
|
||||||
_tasks[i] = new G1CMTask(i, this, task_queue, _region_mark_stats);
|
_tasks[i] = new G1CMTask(i, this, task_queue, _region_mark_stats);
|
||||||
|
|
|
@ -46,8 +46,6 @@ G1FullGCMarker::G1FullGCMarker(G1FullCollector* collector,
|
||||||
_cld_closure(mark_closure(), ClassLoaderData::_claim_strong),
|
_cld_closure(mark_closure(), ClassLoaderData::_claim_strong),
|
||||||
_mark_stats_cache(mark_stats, G1RegionMarkStatsCache::RegionMarkStatsCacheSize) {
|
_mark_stats_cache(mark_stats, G1RegionMarkStatsCache::RegionMarkStatsCacheSize) {
|
||||||
_mark_stats_cache.reset();
|
_mark_stats_cache.reset();
|
||||||
_oop_stack.initialize();
|
|
||||||
_objarray_stack.initialize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
G1FullGCMarker::~G1FullGCMarker() {
|
G1FullGCMarker::~G1FullGCMarker() {
|
||||||
|
|
|
@ -58,10 +58,6 @@ ParCompactionManager::ParCompactionManager() {
|
||||||
_old_gen = heap->old_gen();
|
_old_gen = heap->old_gen();
|
||||||
_start_array = old_gen()->start_array();
|
_start_array = old_gen()->start_array();
|
||||||
|
|
||||||
marking_stack()->initialize();
|
|
||||||
_objarray_stack.initialize();
|
|
||||||
_region_stack.initialize();
|
|
||||||
|
|
||||||
reset_bitmap_query_cache();
|
reset_bitmap_query_cache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -190,7 +190,6 @@ PSPromotionManager::PSPromotionManager() {
|
||||||
_old_lab.set_start_array(old_gen()->start_array());
|
_old_lab.set_start_array(old_gen()->start_array());
|
||||||
|
|
||||||
uint queue_size;
|
uint queue_size;
|
||||||
claimed_stack_depth()->initialize();
|
|
||||||
queue_size = claimed_stack_depth()->max_elems();
|
queue_size = claimed_stack_depth()->max_elems();
|
||||||
|
|
||||||
_totally_drain = (ParallelGCThreads == 1) || (GCDrainStackTargetSize == 0);
|
_totally_drain = (ParallelGCThreads == 1) || (GCDrainStackTargetSize == 0);
|
||||||
|
|
|
@ -345,8 +345,6 @@ public:
|
||||||
// Initializes the queue to empty.
|
// Initializes the queue to empty.
|
||||||
GenericTaskQueue();
|
GenericTaskQueue();
|
||||||
|
|
||||||
void initialize();
|
|
||||||
|
|
||||||
// Push the task "t" on the queue. Returns "false" iff the queue is full.
|
// Push the task "t" on the queue. Returns "false" iff the queue is full.
|
||||||
inline bool push(E t);
|
inline bool push(E t);
|
||||||
|
|
||||||
|
@ -392,11 +390,6 @@ public:
|
||||||
void invalidate_last_stolen_queue_id() { _last_stolen_queue_id = InvalidQueueId; }
|
void invalidate_last_stolen_queue_id() { _last_stolen_queue_id = InvalidQueueId; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class E, MEMFLAGS F, unsigned int N>
|
|
||||||
GenericTaskQueue<E, F, N>::GenericTaskQueue() : _last_stolen_queue_id(InvalidQueueId), _seed(17 /* random number */) {
|
|
||||||
assert(sizeof(Age) == sizeof(size_t), "Depends on this.");
|
|
||||||
}
|
|
||||||
|
|
||||||
// OverflowTaskQueue is a TaskQueue that also includes an overflow stack for
|
// OverflowTaskQueue is a TaskQueue that also includes an overflow stack for
|
||||||
// elements that do not fit in the TaskQueue.
|
// elements that do not fit in the TaskQueue.
|
||||||
//
|
//
|
||||||
|
|
|
@ -49,9 +49,10 @@ inline GenericTaskQueueSet<T, F>::~GenericTaskQueueSet() {
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class E, MEMFLAGS F, unsigned int N>
|
template<class E, MEMFLAGS F, unsigned int N>
|
||||||
inline void GenericTaskQueue<E, F, N>::initialize() {
|
inline GenericTaskQueue<E, F, N>::GenericTaskQueue() :
|
||||||
_elems = ArrayAllocator<E>::allocate(N, F);
|
_elems(ArrayAllocator<E>::allocate(N, F)),
|
||||||
}
|
_last_stolen_queue_id(InvalidQueueId),
|
||||||
|
_seed(17 /* random number */) {}
|
||||||
|
|
||||||
template<class E, MEMFLAGS F, unsigned int N>
|
template<class E, MEMFLAGS F, unsigned int N>
|
||||||
inline GenericTaskQueue<E, F, N>::~GenericTaskQueue() {
|
inline GenericTaskQueue<E, F, N>::~GenericTaskQueue() {
|
||||||
|
|
|
@ -1425,7 +1425,6 @@ private:
|
||||||
// Initialize queues for every workers
|
// Initialize queues for every workers
|
||||||
for (uint i = 0; i < _num_workers; ++i) {
|
for (uint i = 0; i < _num_workers; ++i) {
|
||||||
ShenandoahObjToScanQueue* task_queue = new ShenandoahObjToScanQueue();
|
ShenandoahObjToScanQueue* task_queue = new ShenandoahObjToScanQueue();
|
||||||
task_queue->initialize();
|
|
||||||
_task_queues->register_queue(i, task_queue);
|
_task_queues->register_queue(i, task_queue);
|
||||||
}
|
}
|
||||||
// Divide roots among the workers. Assume that object referencing distribution
|
// Divide roots among the workers. Assume that object referencing distribution
|
||||||
|
|
|
@ -40,7 +40,6 @@ ShenandoahMarkingContext::ShenandoahMarkingContext(MemRegion heap_region, MemReg
|
||||||
assert(max_queues > 0, "At least one queue");
|
assert(max_queues > 0, "At least one queue");
|
||||||
for (uint i = 0; i < max_queues; ++i) {
|
for (uint i = 0; i < max_queues; ++i) {
|
||||||
ShenandoahObjToScanQueue* task_queue = new ShenandoahObjToScanQueue();
|
ShenandoahObjToScanQueue* task_queue = new ShenandoahObjToScanQueue();
|
||||||
task_queue->initialize();
|
|
||||||
_task_queues->register_queue(i, task_queue);
|
_task_queues->register_queue(i, task_queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,14 +206,12 @@ ZHeapIterator::ZHeapIterator(uint nworkers, bool visit_weaks) :
|
||||||
// Create queues
|
// Create queues
|
||||||
for (uint i = 0; i < _queues.size(); i++) {
|
for (uint i = 0; i < _queues.size(); i++) {
|
||||||
ZHeapIteratorQueue* const queue = new ZHeapIteratorQueue();
|
ZHeapIteratorQueue* const queue = new ZHeapIteratorQueue();
|
||||||
queue->initialize();
|
|
||||||
_queues.register_queue(i, queue);
|
_queues.register_queue(i, queue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create array queues
|
// Create array queues
|
||||||
for (uint i = 0; i < _array_queues.size(); i++) {
|
for (uint i = 0; i < _array_queues.size(); i++) {
|
||||||
ZHeapIteratorArrayQueue* const array_queue = new ZHeapIteratorArrayQueue();
|
ZHeapIteratorArrayQueue* const array_queue = new ZHeapIteratorArrayQueue();
|
||||||
array_queue->initialize();
|
|
||||||
_array_queues.register_queue(i, array_queue);
|
_array_queues.register_queue(i, array_queue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue