< prev index next >

src/share/vm/code/codeCache.cpp

Print this page




 728   int count = 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()) {
 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();




 728   int count = 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   NOT_DEBUG(if (needs_cache_clean())) {
 749     NMethodIterator iter;
 750     while(iter.next_alive()) {
 751       nmethod* nm = iter.method();
 752       assert(!nm->is_unloaded(), "Tautology");
 753       DEBUG_ONLY(if (needs_cache_clean())) {


 754         nm->cleanup_inline_caches();
 755       }
 756       DEBUG_ONLY(nm->verify());
 757       DEBUG_ONLY(nm->verify_oop_relocations());
 758     }
 759   }
 760   set_needs_cache_clean(false);
 761   prune_scavenge_root_nmethods();
 762 
 763   verify_icholder_relocations();
 764 }
 765 
 766 void CodeCache::verify_oops() {
 767   MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
 768   VerifyOopClosure voc;
 769   NMethodIterator iter;
 770   while(iter.next_alive()) {
 771     nmethod* nm = iter.method();
 772     nm->oops_do(&voc);
 773     nm->verify_oop_relocations();


< prev index next >