mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8003720: NPG: Method in interpreter stack frame can be deallocated
Pass down a closure during root scanning to keep the class of the method alive. Reviewed-by: coleenp, jcoomes
This commit is contained in:
parent
2e2b69e96b
commit
3c2f3a321a
18 changed files with 327 additions and 42 deletions
|
@ -52,14 +52,22 @@ void ThreadRootsMarkingTask::do_it(GCTaskManager* manager, uint which) {
|
|||
PrintGCDetails && TraceParallelOldGCTasks, true, gclog_or_tty));
|
||||
ParCompactionManager* cm =
|
||||
ParCompactionManager::gc_thread_compaction_manager(which);
|
||||
|
||||
PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
|
||||
CLDToOopClosure mark_and_push_from_clds(&mark_and_push_closure, true);
|
||||
CodeBlobToOopClosure mark_and_push_in_blobs(&mark_and_push_closure, /*do_marking=*/ true);
|
||||
|
||||
if (_java_thread != NULL)
|
||||
_java_thread->oops_do(&mark_and_push_closure, &mark_and_push_in_blobs);
|
||||
_java_thread->oops_do(
|
||||
&mark_and_push_closure,
|
||||
&mark_and_push_from_clds,
|
||||
&mark_and_push_in_blobs);
|
||||
|
||||
if (_vm_thread != NULL)
|
||||
_vm_thread->oops_do(&mark_and_push_closure, &mark_and_push_in_blobs);
|
||||
_vm_thread->oops_do(
|
||||
&mark_and_push_closure,
|
||||
&mark_and_push_from_clds,
|
||||
&mark_and_push_in_blobs);
|
||||
|
||||
// Do the real work
|
||||
cm->follow_marking_stacks();
|
||||
|
@ -89,7 +97,8 @@ void MarkFromRootsTask::do_it(GCTaskManager* manager, uint which) {
|
|||
{
|
||||
ResourceMark rm;
|
||||
CodeBlobToOopClosure each_active_code_blob(&mark_and_push_closure, /*do_marking=*/ true);
|
||||
Threads::oops_do(&mark_and_push_closure, &each_active_code_blob);
|
||||
CLDToOopClosure mark_and_push_from_cld(&mark_and_push_closure);
|
||||
Threads::oops_do(&mark_and_push_closure, &mark_and_push_from_cld, &each_active_code_blob);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue