< prev index next >

src/hotspot/share/gc/shared/genCollectedHeap.cpp

Print this page




 833     if (so & SO_ScavengeCodeCache) {
 834       assert(code_roots != NULL, "must supply closure for code cache");
 835 
 836       // We only visit parts of the CodeCache when scavenging.
 837       ScavengableNMethods::nmethods_do(code_roots);
 838     }
 839     if (so & SO_AllCodeCache) {
 840       assert(code_roots != NULL, "must supply closure for code cache");
 841 
 842       // CMSCollector uses this to do intermediate-strength collections.
 843       // We scan the entire code cache, since CodeCache::do_unloading is not called.
 844       CodeCache::blobs_do(code_roots);
 845     }
 846     // Verify that the code cache contents are not subject to
 847     // movement by a scavenging collection.
 848     DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
 849     DEBUG_ONLY(ScavengableNMethods::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
 850   }
 851 }
 852 
 853 void GenCollectedHeap::young_process_roots(StrongRootsScope* scope,
 854                                            OopsInGenClosure* root_closure,
 855                                            OopsInGenClosure* old_gen_closure,
 856                                            CLDClosure* cld_closure) {
 857   MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
 858 
 859   process_roots(scope, SO_ScavengeCodeCache, root_closure,
 860                 cld_closure, cld_closure, &mark_code_closure);
 861 
 862   if (_process_strong_tasks->try_claim_task(GCH_PS_younger_gens)) {
 863     root_closure->reset_generation();
 864   }
 865 
 866   // When collection is parallel, all threads get to cooperate to do
 867   // old generation scanning.
 868   old_gen_closure->set_generation(_old_gen);
 869   rem_set()->younger_refs_iterate(_old_gen, old_gen_closure, scope->n_threads());
 870   old_gen_closure->reset_generation();
 871 
 872   _process_strong_tasks->all_tasks_completed(scope->n_threads());
 873 }
 874 
 875 void GenCollectedHeap::full_process_roots(StrongRootsScope* scope,
 876                                           bool is_adjust_phase,
 877                                           ScanningOption so,
 878                                           bool only_strong_roots,
 879                                           OopClosure* root_closure,
 880                                           CLDClosure* cld_closure) {
 881   MarkingCodeBlobClosure mark_code_closure(root_closure, is_adjust_phase);
 882   CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
 883 
 884   process_roots(scope, so, root_closure, cld_closure, weak_cld_closure, &mark_code_closure);
 885   _process_strong_tasks->all_tasks_completed(scope->n_threads());
 886 }
 887 
 888 void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
 889   WeakProcessor::oops_do(root_closure);
 890   _young_gen->ref_processor()->weak_oops_do(root_closure);
 891   _old_gen->ref_processor()->weak_oops_do(root_closure);
 892 }
 893 
 894 bool GenCollectedHeap::no_allocs_since_save_marks() {




 833     if (so & SO_ScavengeCodeCache) {
 834       assert(code_roots != NULL, "must supply closure for code cache");
 835 
 836       // We only visit parts of the CodeCache when scavenging.
 837       ScavengableNMethods::nmethods_do(code_roots);
 838     }
 839     if (so & SO_AllCodeCache) {
 840       assert(code_roots != NULL, "must supply closure for code cache");
 841 
 842       // CMSCollector uses this to do intermediate-strength collections.
 843       // We scan the entire code cache, since CodeCache::do_unloading is not called.
 844       CodeCache::blobs_do(code_roots);
 845     }
 846     // Verify that the code cache contents are not subject to
 847     // movement by a scavenging collection.
 848     DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
 849     DEBUG_ONLY(ScavengableNMethods::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
 850   }
 851 }
 852 






















 853 void GenCollectedHeap::full_process_roots(StrongRootsScope* scope,
 854                                           bool is_adjust_phase,
 855                                           ScanningOption so,
 856                                           bool only_strong_roots,
 857                                           OopClosure* root_closure,
 858                                           CLDClosure* cld_closure) {
 859   MarkingCodeBlobClosure mark_code_closure(root_closure, is_adjust_phase);
 860   CLDClosure* weak_cld_closure = only_strong_roots ? NULL : cld_closure;
 861 
 862   process_roots(scope, so, root_closure, cld_closure, weak_cld_closure, &mark_code_closure);
 863   _process_strong_tasks->all_tasks_completed(scope->n_threads());
 864 }
 865 
 866 void GenCollectedHeap::gen_process_weak_roots(OopClosure* root_closure) {
 867   WeakProcessor::oops_do(root_closure);
 868   _young_gen->ref_processor()->weak_oops_do(root_closure);
 869   _old_gen->ref_processor()->weak_oops_do(root_closure);
 870 }
 871 
 872 bool GenCollectedHeap::no_allocs_since_save_marks() {


< prev index next >