289 // This really ought to be "as_CompactibleSpace"...
290 r->adjust_pointers();
291 }
292 return false;
293 }
294 };
295
296 void G1MarkSweep::mark_sweep_phase3() {
297 G1CollectedHeap* g1h = G1CollectedHeap::heap();
298
299 // Adjust the pointers to reflect the new locations
300 GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer());
301 GenMarkSweep::trace("3");
302
303 SharedHeap* sh = SharedHeap::heap();
304
305 // Need cleared claim bits for the strong roots processing
306 ClassLoaderDataGraph::clear_claimed_marks();
307
308 sh->process_strong_roots(true, // activate StrongRootsScope
309 SharedHeap::SO_AllClasses | SharedHeap::SO_AllCodeCache,
310 &GenMarkSweep::adjust_pointer_closure,
311 &GenMarkSweep::adjust_klass_closure);
312
313 assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
314 g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
315
316 // Now adjust pointers in remaining weak roots. (All of which should
317 // have been cleared if they pointed to non-surviving objects.)
318 sh->process_weak_roots(&GenMarkSweep::adjust_pointer_closure);
319
320 GenMarkSweep::adjust_marks();
321
322 G1AdjustPointersClosure blk;
323 g1h->heap_region_iterate(&blk);
324 }
325
326 class G1SpaceCompactClosure: public HeapRegionClosure {
327 public:
328 G1SpaceCompactClosure() {}
329
|
289 // This really ought to be "as_CompactibleSpace"...
290 r->adjust_pointers();
291 }
292 return false;
293 }
294 };
295
296 void G1MarkSweep::mark_sweep_phase3() {
297 G1CollectedHeap* g1h = G1CollectedHeap::heap();
298
299 // Adjust the pointers to reflect the new locations
300 GCTraceTime tm("phase 3", G1Log::fine() && Verbose, true, gc_timer());
301 GenMarkSweep::trace("3");
302
303 SharedHeap* sh = SharedHeap::heap();
304
305 // Need cleared claim bits for the strong roots processing
306 ClassLoaderDataGraph::clear_claimed_marks();
307
308 sh->process_strong_roots(true, // activate StrongRootsScope
309 SharedHeap::SO_AllClasses | SharedHeap::SO_Strings | SharedHeap::SO_AllCodeCache,
310 &GenMarkSweep::adjust_pointer_closure,
311 &GenMarkSweep::adjust_klass_closure);
312
313 assert(GenMarkSweep::ref_processor() == g1h->ref_processor_stw(), "Sanity");
314 g1h->ref_processor_stw()->weak_oops_do(&GenMarkSweep::adjust_pointer_closure);
315
316 // Now adjust pointers in remaining weak roots. (All of which should
317 // have been cleared if they pointed to non-surviving objects.)
318 sh->process_weak_roots(&GenMarkSweep::adjust_pointer_closure);
319
320 GenMarkSweep::adjust_marks();
321
322 G1AdjustPointersClosure blk;
323 g1h->heap_region_iterate(&blk);
324 }
325
326 class G1SpaceCompactClosure: public HeapRegionClosure {
327 public:
328 G1SpaceCompactClosure() {}
329
|