comparison src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @ 993:54b3b351d6f9

Merge
author jrose
date Wed, 23 Sep 2009 23:56:15 -0700
parents 148e5441d916 8b46c4d82093
children 46b819ba120b
comparison
equal deleted inserted replaced
992:6a8ccac44f41 993:54b3b351d6f9
2378 purged_class); 2378 purged_class);
2379 follow_stack(cm); // Flush marking stack. 2379 follow_stack(cm); // Flush marking stack.
2380 2380
2381 // Update subklass/sibling/implementor links of live klasses 2381 // Update subklass/sibling/implementor links of live klasses
2382 // revisit_klass_stack is used in follow_weak_klass_links(). 2382 // revisit_klass_stack is used in follow_weak_klass_links().
2383 follow_weak_klass_links(cm); 2383 follow_weak_klass_links();
2384
2385 // Revisit memoized MDO's and clear any unmarked weak refs
2386 follow_mdo_weak_refs();
2384 2387
2385 // Visit symbol and interned string tables and delete unmarked oops 2388 // Visit symbol and interned string tables and delete unmarked oops
2386 SymbolTable::unlink(is_alive_closure()); 2389 SymbolTable::unlink(is_alive_closure());
2387 StringTable::unlink(is_alive_closure()); 2390 StringTable::unlink(is_alive_closure());
2388 2391
2721 obj->follow_contents(cm); 2724 obj->follow_contents(cm);
2722 } 2725 }
2723 } 2726 }
2724 2727
2725 void 2728 void
2726 PSParallelCompact::follow_weak_klass_links(ParCompactionManager* serial_cm) { 2729 PSParallelCompact::follow_weak_klass_links() {
2727 // All klasses on the revisit stack are marked at this point. 2730 // All klasses on the revisit stack are marked at this point.
2728 // Update and follow all subklass, sibling and implementor links. 2731 // Update and follow all subklass, sibling and implementor links.
2729 for (uint i = 0; i < ParallelGCThreads+1; i++) { 2732 if (PrintRevisitStats) {
2733 gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes());
2734 }
2735 for (uint i = 0; i < ParallelGCThreads + 1; i++) {
2730 ParCompactionManager* cm = ParCompactionManager::manager_array(i); 2736 ParCompactionManager* cm = ParCompactionManager::manager_array(i);
2731 KeepAliveClosure keep_alive_closure(cm); 2737 KeepAliveClosure keep_alive_closure(cm);
2732 for (int i = 0; i < cm->revisit_klass_stack()->length(); i++) { 2738 int length = cm->revisit_klass_stack()->length();
2733 cm->revisit_klass_stack()->at(i)->follow_weak_klass_links( 2739 if (PrintRevisitStats) {
2740 gclog_or_tty->print_cr("Revisit klass stack[%d] length = %d", i, length);
2741 }
2742 for (int j = 0; j < length; j++) {
2743 cm->revisit_klass_stack()->at(j)->follow_weak_klass_links(
2734 is_alive_closure(), 2744 is_alive_closure(),
2735 &keep_alive_closure); 2745 &keep_alive_closure);
2736 } 2746 }
2747 // revisit_klass_stack is cleared in reset()
2737 follow_stack(cm); 2748 follow_stack(cm);
2738 } 2749 }
2739 } 2750 }
2740 2751
2741 void 2752 void
2742 PSParallelCompact::revisit_weak_klass_link(ParCompactionManager* cm, Klass* k) { 2753 PSParallelCompact::revisit_weak_klass_link(ParCompactionManager* cm, Klass* k) {
2743 cm->revisit_klass_stack()->push(k); 2754 cm->revisit_klass_stack()->push(k);
2744 } 2755 }
2756
2757 #if ( defined(COMPILER1) || defined(COMPILER2) )
2758 void PSParallelCompact::revisit_mdo(ParCompactionManager* cm, DataLayout* p) {
2759 cm->revisit_mdo_stack()->push(p);
2760 }
2761
2762 void PSParallelCompact::follow_mdo_weak_refs() {
2763 // All strongly reachable oops have been marked at this point;
2764 // we can visit and clear any weak references from MDO's which
2765 // we memoized during the strong marking phase.
2766 if (PrintRevisitStats) {
2767 gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes());
2768 }
2769 for (uint i = 0; i < ParallelGCThreads + 1; i++) {
2770 ParCompactionManager* cm = ParCompactionManager::manager_array(i);
2771 GrowableArray<DataLayout*>* rms = cm->revisit_mdo_stack();
2772 int length = rms->length();
2773 if (PrintRevisitStats) {
2774 gclog_or_tty->print_cr("Revisit MDO stack[%d] length = %d", i, length);
2775 }
2776 for (int j = 0; j < length; j++) {
2777 rms->at(j)->follow_weak_refs(is_alive_closure());
2778 }
2779 // revisit_mdo_stack is cleared in reset()
2780 follow_stack(cm);
2781 }
2782 }
2783 #endif // ( COMPILER1 || COMPILER2 )
2784
2745 2785
2746 #ifdef VALIDATE_MARK_SWEEP 2786 #ifdef VALIDATE_MARK_SWEEP
2747 2787
2748 void PSParallelCompact::track_adjusted_pointer(void* p, bool isroot) { 2788 void PSParallelCompact::track_adjusted_pointer(void* p, bool isroot) {
2749 if (!ValidateMarkSweep) 2789 if (!ValidateMarkSweep)