1.1 --- a/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Fri Apr 26 09:53:22 2013 +0200 1.2 +++ b/src/share/vm/gc_implementation/g1/g1MarkSweep.cpp Fri Apr 26 10:40:36 2013 +0200 1.3 @@ -144,29 +144,25 @@ 1.4 &GenMarkSweep::follow_stack_closure, 1.5 NULL); 1.6 1.7 - // Follow system dictionary roots and unload classes 1.8 + 1.9 + // This is the point where the entire marking should have completed. 1.10 + assert(GenMarkSweep::_marking_stack.is_empty(), "Marking should have completed"); 1.11 + 1.12 + // Unload classes and purge the SystemDictionary. 1.13 bool purged_class = SystemDictionary::do_unloading(&GenMarkSweep::is_alive); 1.14 - assert(GenMarkSweep::_marking_stack.is_empty(), 1.15 - "stack should be empty by now"); 1.16 1.17 - // Follow code cache roots (has to be done after system dictionary, 1.18 - // assumes all live klasses are marked) 1.19 + // Unload nmethods. 1.20 CodeCache::do_unloading(&GenMarkSweep::is_alive, purged_class); 1.21 - GenMarkSweep::follow_stack(); 1.22 1.23 - // Update subklass/sibling/implementor links of live klasses 1.24 + // Prune dead klasses from subklass/sibling/implementor lists. 1.25 Klass::clean_weak_klass_links(&GenMarkSweep::is_alive); 1.26 - assert(GenMarkSweep::_marking_stack.is_empty(), 1.27 - "stack should be empty by now"); 1.28 1.29 - // Visit interned string tables and delete unmarked oops 1.30 + // Delete entries for dead interned strings. 1.31 StringTable::unlink(&GenMarkSweep::is_alive); 1.32 + 1.33 // Clean up unreferenced symbols in symbol table. 1.34 SymbolTable::unlink(); 1.35 1.36 - assert(GenMarkSweep::_marking_stack.is_empty(), 1.37 - "stack should be empty by now"); 1.38 - 1.39 if (VerifyDuringGC) { 1.40 HandleMark hm; // handle scope 1.41 COMPILER2_PRESENT(DerivedPointerTableDeactivate dpt_deact);