--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp Tue Sep 15 11:09:34 2009 -0700
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp Tue Sep 15 21:53:47 2009 -0700
@@ -677,13 +677,23 @@
void GenCollectedHeap::
gen_process_strong_roots(int level,
bool younger_gens_as_roots,
+ bool activate_scope,
bool collecting_perm_gen,
SharedHeap::ScanningOption so,
- OopsInGenClosure* older_gens,
- OopsInGenClosure* not_older_gens) {
+ OopsInGenClosure* not_older_gens,
+ bool do_code_roots,
+ OopsInGenClosure* older_gens) {
// General strong roots.
- SharedHeap::process_strong_roots(collecting_perm_gen, so,
- not_older_gens, older_gens);
+
+ if (!do_code_roots) {
+ SharedHeap::process_strong_roots(activate_scope, collecting_perm_gen, so,
+ not_older_gens, NULL, older_gens);
+ } else {
+ bool do_code_marking = (activate_scope || nmethod::oops_do_marking_is_active());
+ CodeBlobToOopClosure code_roots(not_older_gens, /*do_marking=*/ do_code_marking);
+ SharedHeap::process_strong_roots(activate_scope, collecting_perm_gen, so,
+ not_older_gens, &code_roots, older_gens);
+ }
if (younger_gens_as_roots) {
if (!_gen_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
@@ -706,8 +716,9 @@
}
void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure,
+ CodeBlobClosure* code_roots,
OopClosure* non_root_closure) {
- SharedHeap::process_weak_roots(root_closure, non_root_closure);
+ SharedHeap::process_weak_roots(root_closure, code_roots, non_root_closure);
// "Local" "weak" refs
for (int i = 0; i < _n_gens; i++) {
_gens[i]->ref_processor()->weak_oops_do(root_closure);