--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp Tue Sep 15 11:09:34 2009 -0700
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/pcTasks.cpp Tue Sep 15 21:53:47 2009 -0700
@@ -39,12 +39,13 @@
ParCompactionManager* cm =
ParCompactionManager::gc_thread_compaction_manager(which);
PSParallelCompact::MarkAndPushClosure mark_and_push_closure(cm);
+ 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);
+ _java_thread->oops_do(&mark_and_push_closure, &mark_and_push_in_blobs);
if (_vm_thread != NULL)
- _vm_thread->oops_do(&mark_and_push_closure);
+ _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);
@@ -79,7 +80,8 @@
case threads:
{
ResourceMark rm;
- Threads::oops_do(&mark_and_push_closure);
+ CodeBlobToOopClosure each_active_code_blob(&mark_and_push_closure, /*do_marking=*/ true);
+ Threads::oops_do(&mark_and_push_closure, &each_active_code_blob);
}
break;
@@ -107,6 +109,11 @@
vmSymbols::oops_do(&mark_and_push_closure);
break;
+ case code_cache:
+ // Do not treat nmethods as strong roots for mark/sweep, since we can unload them.
+ //CodeCache::scavenge_root_nmethods_do(CodeBlobToOopClosure(&mark_and_push_closure));
+ break;
+
default:
fatal("Unknown root type");
}