647
648 if (!_process_strong_tasks->is_task_claimed(GCH_PS_CodeCache_oops_do)) {
649 if (so & SO_ScavengeCodeCache) {
650 assert(code_roots != NULL, "must supply closure for code cache");
651
652 // We only visit parts of the CodeCache when scavenging.
653 CodeCache::scavenge_root_nmethods_do(code_roots);
654 }
655 if (so & SO_AllCodeCache) {
656 assert(code_roots != NULL, "must supply closure for code cache");
657
658 // CMSCollector uses this to do intermediate-strength collections.
659 // We scan the entire code cache, since CodeCache::do_unloading is not called.
660 CodeCache::blobs_do(code_roots);
661 }
662 // Verify that the code cache contents are not subject to
663 // movement by a scavenging collection.
664 DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
665 DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
666 }
667 }
668
669 void GenCollectedHeap::gen_process_roots(StrongRootsScope* scope,
670 GenerationType type,
671 bool younger_gens_as_roots,
672 ScanningOption so,
673 bool only_strong_roots,
674 OopsInGenClosure* not_older_gens,
675 OopsInGenClosure* older_gens,
676 CLDClosure* cld_closure) {
677 const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
678
679 bool is_moving_collection = false;
680 if (type == YoungGen || is_adjust_phase) {
681 // young collections are always moving
682 is_moving_collection = true;
683 }
684
685 MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
686 OopsInGenClosure* weak_roots = only_strong_roots ? NULL : not_older_gens;
|
647
648 if (!_process_strong_tasks->is_task_claimed(GCH_PS_CodeCache_oops_do)) {
649 if (so & SO_ScavengeCodeCache) {
650 assert(code_roots != NULL, "must supply closure for code cache");
651
652 // We only visit parts of the CodeCache when scavenging.
653 CodeCache::scavenge_root_nmethods_do(code_roots);
654 }
655 if (so & SO_AllCodeCache) {
656 assert(code_roots != NULL, "must supply closure for code cache");
657
658 // CMSCollector uses this to do intermediate-strength collections.
659 // We scan the entire code cache, since CodeCache::do_unloading is not called.
660 CodeCache::blobs_do(code_roots);
661 }
662 // Verify that the code cache contents are not subject to
663 // movement by a scavenging collection.
664 DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
665 DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
666 }
667
668 if (CMSParallelFullGC && strong_roots == &MarkSweep::follow_root_closure) {
669 // Clear the mark stack on CMS full GC.
670 MarkSweep::follow_stack();
671 }
672 }
673
674 void GenCollectedHeap::gen_process_roots(StrongRootsScope* scope,
675 GenerationType type,
676 bool younger_gens_as_roots,
677 ScanningOption so,
678 bool only_strong_roots,
679 OopsInGenClosure* not_older_gens,
680 OopsInGenClosure* older_gens,
681 CLDClosure* cld_closure) {
682 const bool is_adjust_phase = !only_strong_roots && !younger_gens_as_roots;
683
684 bool is_moving_collection = false;
685 if (type == YoungGen || is_adjust_phase) {
686 // young collections are always moving
687 is_moving_collection = true;
688 }
689
690 MarkingCodeBlobClosure mark_code_closure(not_older_gens, is_moving_collection);
691 OopsInGenClosure* weak_roots = only_strong_roots ? NULL : not_older_gens;
|