< prev index next >

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

Print this page

 78   }
 79 };
 80 
 81 G1FullGCAdjustTask::G1FullGCAdjustTask(G1FullCollector* collector) :
 82     G1FullGCTask("G1 Adjust", collector),
 83     _root_processor(G1CollectedHeap::heap(), collector->workers()),
 84     _references_done(false),
 85     _weak_proc_task(collector->workers()),
 86     _hrclaimer(collector->workers()),
 87     _adjust(collector) {
 88   // Need cleared claim bits for the roots processing
 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   if (!Atomic::cmpxchg(&_references_done, false, true)) {
102     G1CollectedHeap::heap()->ref_processor_stw()->weak_oops_do(&_adjust);
103   }
104 
105   AlwaysTrueClosure always_alive;
106   _weak_proc_task.work(worker_id, &always_alive, &_adjust);
107 
108   CLDToOopClosure adjust_cld(&_adjust, ClassLoaderData::_claim_strong);
109   CodeBlobToOopClosure adjust_code(&_adjust, CodeBlobToOopClosure::FixRelocations);
110   _root_processor.process_all_roots(&_adjust, &adjust_cld, &adjust_code);
111 
112   // Now adjust pointers region by region
113   G1AdjustRegionClosure blk(collector(), worker_id);
114   G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
115   log_task("Adjust task", worker_id, start);
116 }

 78   }
 79 };
 80 
 81 G1FullGCAdjustTask::G1FullGCAdjustTask(G1FullCollector* collector) :
 82     G1FullGCTask("G1 Adjust", collector),
 83     _root_processor(G1CollectedHeap::heap(), collector->workers()),
 84     _references_done(false),
 85     _weak_proc_task(collector->workers()),
 86     _hrclaimer(collector->workers()),
 87     _adjust(collector) {
 88   // Need cleared claim bits for the roots processing
 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   const SlidingForwarding* const forwarding = G1CollectedHeap::heap()->forwarding();
 99   marker->preserved_stack()->adjust_during_full_gc(forwarding);
100 
101   // Adjust the weak roots.
102   if (!Atomic::cmpxchg(&_references_done, false, true)) {
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(&_adjust, &adjust_cld, &adjust_code);
112 
113   // Now adjust pointers region by region
114   G1AdjustRegionClosure blk(collector(), worker_id);
115   G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
116   log_task("Adjust task", worker_id, start);
117 }
< prev index next >