mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8238160: Uniformize Parallel GC task queue variable names
Reviewed-by: kbarrett, sangheki
This commit is contained in:
parent
1d42f083c1
commit
c16040393c
7 changed files with 37 additions and 38 deletions
|
@ -40,15 +40,15 @@
|
||||||
#include "oops/objArrayKlass.inline.hpp"
|
#include "oops/objArrayKlass.inline.hpp"
|
||||||
#include "oops/oop.inline.hpp"
|
#include "oops/oop.inline.hpp"
|
||||||
|
|
||||||
PSOldGen* ParCompactionManager::_old_gen = NULL;
|
PSOldGen* ParCompactionManager::_old_gen = NULL;
|
||||||
ParCompactionManager** ParCompactionManager::_manager_array = NULL;
|
ParCompactionManager** ParCompactionManager::_manager_array = NULL;
|
||||||
|
|
||||||
OopTaskQueueSet* ParCompactionManager::_stack_array = NULL;
|
ParCompactionManager::OopTaskQueueSet* ParCompactionManager::_oop_task_queues = NULL;
|
||||||
ParCompactionManager::ObjArrayTaskQueueSet*
|
ParCompactionManager::ObjArrayTaskQueueSet* ParCompactionManager::_objarray_task_queues = NULL;
|
||||||
ParCompactionManager::_objarray_queues = NULL;
|
ParCompactionManager::RegionTaskQueueSet* ParCompactionManager::_region_task_queues = NULL;
|
||||||
|
|
||||||
ObjectStartArray* ParCompactionManager::_start_array = NULL;
|
ObjectStartArray* ParCompactionManager::_start_array = NULL;
|
||||||
ParMarkBitMap* ParCompactionManager::_mark_bitmap = NULL;
|
ParMarkBitMap* ParCompactionManager::_mark_bitmap = NULL;
|
||||||
RegionTaskQueueSet* ParCompactionManager::_region_array = NULL;
|
|
||||||
GrowableArray<size_t >* ParCompactionManager::_shadow_region_array = NULL;
|
GrowableArray<size_t >* ParCompactionManager::_shadow_region_array = NULL;
|
||||||
Monitor* ParCompactionManager::_shadow_region_monitor = NULL;
|
Monitor* ParCompactionManager::_shadow_region_monitor = NULL;
|
||||||
|
|
||||||
|
@ -77,20 +77,20 @@ void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
|
||||||
assert(_manager_array == NULL, "Attempt to initialize twice");
|
assert(_manager_array == NULL, "Attempt to initialize twice");
|
||||||
_manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads+1, mtGC);
|
_manager_array = NEW_C_HEAP_ARRAY(ParCompactionManager*, parallel_gc_threads+1, mtGC);
|
||||||
|
|
||||||
_stack_array = new OopTaskQueueSet(parallel_gc_threads);
|
_oop_task_queues = new OopTaskQueueSet(parallel_gc_threads);
|
||||||
guarantee(_stack_array != NULL, "Could not allocate stack_array");
|
guarantee(_oop_task_queues != NULL, "Could not allocate oop task queues");
|
||||||
_objarray_queues = new ObjArrayTaskQueueSet(parallel_gc_threads);
|
_objarray_task_queues = new ObjArrayTaskQueueSet(parallel_gc_threads);
|
||||||
guarantee(_objarray_queues != NULL, "Could not allocate objarray_queues");
|
guarantee(_objarray_task_queues != NULL, "Could not allocate objarray task queues");
|
||||||
_region_array = new RegionTaskQueueSet(parallel_gc_threads);
|
_region_task_queues = new RegionTaskQueueSet(parallel_gc_threads);
|
||||||
guarantee(_region_array != NULL, "Could not allocate region_array");
|
guarantee(_region_task_queues != NULL, "Could not allocate region task queues");
|
||||||
|
|
||||||
// Create and register the ParCompactionManager(s) for the worker threads.
|
// Create and register the ParCompactionManager(s) for the worker threads.
|
||||||
for(uint i=0; i<parallel_gc_threads; i++) {
|
for(uint i=0; i<parallel_gc_threads; i++) {
|
||||||
_manager_array[i] = new ParCompactionManager();
|
_manager_array[i] = new ParCompactionManager();
|
||||||
guarantee(_manager_array[i] != NULL, "Could not create ParCompactionManager");
|
guarantee(_manager_array[i] != NULL, "Could not create ParCompactionManager");
|
||||||
stack_array()->register_queue(i, _manager_array[i]->marking_stack());
|
oop_task_queues()->register_queue(i, _manager_array[i]->marking_stack());
|
||||||
_objarray_queues->register_queue(i, &_manager_array[i]->_objarray_stack);
|
_objarray_task_queues->register_queue(i, &_manager_array[i]->_objarray_stack);
|
||||||
region_array()->register_queue(i, _manager_array[i]->region_stack());
|
region_task_queues()->register_queue(i, _manager_array[i]->region_stack());
|
||||||
}
|
}
|
||||||
|
|
||||||
// The VMThread gets its own ParCompactionManager, which is not available
|
// The VMThread gets its own ParCompactionManager, which is not available
|
||||||
|
|
|
@ -51,17 +51,22 @@ class ParCompactionManager : public CHeapObj<mtGC> {
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
typedef GenericTaskQueue<oop, mtGC> OopTaskQueue;
|
||||||
|
typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
|
||||||
|
|
||||||
// 32-bit: 4K * 8 = 32KiB; 64-bit: 8K * 16 = 128KiB
|
// 32-bit: 4K * 8 = 32KiB; 64-bit: 8K * 16 = 128KiB
|
||||||
#define QUEUE_SIZE (1 << NOT_LP64(12) LP64_ONLY(13))
|
#define QUEUE_SIZE (1 << NOT_LP64(12) LP64_ONLY(13))
|
||||||
typedef OverflowTaskQueue<ObjArrayTask, mtGC, QUEUE_SIZE> ObjArrayTaskQueue;
|
typedef OverflowTaskQueue<ObjArrayTask, mtGC, QUEUE_SIZE> ObjArrayTaskQueue;
|
||||||
typedef GenericTaskQueueSet<ObjArrayTaskQueue, mtGC> ObjArrayTaskQueueSet;
|
typedef GenericTaskQueueSet<ObjArrayTaskQueue, mtGC> ObjArrayTaskQueueSet;
|
||||||
#undef QUEUE_SIZE
|
#undef QUEUE_SIZE
|
||||||
|
typedef OverflowTaskQueue<size_t, mtGC> RegionTaskQueue;
|
||||||
|
typedef GenericTaskQueueSet<RegionTaskQueue, mtGC> RegionTaskQueueSet;
|
||||||
|
|
||||||
static ParCompactionManager** _manager_array;
|
static ParCompactionManager** _manager_array;
|
||||||
static OopTaskQueueSet* _stack_array;
|
static OopTaskQueueSet* _oop_task_queues;
|
||||||
static ObjArrayTaskQueueSet* _objarray_queues;
|
static ObjArrayTaskQueueSet* _objarray_task_queues;
|
||||||
static ObjectStartArray* _start_array;
|
static ObjectStartArray* _start_array;
|
||||||
static RegionTaskQueueSet* _region_array;
|
static RegionTaskQueueSet* _region_task_queues;
|
||||||
static PSOldGen* _old_gen;
|
static PSOldGen* _old_gen;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -90,13 +95,13 @@ private:
|
||||||
|
|
||||||
static PSOldGen* old_gen() { return _old_gen; }
|
static PSOldGen* old_gen() { return _old_gen; }
|
||||||
static ObjectStartArray* start_array() { return _start_array; }
|
static ObjectStartArray* start_array() { return _start_array; }
|
||||||
static OopTaskQueueSet* stack_array() { return _stack_array; }
|
static OopTaskQueueSet* oop_task_queues() { return _oop_task_queues; }
|
||||||
|
|
||||||
static void initialize(ParMarkBitMap* mbm);
|
static void initialize(ParMarkBitMap* mbm);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Array of task queues. Needed by the task terminator.
|
// Array of task queues. Needed by the task terminator.
|
||||||
static RegionTaskQueueSet* region_array() { return _region_array; }
|
static RegionTaskQueueSet* region_task_queues() { return _region_task_queues; }
|
||||||
OverflowTaskQueue<oop, mtGC>* marking_stack() { return &_marking_stack; }
|
OverflowTaskQueue<oop, mtGC>* marking_stack() { return &_marking_stack; }
|
||||||
|
|
||||||
// Pushes onto the marking stack. If the marking stack is full,
|
// Pushes onto the marking stack. If the marking stack is full,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2010, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2010, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -70,15 +70,15 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool ParCompactionManager::steal(int queue_num, oop& t) {
|
inline bool ParCompactionManager::steal(int queue_num, oop& t) {
|
||||||
return stack_array()->steal(queue_num, t);
|
return oop_task_queues()->steal(queue_num, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool ParCompactionManager::steal_objarray(int queue_num, ObjArrayTask& t) {
|
inline bool ParCompactionManager::steal_objarray(int queue_num, ObjArrayTask& t) {
|
||||||
return _objarray_queues->steal(queue_num, t);
|
return _objarray_task_queues->steal(queue_num, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool ParCompactionManager::steal(int queue_num, size_t& region) {
|
inline bool ParCompactionManager::steal(int queue_num, size_t& region) {
|
||||||
return region_array()->steal(queue_num, region);
|
return region_task_queues()->steal(queue_num, region);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void ParCompactionManager::push(oop obj) {
|
inline void ParCompactionManager::push(oop obj) {
|
||||||
|
|
|
@ -2178,7 +2178,7 @@ public:
|
||||||
AbstractGangTask("MarkFromRootsTask"),
|
AbstractGangTask("MarkFromRootsTask"),
|
||||||
_strong_roots_scope(active_workers),
|
_strong_roots_scope(active_workers),
|
||||||
_subtasks(),
|
_subtasks(),
|
||||||
_terminator(active_workers, ParCompactionManager::stack_array()),
|
_terminator(active_workers, ParCompactionManager::oop_task_queues()),
|
||||||
_active_workers(active_workers) {
|
_active_workers(active_workers) {
|
||||||
_subtasks.set_n_threads(active_workers);
|
_subtasks.set_n_threads(active_workers);
|
||||||
_subtasks.set_n_tasks(ParallelRootType::sentinel);
|
_subtasks.set_n_tasks(ParallelRootType::sentinel);
|
||||||
|
@ -2210,7 +2210,7 @@ public:
|
||||||
AbstractGangTask("PCRefProcTask"),
|
AbstractGangTask("PCRefProcTask"),
|
||||||
_task(task),
|
_task(task),
|
||||||
_ergo_workers(ergo_workers),
|
_ergo_workers(ergo_workers),
|
||||||
_terminator(_ergo_workers, ParCompactionManager::stack_array()) {
|
_terminator(_ergo_workers, ParCompactionManager::oop_task_queues()) {
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void work(uint worker_id) {
|
virtual void work(uint worker_id) {
|
||||||
|
@ -2626,7 +2626,7 @@ public:
|
||||||
UpdateDensePrefixAndCompactionTask(TaskQueue& tq, uint active_workers) :
|
UpdateDensePrefixAndCompactionTask(TaskQueue& tq, uint active_workers) :
|
||||||
AbstractGangTask("UpdateDensePrefixAndCompactionTask"),
|
AbstractGangTask("UpdateDensePrefixAndCompactionTask"),
|
||||||
_tq(tq),
|
_tq(tq),
|
||||||
_terminator(active_workers, ParCompactionManager::region_array()),
|
_terminator(active_workers, ParCompactionManager::region_task_queues()),
|
||||||
_active_workers(active_workers) {
|
_active_workers(active_workers) {
|
||||||
}
|
}
|
||||||
virtual void work(uint worker_id) {
|
virtual void work(uint worker_id) {
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
#include "oops/compressedOops.inline.hpp"
|
#include "oops/compressedOops.inline.hpp"
|
||||||
|
|
||||||
PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
|
PaddedEnd<PSPromotionManager>* PSPromotionManager::_manager_array = NULL;
|
||||||
OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
|
PSPromotionManager::OopStarTaskQueueSet* PSPromotionManager::_stack_array_depth = NULL;
|
||||||
PreservedMarksSet* PSPromotionManager::_preserved_marks_set = NULL;
|
PreservedMarksSet* PSPromotionManager::_preserved_marks_set = NULL;
|
||||||
PSOldGen* PSPromotionManager::_old_gen = NULL;
|
PSOldGen* PSPromotionManager::_old_gen = NULL;
|
||||||
MutableSpace* PSPromotionManager::_young_space = NULL;
|
MutableSpace* PSPromotionManager::_young_space = NULL;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -56,6 +56,9 @@ class PSPromotionManager {
|
||||||
friend class PSRefProcTask;
|
friend class PSRefProcTask;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
typedef OverflowTaskQueue<StarTask, mtGC> OopStarTaskQueue;
|
||||||
|
typedef GenericTaskQueueSet<OopStarTaskQueue, mtGC> OopStarTaskQueueSet;
|
||||||
|
|
||||||
static PaddedEnd<PSPromotionManager>* _manager_array;
|
static PaddedEnd<PSPromotionManager>* _manager_array;
|
||||||
static OopStarTaskQueueSet* _stack_array_depth;
|
static OopStarTaskQueueSet* _stack_array_depth;
|
||||||
static PreservedMarksSet* _preserved_marks_set;
|
static PreservedMarksSet* _preserved_marks_set;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -443,9 +443,6 @@ public:
|
||||||
virtual bool should_exit_termination() = 0;
|
virtual bool should_exit_termination() = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef GenericTaskQueue<oop, mtGC> OopTaskQueue;
|
|
||||||
typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
// warning C4522: multiple assignment operators specified
|
// warning C4522: multiple assignment operators specified
|
||||||
|
@ -524,10 +521,4 @@ private:
|
||||||
#pragma warning(pop)
|
#pragma warning(pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef OverflowTaskQueue<StarTask, mtGC> OopStarTaskQueue;
|
|
||||||
typedef GenericTaskQueueSet<OopStarTaskQueue, mtGC> OopStarTaskQueueSet;
|
|
||||||
|
|
||||||
typedef OverflowTaskQueue<size_t, mtGC> RegionTaskQueue;
|
|
||||||
typedef GenericTaskQueueSet<RegionTaskQueue, mtGC> RegionTaskQueueSet;
|
|
||||||
|
|
||||||
#endif // SHARE_GC_SHARED_TASKQUEUE_HPP
|
#endif // SHARE_GC_SHARED_TASKQUEUE_HPP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue