< prev index next >

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

Print this page

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


274   {
275     StrongRootsScope srs(0);
276 
277     gch->full_process_roots(true,  // this is the adjust phase
278                             GenCollectedHeap::SO_AllCodeCache,
279                             false, // all roots
280                             &adjust_pointer_closure,
281                             &adjust_cld_closure);
282   }
283 
284   gch->gen_process_weak_roots(&adjust_pointer_closure);
285 
286   adjust_marks();
287   GenAdjustPointersClosure blk;
288   gch->generation_iterate(&blk, true);
289 }
290 
291 class GenCompactClosure: public GenCollectedHeap::GenClosure {
292 public:
293   void do_generation(Generation* gen) {

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