< prev index next >

src/hotspot/share/gc/serial/genMarkSweep.cpp

Print this page

246 
247   gch->prepare_for_compaction();
248 }
249 
250 class GenAdjustPointersClosure: public GenCollectedHeap::GenClosure {
251 public:
252   void do_generation(Generation* gen) {
253     gen->adjust_pointers();
254   }
255 };
256 
257 void GenMarkSweep::mark_sweep_phase3() {
258   GenCollectedHeap* gch = GenCollectedHeap::heap();
259 
260   // Adjust the pointers to reflect the new locations
261   GCTraceTime(Info, gc, phases) tm("Phase 3: Adjust pointers", gc_timer());
262 
263   // Need new claim bits for the pointer adjustment tracing.
264   ClassLoaderDataGraph::clear_claimed_marks();
265 


266   {
267     StrongRootsScope srs(0);
268 
269     gch->full_process_roots(true,  // this is the adjust phase
270                             GenCollectedHeap::SO_AllCodeCache,
271                             false, // all roots
272                             &adjust_pointer_closure,
273                             &adjust_cld_closure);
274   }
275 
276   gch->gen_process_weak_roots(&adjust_pointer_closure);
277 
278   adjust_marks();
279   GenAdjustPointersClosure blk;
280   gch->generation_iterate(&blk, true);
281 }
282 
283 class GenCompactClosure: public GenCollectedHeap::GenClosure {
284 public:
285   void do_generation(Generation* gen) {

246 
247   gch->prepare_for_compaction();
248 }
249 
250 class GenAdjustPointersClosure: public GenCollectedHeap::GenClosure {
251 public:
252   void do_generation(Generation* gen) {
253     gen->adjust_pointers();
254   }
255 };
256 
257 void GenMarkSweep::mark_sweep_phase3() {
258   GenCollectedHeap* gch = GenCollectedHeap::heap();
259 
260   // Adjust the pointers to reflect the new locations
261   GCTraceTime(Info, gc, phases) tm("Phase 3: Adjust pointers", gc_timer());
262 
263   // Need new claim bits for the pointer adjustment tracing.
264   ClassLoaderDataGraph::clear_claimed_marks();
265 
266   AdjustPointerClosure adjust_pointer_closure(gch->forwarding());
267   CLDToOopClosure adjust_cld_closure(&adjust_pointer_closure, ClassLoaderData::_claim_strong);
268   {
269     StrongRootsScope srs(0);
270 
271     gch->full_process_roots(true,  // this is the adjust phase
272                             GenCollectedHeap::SO_AllCodeCache,
273                             false, // all roots
274                             &adjust_pointer_closure,
275                             &adjust_cld_closure);
276   }
277 
278   gch->gen_process_weak_roots(&adjust_pointer_closure);
279 
280   adjust_marks();
281   GenAdjustPointersClosure blk;
282   gch->generation_iterate(&blk, true);
283 }
284 
285 class GenCompactClosure: public GenCollectedHeap::GenClosure {
286 public:
287   void do_generation(Generation* gen) {
< prev index next >