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