src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp

Print this page




 549 
 550   // Follow code cache roots
 551   CodeCache::do_unloading(is_alive_closure(), mark_and_push_closure(),
 552                           purged_class);
 553   follow_stack(); // Flush marking stack
 554 
 555   // Update subklass/sibling/implementor links of live klasses
 556   follow_weak_klass_links();
 557   assert(_marking_stack.is_empty(), "just drained");
 558 
 559   // Visit memoized mdo's and clear unmarked weak refs
 560   follow_mdo_weak_refs();
 561   assert(_marking_stack.is_empty(), "just drained");
 562 
 563   // Visit interned string tables and delete unmarked oops
 564   StringTable::unlink(is_alive_closure());
 565   // Clean up unreferenced symbols in symbol table.
 566   SymbolTable::unlink();
 567 
 568   assert(_marking_stack.is_empty(), "stack should be empty by now");

 569 }
 570 
 571 
 572 void PSMarkSweep::mark_sweep_phase2() {
 573   GCTraceTime tm("phase 2", PrintGCDetails && Verbose, true, _gc_timer);
 574   trace("2");
 575 
 576   // Now all live objects are marked, compute the new object addresses.
 577 
 578   // It is imperative that we traverse perm_gen LAST. If dead space is
 579   // allowed a range of dead object may get overwritten by a dead int
 580   // array. If perm_gen is not traversed last a klassOop may get
 581   // overwritten. This is fine since it is dead, but if the class has dead
 582   // instances we have to skip them, and in order to find their size we
 583   // need the klassOop!
 584   //
 585   // It is not required that we traverse spaces in the same order in
 586   // phase2, phase3 and phase4, but the ValidateMarkSweep live oops
 587   // tracking expects us to do so. See comment under phase4.
 588 




 549 
 550   // Follow code cache roots
 551   CodeCache::do_unloading(is_alive_closure(), mark_and_push_closure(),
 552                           purged_class);
 553   follow_stack(); // Flush marking stack
 554 
 555   // Update subklass/sibling/implementor links of live klasses
 556   follow_weak_klass_links();
 557   assert(_marking_stack.is_empty(), "just drained");
 558 
 559   // Visit memoized mdo's and clear unmarked weak refs
 560   follow_mdo_weak_refs();
 561   assert(_marking_stack.is_empty(), "just drained");
 562 
 563   // Visit interned string tables and delete unmarked oops
 564   StringTable::unlink(is_alive_closure());
 565   // Clean up unreferenced symbols in symbol table.
 566   SymbolTable::unlink();
 567 
 568   assert(_marking_stack.is_empty(), "stack should be empty by now");
 569   _gc_tracer->report_object_count_after_gc(is_alive_closure());
 570 }
 571 
 572 
 573 void PSMarkSweep::mark_sweep_phase2() {
 574   GCTraceTime tm("phase 2", PrintGCDetails && Verbose, true, _gc_timer);
 575   trace("2");
 576 
 577   // Now all live objects are marked, compute the new object addresses.
 578 
 579   // It is imperative that we traverse perm_gen LAST. If dead space is
 580   // allowed a range of dead object may get overwritten by a dead int
 581   // array. If perm_gen is not traversed last a klassOop may get
 582   // overwritten. This is fine since it is dead, but if the class has dead
 583   // instances we have to skip them, and in order to find their size we
 584   // need the klassOop!
 585   //
 586   // It is not required that we traverse spaces in the same order in
 587   // phase2, phase3 and phase4, but the ValidateMarkSweep live oops
 588   // tracking expects us to do so. See comment under phase4.
 589