comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @ 10188:2f50bc369470

8013160: NPG: Remove unnecessary mark stack draining after CodeCache::do_unloading Reviewed-by: coleenp, mgerdin
author stefank
date Fri, 26 Apr 2013 10:40:36 +0200
parents b06ac540229e
children 12f651e29f6b
comparison
equal deleted inserted replaced
10187:b294421fa3c5 10188:2f50bc369470
515 ref_processor()->setup_policy(clear_all_softrefs); 515 ref_processor()->setup_policy(clear_all_softrefs);
516 ref_processor()->process_discovered_references( 516 ref_processor()->process_discovered_references(
517 is_alive_closure(), mark_and_push_closure(), follow_stack_closure(), NULL); 517 is_alive_closure(), mark_and_push_closure(), follow_stack_closure(), NULL);
518 } 518 }
519 519
520 // Follow system dictionary roots and unload classes 520 // This is the point where the entire marking should have completed.
521 assert(_marking_stack.is_empty(), "Marking should have completed");
522
523 // Unload classes and purge the SystemDictionary.
521 bool purged_class = SystemDictionary::do_unloading(is_alive_closure()); 524 bool purged_class = SystemDictionary::do_unloading(is_alive_closure());
522 525
523 // Follow code cache roots 526 // Unload nmethods.
524 CodeCache::do_unloading(is_alive_closure(), purged_class); 527 CodeCache::do_unloading(is_alive_closure(), purged_class);
525 follow_stack(); // Flush marking stack 528
526 529 // Prune dead klasses from subklass/sibling/implementor lists.
527 // Update subklass/sibling/implementor links of live klasses 530 Klass::clean_weak_klass_links(is_alive_closure());
528 Klass::clean_weak_klass_links(&is_alive); 531
529 assert(_marking_stack.is_empty(), "just drained"); 532 // Delete entries for dead interned strings.
530
531 // Visit interned string tables and delete unmarked oops
532 StringTable::unlink(is_alive_closure()); 533 StringTable::unlink(is_alive_closure());
534
533 // Clean up unreferenced symbols in symbol table. 535 // Clean up unreferenced symbols in symbol table.
534 SymbolTable::unlink(); 536 SymbolTable::unlink();
535
536 assert(_marking_stack.is_empty(), "stack should be empty by now");
537 } 537 }
538 538
539 539
540 void PSMarkSweep::mark_sweep_phase2() { 540 void PSMarkSweep::mark_sweep_phase2() {
541 TraceTime tm("phase 2", PrintGCDetails && Verbose, true, gclog_or_tty); 541 TraceTime tm("phase 2", PrintGCDetails && Verbose, true, gclog_or_tty);