hotspot/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp
changeset 25492 d27050bdfb04
parent 25491 70fb742e40aa
child 25730 7eb4e685f739
child 25714 87fa6860b5ae
equal deleted inserted replaced
25491:70fb742e40aa 25492:d27050bdfb04
   127   GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
   127   GCTraceTime tm("phase 1", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
   128   GenMarkSweep::trace(" 1");
   128   GenMarkSweep::trace(" 1");
   129 
   129 
   130   SharedHeap* sh = SharedHeap::heap();
   130   SharedHeap* sh = SharedHeap::heap();
   131 
   131 
   132   // Need cleared claim bits for the strong roots processing
   132   // Need cleared claim bits for the roots processing
   133   ClassLoaderDataGraph::clear_claimed_marks();
   133   ClassLoaderDataGraph::clear_claimed_marks();
   134 
   134 
   135   sh->process_strong_roots(true,  // activate StrongRootsScope
   135   MarkingCodeBlobClosure follow_code_closure(&GenMarkSweep::follow_root_closure, !CodeBlobToOopClosure::FixRelocations);
   136                            SharedHeap::SO_SystemClasses,
   136   sh->process_strong_roots(true,   // activate StrongRootsScope
       
   137                            SharedHeap::SO_None,
   137                            &GenMarkSweep::follow_root_closure,
   138                            &GenMarkSweep::follow_root_closure,
   138                            &GenMarkSweep::follow_klass_closure);
   139                            &GenMarkSweep::follow_cld_closure,
       
   140                            &follow_code_closure);
   139 
   141 
   140   // Process reference objects found during marking
   142   // Process reference objects found during marking
   141   ReferenceProcessor* rp = GenMarkSweep::ref_processor();
   143   ReferenceProcessor* rp = GenMarkSweep::ref_processor();
   142   assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Sanity");
   144   assert(rp == G1CollectedHeap::heap()->ref_processor_stw(), "Sanity");
   143 
   145 
   302   GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
   304   GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer(), gc_tracer()->gc_id());
   303   GenMarkSweep::trace("3");
   305   GenMarkSweep::trace("3");
   304 
   306 
   305   SharedHeap* sh = SharedHeap::heap();
   307   SharedHeap* sh = SharedHeap::heap();
   306 
   308 
   307   // Need cleared claim bits for the strong roots processing
   309   // Need cleared claim bits for the roots processing
   308   ClassLoaderDataGraph::clear_claimed_marks();
   310   ClassLoaderDataGraph::clear_claimed_marks();
   309 
   311 
   310   sh->process_strong_roots(true,  // activate StrongRootsScope
   312   CodeBlobToOopClosure adjust_code_closure(&GenMarkSweep::adjust_pointer_closure, CodeBlobToOopClosure::FixRelocations);
   311                            SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_AllCodeCache,
   313   sh->process_all_roots(true,  // activate StrongRootsScope
   312                            &GenMarkSweep::adjust_pointer_closure,
   314                         SharedHeap::SO_AllCodeCache,
   313                            &GenMarkSweep::adjust_klass_closure);
   315                         &GenMarkSweep::adjust_pointer_closure,
       
   316                         &GenMarkSweep::adjust_cld_closure,
       
   317                         &adjust_code_closure);
   314 
   318 
   315   assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
   319   assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
   316   g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
   320   g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
   317 
   321 
   318   // Now adjust pointers in remaining weak roots.  (All of which should
   322   // Now adjust pointers in remaining weak roots.  (All of which should