729 FOR_ALL_HEAPS(heap) { 730 FOR_ALL_BLOBS(cb, *heap) { 731 if (cb->is_nmethod()) { 732 nmethod* nm = (nmethod*)cb; 733 count += nm->verify_icholder_relocations(); 734 } 735 } 736 } 737 738 assert(count + InlineCacheBuffer::pending_icholder_count() + CompiledICHolder::live_not_claimed_count() == 739 CompiledICHolder::live_count(), "must agree"); 740 #endif 741 } 742 743 void CodeCache::gc_prologue() { 744 } 745 746 void CodeCache::gc_epilogue() { 747 assert_locked_or_safepoint(CodeCache_lock); 748 NMethodIterator iter; 749 while(iter.next()) { 750 nmethod* nm = iter.method(); 751 if (!nm->is_zombie()) { 752 if (needs_cache_clean()) { 753 // Clean ICs of unloaded nmethods as well because they may reference other 754 // unloaded nmethods that may be flushed earlier in the sweeper cycle. 755 nm->cleanup_inline_caches(); 756 } 757 DEBUG_ONLY(nm->verify()); 758 DEBUG_ONLY(nm->verify_oop_relocations()); 759 } 760 } 761 set_needs_cache_clean(false); 762 prune_scavenge_root_nmethods(); 763 764 verify_icholder_relocations(); 765 } 766 767 void CodeCache::verify_oops() { 768 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); 769 VerifyOopClosure voc; 770 NMethodIterator iter; 771 while(iter.next_alive()) { 772 nmethod* nm = iter.method(); 773 nm->oops_do(&voc); 774 nm->verify_oop_relocations(); 775 } 776 } 777 778 size_t CodeCache::capacity() { 779 size_t cap = 0; | 729 FOR_ALL_HEAPS(heap) { 730 FOR_ALL_BLOBS(cb, *heap) { 731 if (cb->is_nmethod()) { 732 nmethod* nm = (nmethod*)cb; 733 count += nm->verify_icholder_relocations(); 734 } 735 } 736 } 737 738 assert(count + InlineCacheBuffer::pending_icholder_count() + CompiledICHolder::live_not_claimed_count() == 739 CompiledICHolder::live_count(), "must agree"); 740 #endif 741 } 742 743 void CodeCache::gc_prologue() { 744 } 745 746 void CodeCache::gc_epilogue() { 747 assert_locked_or_safepoint(CodeCache_lock); 748 NMethodIterator iter; 749 while(iter.next_alive()) { 750 nmethod* nm = iter.method(); 751 assert(!nm->is_unloaded(), "Tautology"); 752 if (needs_cache_clean()) { 753 nm->cleanup_inline_caches(); 754 } 755 DEBUG_ONLY(nm->verify()); 756 DEBUG_ONLY(nm->verify_oop_relocations()); 757 } 758 set_needs_cache_clean(false); 759 prune_scavenge_root_nmethods(); 760 761 verify_icholder_relocations(); 762 } 763 764 void CodeCache::verify_oops() { 765 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); 766 VerifyOopClosure voc; 767 NMethodIterator iter; 768 while(iter.next_alive()) { 769 nmethod* nm = iter.method(); 770 nm->oops_do(&voc); 771 nm->verify_oop_relocations(); 772 } 773 } 774 775 size_t CodeCache::capacity() { 776 size_t cap = 0; |