8300652: Parallel: Refactor oop marking stack in Full GC

Reviewed-by: tschatzl, iwalulya
This commit is contained in:
Albert Mingkun Yang 2023-01-26 11:39:34 +00:00
parent 15a1488401
commit a9b8acb643
3 changed files with 10 additions and 10 deletions

@ -81,7 +81,7 @@ void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
// Create and register the ParCompactionManager(s) for the worker threads.
for(uint i=0; i<parallel_gc_threads; i++) {
_manager_array[i] = new ParCompactionManager();
oop_task_queues()->register_queue(i, _manager_array[i]->marking_stack());
oop_task_queues()->register_queue(i, _manager_array[i]->oop_stack());
_objarray_task_queues->register_queue(i, &_manager_array[i]->_objarray_stack);
region_task_queues()->register_queue(i, _manager_array[i]->region_stack());
}
@ -117,12 +117,12 @@ ParCompactionManager::gc_thread_compaction_manager(uint index) {
inline void ParCompactionManager::publish_and_drain_oop_tasks() {
oop obj;
while (marking_stack()->pop_overflow(obj)) {
if (!marking_stack()->try_push_to_taskqueue(obj)) {
while (oop_stack()->pop_overflow(obj)) {
if (!oop_stack()->try_push_to_taskqueue(obj)) {
follow_contents(obj);
}
}
while (marking_stack()->pop_local(obj)) {
while (oop_stack()->pop_local(obj)) {
follow_contents(obj);
}
}

@ -48,7 +48,7 @@ class ParCompactionManager : public CHeapObj<mtGC> {
friend class UpdateDensePrefixAndCompactionTask;
private:
typedef GenericTaskQueue<oop, mtGC> OopTaskQueue;
typedef OverflowTaskQueue<oop, mtGC> OopTaskQueue;
typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
// 32-bit: 4K * 8 = 32KiB; 64-bit: 8K * 16 = 128KiB
@ -66,11 +66,11 @@ class ParCompactionManager : public CHeapObj<mtGC> {
static RegionTaskQueueSet* _region_task_queues;
static PSOldGen* _old_gen;
OverflowTaskQueue<oop, mtGC> _marking_stack;
OopTaskQueue _oop_stack;
ObjArrayTaskQueue _objarray_stack;
size_t _next_shadow_region;
// Is there a way to reuse the _marking_stack for the
// Is there a way to reuse the _oop_stack for the
// saving empty regions? For now just create a different
// type of TaskQueue.
RegionTaskQueue _region_stack;
@ -108,7 +108,7 @@ class ParCompactionManager : public CHeapObj<mtGC> {
protected:
// Array of task queues. Needed by the task terminator.
static RegionTaskQueueSet* region_task_queues() { return _region_task_queues; }
OverflowTaskQueue<oop, mtGC>* marking_stack() { return &_marking_stack; }
OopTaskQueue* oop_stack() { return &_oop_stack; }
// Pushes onto the marking stack. If the marking stack is full,
// pushes onto the overflow stack.
@ -221,7 +221,7 @@ class ParCompactionManager : public CHeapObj<mtGC> {
};
bool ParCompactionManager::marking_stacks_empty() const {
return _marking_stack.is_empty() && _objarray_stack.is_empty();
return _oop_stack.is_empty() && _objarray_stack.is_empty();
}
#endif // SHARE_GC_PARALLEL_PSCOMPACTIONMANAGER_HPP

@ -78,7 +78,7 @@ inline bool ParCompactionManager::steal(int queue_num, size_t& region) {
}
inline void ParCompactionManager::push(oop obj) {
_marking_stack.push(obj);
_oop_stack.push(obj);
}
void ParCompactionManager::push_objarray(oop obj, size_t index)