< prev index next >

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

Print this page
rev 50373 : 8195097: Make it possible to process StringTable outside safepoint
Reviewed-by:
rev 50375 : [mq]: 8195097-stringtable-v2


 842 
 843       // CMSCollector uses this to do intermediate-strength collections.
 844       // We scan the entire code cache, since CodeCache::do_unloading is not called.
 845       CodeCache::blobs_do(code_roots);
 846     }
 847     // Verify that the code cache contents are not subject to
 848     // movement by a scavenging collection.
 849     DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
 850     DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
 851   }
 852 }
 853 
 854 void GenCollectedHeap::process_string_table_roots(StrongRootsScope* scope,
 855                                                   OopClosure* root_closure,
 856                                                   OopStorage::ParState<false, false>* par_state_string) {
 857   assert(root_closure != NULL, "Must be set");
 858   // All threads execute the following. A specific chunk of buckets
 859   // from the StringTable are the individual tasks.
 860 
 861   // Either we should be single threaded or have a ParState
 862   assert((scope->n_threads() <= 1) || par_state_string != NULL, "Parallel but not ParState");
 863 
 864   if (scope->n_threads() > 1 && par_state_string != NULL) {
 865     StringTable::possibly_parallel_oops_do(par_state_string, root_closure);
 866   } else {
 867     StringTable::oops_do(root_closure);
 868   }
 869 }
 870 
 871 void GenCollectedHeap::young_process_roots(StrongRootsScope* scope,
 872                                            OopsInGenClosure* root_closure,
 873                                            OopsInGenClosure* old_gen_closure,
 874                                            CLDClosure* cld_closure,
 875                                            OopStorage::ParState<false, false>* par_state_string) {
 876   MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
 877 
 878   process_roots(scope, SO_ScavengeCodeCache, root_closure,
 879                 cld_closure, cld_closure, &mark_code_closure);
 880   process_string_table_roots(scope, root_closure, par_state_string);
 881 
 882   if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
 883     root_closure->reset_generation();
 884   }




 842 
 843       // CMSCollector uses this to do intermediate-strength collections.
 844       // We scan the entire code cache, since CodeCache::do_unloading is not called.
 845       CodeCache::blobs_do(code_roots);
 846     }
 847     // Verify that the code cache contents are not subject to
 848     // movement by a scavenging collection.
 849     DEBUG_ONLY(CodeBlobToOopClosure assert_code_is_non_scavengable(&assert_is_non_scavengable_closure, !CodeBlobToOopClosure::FixRelocations));
 850     DEBUG_ONLY(CodeCache::asserted_non_scavengable_nmethods_do(&assert_code_is_non_scavengable));
 851   }
 852 }
 853 
 854 void GenCollectedHeap::process_string_table_roots(StrongRootsScope* scope,
 855                                                   OopClosure* root_closure,
 856                                                   OopStorage::ParState<false, false>* par_state_string) {
 857   assert(root_closure != NULL, "Must be set");
 858   // All threads execute the following. A specific chunk of buckets
 859   // from the StringTable are the individual tasks.
 860 
 861   // Either we should be single threaded or have a ParState
 862   assert((scope->n_threads() <= 1) || par_state_string != NULL, "Parallel but no ParState");
 863 
 864   if (scope->n_threads() > 1) {
 865     StringTable::possibly_parallel_oops_do(par_state_string, root_closure);
 866   } else {
 867     StringTable::oops_do(root_closure);
 868   }
 869 }
 870 
 871 void GenCollectedHeap::young_process_roots(StrongRootsScope* scope,
 872                                            OopsInGenClosure* root_closure,
 873                                            OopsInGenClosure* old_gen_closure,
 874                                            CLDClosure* cld_closure,
 875                                            OopStorage::ParState<false, false>* par_state_string) {
 876   MarkingCodeBlobClosure mark_code_closure(root_closure, CodeBlobToOopClosure::FixRelocations);
 877 
 878   process_roots(scope, SO_ScavengeCodeCache, root_closure,
 879                 cld_closure, cld_closure, &mark_code_closure);
 880   process_string_table_roots(scope, root_closure, par_state_string);
 881 
 882   if (!_process_strong_tasks->is_task_claimed(GCH_PS_younger_gens)) {
 883     root_closure->reset_generation();
 884   }


< prev index next >