< prev index next >

src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp

CLD claiming v2

89   ClassLoaderDataGraph::clear_claimed_marks();                                                                                       
90 }                                                                                                                                    
91 
92 void G1FullGCAdjustTask::work(uint worker_id) {                                                                                      
93   Ticks start = Ticks::now();                                                                                                        
94   ResourceMark rm;                                                                                                                   
95 
96   // Adjust preserved marks first since they are not balanced.                                                                       
97   G1FullGCMarker* marker = collector()->marker(worker_id);                                                                           
98   marker->preserved_stack()->adjust_during_full_gc();                                                                                
99 
100   // Adjust the weak roots.                                                                                                          
101 
102   if (Atomic::add(1u, &_references_done) == 1u) { // First incr claims task.                                                         
103     G1CollectedHeap::heap()->ref_processor_stw()->weak_oops_do(&_adjust);                                                            
104   }                                                                                                                                  
105 
106   AlwaysTrueClosure always_alive;                                                                                                    
107   _weak_proc_task.work(worker_id, &always_alive, &_adjust);                                                                          
108 
109   CLDToOopClosure adjust_cld(&_adjust, ClassLoaderData::_claim_value_strong);                                                        
110   CodeBlobToOopClosure adjust_code(&_adjust, CodeBlobToOopClosure::FixRelocations);                                                  
111   _root_processor.process_all_roots(                                                                                                 
112       &_adjust,                                                                                                                      
113       &adjust_cld,                                                                                                                   
114       &adjust_code);                                                                                                                 
115 
116   // Adjust string dedup if enabled.                                                                                                 
117   if (G1StringDedup::is_enabled()) {                                                                                                 
118     G1StringDedup::parallel_unlink(&_adjust_string_dedup, worker_id);                                                                
119   }                                                                                                                                  
120 
121   // Now adjust pointers region by region                                                                                            
122   G1AdjustRegionClosure blk(collector()->mark_bitmap(), worker_id);                                                                  
123   G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);                                 
124   log_task("Adjust task", worker_id, start);                                                                                         
125 }                                                                                                                                    

89   ClassLoaderDataGraph::clear_claimed_marks();
90 }
91 
92 void G1FullGCAdjustTask::work(uint worker_id) {
93   Ticks start = Ticks::now();
94   ResourceMark rm;
95 
96   // Adjust preserved marks first since they are not balanced.
97   G1FullGCMarker* marker = collector()->marker(worker_id);
98   marker->preserved_stack()->adjust_during_full_gc();
99 
100   // Adjust the weak roots.
101 
102   if (Atomic::add(1u, &_references_done) == 1u) { // First incr claims task.
103     G1CollectedHeap::heap()->ref_processor_stw()->weak_oops_do(&_adjust);
104   }
105 
106   AlwaysTrueClosure always_alive;
107   _weak_proc_task.work(worker_id, &always_alive, &_adjust);
108 
109   CLDToOopClosure adjust_cld(&_adjust, ClassLoaderData::_claim_strong);
110   CodeBlobToOopClosure adjust_code(&_adjust, CodeBlobToOopClosure::FixRelocations);
111   _root_processor.process_all_roots(
112       &_adjust,
113       &adjust_cld,
114       &adjust_code);
115 
116   // Adjust string dedup if enabled.
117   if (G1StringDedup::is_enabled()) {
118     G1StringDedup::parallel_unlink(&_adjust_string_dedup, worker_id);
119   }
120 
121   // Now adjust pointers region by region
122   G1AdjustRegionClosure blk(collector()->mark_bitmap(), worker_id);
123   G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
124   log_task("Adjust task", worker_id, start);
125 }
< prev index next >