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:
Stefan Karlsson 2012-11-27 10:13:20 +01:00
parent 2e2b69e96b
commit 3c2f3a321a
18 changed files with 327 additions and 42 deletions

View file

@ -154,10 +154,12 @@ void SharedHeap::process_strong_roots(bool activate_scope,
if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do))
JNIHandles::oops_do(roots);
// All threads execute this; the individual threads are task groups.
CLDToOopClosure roots_from_clds(roots);
CLDToOopClosure* roots_from_clds_p = (is_scavenging ? NULL : &roots_from_clds);
if (ParallelGCThreads > 0) {
Threads::possibly_parallel_oops_do(roots, code_roots);
Threads::possibly_parallel_oops_do(roots, roots_from_clds_p ,code_roots);
} else {
Threads::oops_do(roots, code_roots);
Threads::oops_do(roots, roots_from_clds_p, code_roots);
}
if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do))
ObjectSynchronizer::oops_do(roots);