Skip to content

Commit a9b8acb

Browse files
committed
8300652: Parallel: Refactor oop marking stack in Full GC
Reviewed-by: tschatzl, iwalulya
1 parent 15a1488 commit a9b8acb

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/hotspot/share/gc/parallel/psCompactionManager.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void ParCompactionManager::initialize(ParMarkBitMap* mbm) {
8181
// Create and register the ParCompactionManager(s) for the worker threads.
8282
for(uint i=0; i<parallel_gc_threads; i++) {
8383
_manager_array[i] = new ParCompactionManager();
84-
oop_task_queues()->register_queue(i, _manager_array[i]->marking_stack());
84+
oop_task_queues()->register_queue(i, _manager_array[i]->oop_stack());
8585
_objarray_task_queues->register_queue(i, &_manager_array[i]->_objarray_stack);
8686
region_task_queues()->register_queue(i, _manager_array[i]->region_stack());
8787
}
@@ -117,12 +117,12 @@ ParCompactionManager::gc_thread_compaction_manager(uint index) {
117117

118118
inline void ParCompactionManager::publish_and_drain_oop_tasks() {
119119
oop obj;
120-
while (marking_stack()->pop_overflow(obj)) {
121-
if (!marking_stack()->try_push_to_taskqueue(obj)) {
120+
while (oop_stack()->pop_overflow(obj)) {
121+
if (!oop_stack()->try_push_to_taskqueue(obj)) {
122122
follow_contents(obj);
123123
}
124124
}
125-
while (marking_stack()->pop_local(obj)) {
125+
while (oop_stack()->pop_local(obj)) {
126126
follow_contents(obj);
127127
}
128128
}

src/hotspot/share/gc/parallel/psCompactionManager.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class ParCompactionManager : public CHeapObj<mtGC> {
4848
friend class UpdateDensePrefixAndCompactionTask;
4949

5050
private:
51-
typedef GenericTaskQueue<oop, mtGC> OopTaskQueue;
51+
typedef OverflowTaskQueue<oop, mtGC> OopTaskQueue;
5252
typedef GenericTaskQueueSet<OopTaskQueue, mtGC> OopTaskQueueSet;
5353

5454
// 32-bit: 4K * 8 = 32KiB; 64-bit: 8K * 16 = 128KiB
@@ -66,11 +66,11 @@ class ParCompactionManager : public CHeapObj<mtGC> {
6666
static RegionTaskQueueSet* _region_task_queues;
6767
static PSOldGen* _old_gen;
6868

69-
OverflowTaskQueue<oop, mtGC> _marking_stack;
69+
OopTaskQueue _oop_stack;
7070
ObjArrayTaskQueue _objarray_stack;
7171
size_t _next_shadow_region;
7272

73-
// Is there a way to reuse the _marking_stack for the
73+
// Is there a way to reuse the _oop_stack for the
7474
// saving empty regions? For now just create a different
7575
// type of TaskQueue.
7676
RegionTaskQueue _region_stack;
@@ -108,7 +108,7 @@ class ParCompactionManager : public CHeapObj<mtGC> {
108108
protected:
109109
// Array of task queues. Needed by the task terminator.
110110
static RegionTaskQueueSet* region_task_queues() { return _region_task_queues; }
111-
OverflowTaskQueue<oop, mtGC>* marking_stack() { return &_marking_stack; }
111+
OopTaskQueue* oop_stack() { return &_oop_stack; }
112112

113113
// Pushes onto the marking stack. If the marking stack is full,
114114
// pushes onto the overflow stack.
@@ -221,7 +221,7 @@ class ParCompactionManager : public CHeapObj<mtGC> {
221221
};
222222

223223
bool ParCompactionManager::marking_stacks_empty() const {
224-
return _marking_stack.is_empty() && _objarray_stack.is_empty();
224+
return _oop_stack.is_empty() && _objarray_stack.is_empty();
225225
}
226226

227227
#endif // SHARE_GC_PARALLEL_PSCOMPACTIONMANAGER_HPP

src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ inline bool ParCompactionManager::steal(int queue_num, size_t& region) {
7878
}
7979

8080
inline void ParCompactionManager::push(oop obj) {
81-
_marking_stack.push(obj);
81+
_oop_stack.push(obj);
8282
}
8383

8484
void ParCompactionManager::push_objarray(oop obj, size_t index)

0 commit comments

Comments
 (0)