670 // ...Already marked in the previous pass; don't count it again. 671 } else if (nm->is_evol_dependent_on(dependee())) { 672 ResourceMark rm; 673 nm->mark_for_deoptimization(); 674 number_of_marked_CodeBlobs++; 675 } else { 676 // flush caches in case they refer to a redefined Method* 677 nm->clear_inline_caches(); 678 } 679 } 680 681 return number_of_marked_CodeBlobs; 682 } 683 #endif // HOTSWAP 684 685 686 // Deoptimize all methods 687 void CodeCache::mark_all_nmethods_for_deoptimization() { 688 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); 689 FOR_ALL_ALIVE_NMETHODS(nm) { 690 nm->mark_for_deoptimization(); 691 } 692 } 693 694 695 int CodeCache::mark_for_deoptimization(Method* dependee) { 696 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); 697 int number_of_marked_CodeBlobs = 0; 698 699 FOR_ALL_ALIVE_NMETHODS(nm) { 700 if (nm->is_dependent_on_method(dependee)) { 701 ResourceMark rm; 702 nm->mark_for_deoptimization(); 703 number_of_marked_CodeBlobs++; 704 } 705 } 706 707 return number_of_marked_CodeBlobs; 708 } 709 710 void CodeCache::make_marked_nmethods_zombies() { 711 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); | 670 // ...Already marked in the previous pass; don't count it again. 671 } else if (nm->is_evol_dependent_on(dependee())) { 672 ResourceMark rm; 673 nm->mark_for_deoptimization(); 674 number_of_marked_CodeBlobs++; 675 } else { 676 // flush caches in case they refer to a redefined Method* 677 nm->clear_inline_caches(); 678 } 679 } 680 681 return number_of_marked_CodeBlobs; 682 } 683 #endif // HOTSWAP 684 685 686 // Deoptimize all methods 687 void CodeCache::mark_all_nmethods_for_deoptimization() { 688 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); 689 FOR_ALL_ALIVE_NMETHODS(nm) { 690 if (!nm->method()->is_method_handle_intrinsic()) { 691 nm->mark_for_deoptimization(); 692 } 693 } 694 } 695 696 697 int CodeCache::mark_for_deoptimization(Method* dependee) { 698 MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); 699 int number_of_marked_CodeBlobs = 0; 700 701 FOR_ALL_ALIVE_NMETHODS(nm) { 702 if (nm->is_dependent_on_method(dependee)) { 703 ResourceMark rm; 704 nm->mark_for_deoptimization(); 705 number_of_marked_CodeBlobs++; 706 } 707 } 708 709 return number_of_marked_CodeBlobs; 710 } 711 712 void CodeCache::make_marked_nmethods_zombies() { 713 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint"); |