mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
4396719: Mark Sweep stack overflow on deeply nested Object arrays
Use an explicit stack for object arrays and process them in chunks. Reviewed-by: iveresov, apetrusenko
This commit is contained in:
parent
5fdec09798
commit
4f82340476
26 changed files with 419 additions and 182 deletions
|
@ -48,7 +48,7 @@ void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) {
|
|||
_vm_thread->oops_do(&mark_and_push_closure, &mark_and_push_in_blobs);
|
||||
|
||||
// Do the real work
|
||||
cm->drain_marking_stacks(&mark_and_push_closure);
|
||||
cm->follow_marking_stacks();
|
||||
}
|
||||
|
||||
|
||||
|
@ -118,7 +118,7 @@ void MarkFromRootsTask::do_it(GCTaskManager* manager, uint which) {
|
|||
}
|
||||
|
||||
// Do the real work
|
||||
cm->drain_marking_stacks(&mark_and_push_closure);
|
||||
cm->follow_marking_stacks();
|
||||
// cm->deallocate_stacks();
|
||||
}
|
||||
|
||||
|
@ -196,17 +196,19 @@ void StealMarkingTask::do_it(GCTaskManager* manager, uint which) {
|
|||
PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
|
||||
|
||||
oop obj = NULL;
|
||||
ObjArrayTask task;
|
||||
int random_seed = 17;
|
||||
while(true) {
|
||||
if (ParCompactionManager::steal(which, &random_seed, obj)) {
|
||||
obj->follow_contents(cm);
|
||||
cm->drain_marking_stacks(&mark_and_push_closure);
|
||||
} else {
|
||||
if (terminator()->offer_termination()) {
|
||||
break;
|
||||
}
|
||||
do {
|
||||
while (ParCompactionManager::steal_objarray(which, &random_seed, task)) {
|
||||
objArrayKlass* const k = (objArrayKlass*)task.obj()->blueprint();
|
||||
k->oop_follow_contents(cm, task.obj(), task.index());
|
||||
cm->follow_marking_stacks();
|
||||
}
|
||||
}
|
||||
while (ParCompactionManager::steal(which, &random_seed, obj)) {
|
||||
obj->follow_contents(cm);
|
||||
cm->follow_marking_stacks();
|
||||
}
|
||||
} while (!terminator()->offer_termination());
|
||||
}
|
||||
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue