< prev index next >

src/share/vm/gc/serial/defNewGeneration.cpp

Print this page
rev 11983 : 8166276: Refactor gen_process_roots to allow simpler fix for 8165949
Reviewed-by:
Contributed-by: jesper.wilhelmsson@oracle.com


 631   KlassScanClosure klass_scan_closure(&fsc_with_no_gc_barrier,
 632                                       gch->rem_set()->klass_rem_set());
 633   CLDToKlassAndOopClosure cld_scan_closure(&klass_scan_closure,
 634                                            &fsc_with_no_gc_barrier,
 635                                            false);
 636 
 637   set_promo_failure_scan_stack_closure(&fsc_with_no_gc_barrier);
 638   FastEvacuateFollowersClosure evacuate_followers(gch,
 639                                                   &fsc_with_no_gc_barrier,
 640                                                   &fsc_with_gc_barrier);
 641 
 642   assert(gch->no_allocs_since_save_marks(),
 643          "save marks have not been newly set.");
 644 
 645   {
 646     // DefNew needs to run with n_threads == 0, to make sure the serial
 647     // version of the card table scanning code is used.
 648     // See: CardTableModRefBSForCTRS::non_clean_card_iterate_possibly_parallel.
 649     StrongRootsScope srs(0);
 650 
 651     gch->gen_process_roots(&srs,
 652                            GenCollectedHeap::YoungGen,
 653                            true,  // Process younger gens, if any,
 654                                   // as strong roots.
 655                            GenCollectedHeap::SO_ScavengeCodeCache,
 656                            GenCollectedHeap::StrongAndWeakRoots,
 657                            &fsc_with_no_gc_barrier,
 658                            &fsc_with_gc_barrier,
 659                            &cld_scan_closure);
 660   }
 661 
 662   // "evacuate followers".
 663   evacuate_followers.do_void();
 664 
 665   FastKeepAliveClosure keep_alive(this, &scan_weak_ref);
 666   ReferenceProcessor* rp = ref_processor();
 667   rp->setup_policy(clear_all_soft_refs);
 668   const ReferenceProcessorStats& stats =
 669   rp->process_discovered_references(&is_alive, &keep_alive, &evacuate_followers,
 670                                     NULL, _gc_timer);
 671   gc_tracer.report_gc_reference_stats(stats);
 672   gc_tracer.report_tenuring_threshold(tenuring_threshold());
 673 
 674   if (!_promotion_failed) {
 675     // Swap the survivor spaces.
 676     eden()->clear(SpaceDecorator::Mangle);




 631   KlassScanClosure klass_scan_closure(&fsc_with_no_gc_barrier,
 632                                       gch->rem_set()->klass_rem_set());
 633   CLDToKlassAndOopClosure cld_scan_closure(&klass_scan_closure,
 634                                            &fsc_with_no_gc_barrier,
 635                                            false);
 636 
 637   set_promo_failure_scan_stack_closure(&fsc_with_no_gc_barrier);
 638   FastEvacuateFollowersClosure evacuate_followers(gch,
 639                                                   &fsc_with_no_gc_barrier,
 640                                                   &fsc_with_gc_barrier);
 641 
 642   assert(gch->no_allocs_since_save_marks(),
 643          "save marks have not been newly set.");
 644 
 645   {
 646     // DefNew needs to run with n_threads == 0, to make sure the serial
 647     // version of the card table scanning code is used.
 648     // See: CardTableModRefBSForCTRS::non_clean_card_iterate_possibly_parallel.
 649     StrongRootsScope srs(0);
 650 
 651     gch->young_process_roots(&srs,





 652                              &fsc_with_no_gc_barrier,
 653                              &fsc_with_gc_barrier,
 654                              &cld_scan_closure);
 655   }
 656 
 657   // "evacuate followers".
 658   evacuate_followers.do_void();
 659 
 660   FastKeepAliveClosure keep_alive(this, &scan_weak_ref);
 661   ReferenceProcessor* rp = ref_processor();
 662   rp->setup_policy(clear_all_soft_refs);
 663   const ReferenceProcessorStats& stats =
 664   rp->process_discovered_references(&is_alive, &keep_alive, &evacuate_followers,
 665                                     NULL, _gc_timer);
 666   gc_tracer.report_gc_reference_stats(stats);
 667   gc_tracer.report_tenuring_threshold(tenuring_threshold());
 668 
 669   if (!_promotion_failed) {
 670     // Swap the survivor spaces.
 671     eden()->clear(SpaceDecorator::Mangle);


< prev index next >