1.1 --- a/src/share/vm/gc_implementation/shared/markSweep.cpp Mon Aug 31 05:27:29 2009 -0700 1.2 +++ b/src/share/vm/gc_implementation/shared/markSweep.cpp Wed Sep 02 00:04:29 2009 -0700 1.3 @@ -27,6 +27,7 @@ 1.4 1.5 GrowableArray<oop>* MarkSweep::_marking_stack = NULL; 1.6 GrowableArray<Klass*>* MarkSweep::_revisit_klass_stack = NULL; 1.7 +GrowableArray<DataLayout*>* MarkSweep::_revisit_mdo_stack = NULL; 1.8 1.9 GrowableArray<oop>* MarkSweep::_preserved_oop_stack = NULL; 1.10 GrowableArray<markOop>* MarkSweep::_preserved_mark_stack= NULL; 1.11 @@ -62,12 +63,37 @@ 1.12 void MarkSweep::follow_weak_klass_links() { 1.13 // All klasses on the revisit stack are marked at this point. 1.14 // Update and follow all subklass, sibling and implementor links. 1.15 + if (PrintRevisitStats) { 1.16 + gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes()); 1.17 + gclog_or_tty->print_cr("Revisit klass stack length = %d", _revisit_klass_stack->length()); 1.18 + } 1.19 for (int i = 0; i < _revisit_klass_stack->length(); i++) { 1.20 _revisit_klass_stack->at(i)->follow_weak_klass_links(&is_alive,&keep_alive); 1.21 } 1.22 follow_stack(); 1.23 } 1.24 1.25 +#if ( defined(COMPILER1) || defined(COMPILER2) ) 1.26 +void MarkSweep::revisit_mdo(DataLayout* p) { 1.27 + _revisit_mdo_stack->push(p); 1.28 +} 1.29 + 1.30 +void MarkSweep::follow_mdo_weak_refs() { 1.31 + // All strongly reachable oops have been marked at this point; 1.32 + // we can visit and clear any weak references from MDO's which 1.33 + // we memoized during the strong marking phase. 1.34 + assert(_marking_stack->is_empty(), "Marking stack should be empty"); 1.35 + if (PrintRevisitStats) { 1.36 + gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes()); 1.37 + gclog_or_tty->print_cr("Revisit MDO stack length = %d", _revisit_mdo_stack->length()); 1.38 + } 1.39 + for (int i = 0; i < _revisit_mdo_stack->length(); i++) { 1.40 + _revisit_mdo_stack->at(i)->follow_weak_refs(&is_alive); 1.41 + } 1.42 + follow_stack(); 1.43 +} 1.44 +#endif // ( COMPILER1 || COMPILER2 ) 1.45 + 1.46 MarkSweep::FollowRootClosure MarkSweep::follow_root_closure; 1.47 1.48 void MarkSweep::FollowRootClosure::do_oop(oop* p) { follow_root(p); }