2761 // All strongly reachable oops have been marked at this point; 2762 // we can visit and clear any weak references from MDO's which 2763 // we memoized during the strong marking phase. 2764 if (PrintRevisitStats) { 2765 gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes()); 2766 } 2767 for (uint i = 0; i < ParallelGCThreads + 1; i++) { 2768 ParCompactionManager* cm = ParCompactionManager::manager_array(i); 2769 GrowableArray<DataLayout*>* rms = cm->revisit_mdo_stack(); 2770 int length = rms->length(); 2771 if (PrintRevisitStats) { 2772 gclog_or_tty->print_cr("Revisit MDO stack[%d] length = %d", i, length); 2773 } 2774 for (int j = 0; j < length; j++) { 2775 rms->at(j)->follow_weak_refs(is_alive_closure()); 2776 } 2777 // revisit_mdo_stack is cleared in reset() 2778 follow_stack(cm); 2779 } 2780 } 2781 #endif // ( COMPILER1 || COMPILER2 ) 2782 2783 2784 #ifdef VALIDATE_MARK_SWEEP 2785 2786 void PSParallelCompact::track_adjusted_pointer(void* p, bool isroot) { 2787 if (!ValidateMarkSweep) 2788 return; 2789 2790 if (!isroot) { 2791 if (_pointer_tracking) { 2792 guarantee(_adjusted_pointers->contains(p), "should have seen this pointer"); 2793 _adjusted_pointers->remove(p); 2794 } 2795 } else { 2796 ptrdiff_t index = _root_refs_stack->find(p); 2797 if (index != -1) { 2798 int l = _root_refs_stack->length(); 2799 if (l > 0 && l - 1 != index) { 2800 void* last = _root_refs_stack->pop(); | 2761 // All strongly reachable oops have been marked at this point; 2762 // we can visit and clear any weak references from MDO's which 2763 // we memoized during the strong marking phase. 2764 if (PrintRevisitStats) { 2765 gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes()); 2766 } 2767 for (uint i = 0; i < ParallelGCThreads + 1; i++) { 2768 ParCompactionManager* cm = ParCompactionManager::manager_array(i); 2769 GrowableArray<DataLayout*>* rms = cm->revisit_mdo_stack(); 2770 int length = rms->length(); 2771 if (PrintRevisitStats) { 2772 gclog_or_tty->print_cr("Revisit MDO stack[%d] length = %d", i, length); 2773 } 2774 for (int j = 0; j < length; j++) { 2775 rms->at(j)->follow_weak_refs(is_alive_closure()); 2776 } 2777 // revisit_mdo_stack is cleared in reset() 2778 follow_stack(cm); 2779 } 2780 } 2781 #else 2782 void PSParallelCompact::revisit_mdo(ParCompactionManager* cm, DataLayout* p) { 2783 ShouldNotCallThis(); 2784 } 2785 2786 void PSParallelCompact::follow_mdo_weak_refs() { 2787 ShouldNotCallThis(); 2788 } 2789 #endif // ( COMPILER1 || COMPILER2 ) 2790 2791 2792 #ifdef VALIDATE_MARK_SWEEP 2793 2794 void PSParallelCompact::track_adjusted_pointer(void* p, bool isroot) { 2795 if (!ValidateMarkSweep) 2796 return; 2797 2798 if (!isroot) { 2799 if (_pointer_tracking) { 2800 guarantee(_adjusted_pointers->contains(p), "should have seen this pointer"); 2801 _adjusted_pointers->remove(p); 2802 } 2803 } else { 2804 ptrdiff_t index = _root_refs_stack->find(p); 2805 if (index != -1) { 2806 int l = _root_refs_stack->length(); 2807 if (l > 0 && l - 1 != index) { 2808 void* last = _root_refs_stack->pop(); |