< prev index next >

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

Print this page

 77     return false;
 78   }
 79 };
 80 
 81 G1FullGCAdjustTask::G1FullGCAdjustTask(G1FullCollector* collector) :
 82     G1FullGCTask("G1 Adjust", collector),
 83     _root_processor(G1CollectedHeap::heap(), collector->workers()),
 84     _weak_proc_task(collector->workers()),
 85     _hrclaimer(collector->workers()),
 86     _adjust(collector) {
 87   // Need cleared claim bits for the roots processing
 88   ClassLoaderDataGraph::clear_claimed_marks();
 89 }
 90 
 91 void G1FullGCAdjustTask::work(uint worker_id) {
 92   Ticks start = Ticks::now();
 93   ResourceMark rm;
 94 
 95   // Adjust preserved marks first since they are not balanced.
 96   G1FullGCMarker* marker = collector()->marker(worker_id);
 97   marker->preserved_stack()->adjust_during_full_gc();

 98 
 99   {
100     // Adjust the weak roots.
101     AlwaysTrueClosure always_alive;
102     _weak_proc_task.work(worker_id, &always_alive, &_adjust);
103   }
104 
105   CLDToOopClosure adjust_cld(&_adjust, ClassLoaderData::_claim_strong);
106   CodeBlobToOopClosure adjust_code(&_adjust, CodeBlobToOopClosure::FixRelocations);
107   _root_processor.process_all_roots(&_adjust, &adjust_cld, &adjust_code);
108 
109   // Now adjust pointers region by region
110   G1AdjustRegionClosure blk(collector(), worker_id);
111   G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
112   log_task("Adjust task", worker_id, start);
113 }

 77     return false;
 78   }
 79 };
 80 
 81 G1FullGCAdjustTask::G1FullGCAdjustTask(G1FullCollector* collector) :
 82     G1FullGCTask("G1 Adjust", collector),
 83     _root_processor(G1CollectedHeap::heap(), collector->workers()),
 84     _weak_proc_task(collector->workers()),
 85     _hrclaimer(collector->workers()),
 86     _adjust(collector) {
 87   // Need cleared claim bits for the roots processing
 88   ClassLoaderDataGraph::clear_claimed_marks();
 89 }
 90 
 91 void G1FullGCAdjustTask::work(uint worker_id) {
 92   Ticks start = Ticks::now();
 93   ResourceMark rm;
 94 
 95   // Adjust preserved marks first since they are not balanced.
 96   G1FullGCMarker* marker = collector()->marker(worker_id);
 97   const SlidingForwarding* const forwarding = G1CollectedHeap::heap()->forwarding();
 98   marker->preserved_stack()->adjust_during_full_gc(forwarding);
 99 
100   {
101     // Adjust the weak roots.
102     AlwaysTrueClosure always_alive;
103     _weak_proc_task.work(worker_id, &always_alive, &_adjust);
104   }
105 
106   CLDToOopClosure adjust_cld(&_adjust, ClassLoaderData::_claim_strong);
107   CodeBlobToOopClosure adjust_code(&_adjust, CodeBlobToOopClosure::FixRelocations);
108   _root_processor.process_all_roots(&_adjust, &adjust_cld, &adjust_code);
109 
110   // Now adjust pointers region by region
111   G1AdjustRegionClosure blk(collector(), worker_id);
112   G1CollectedHeap::heap()->heap_region_par_iterate_from_worker_offset(&blk, &_hrclaimer, worker_id);
113   log_task("Adjust task", worker_id, start);
114 }
< prev index next >