538
539 // Exception cache only needs to be called if unloading occurred
540 if (unloading_occurred) {
541 clean_exception_cache();
542 }
543
544 if (!cleanup_inline_caches_impl(unloading_occurred, false)) {
545 return false;
546 }
547
548 // All static stubs need to be cleaned.
549 clean_ic_stubs();
550
551 // Check that the metadata embedded in the nmethod is alive
552 DEBUG_ONLY(metadata_do(check_class));
553 return true;
554 }
555
556 void CompiledMethod::cleanup_inline_caches(bool clean_all) {
557 for (;;) {
558 { CompiledICLocker ic_locker(this);
559 if (cleanup_inline_caches_impl(false, clean_all)) {
560 return;
561 }
562 }
563 InlineCacheBuffer::refill_ic_stubs();
564 }
565 }
566
567 // Called to clean up after class unloading for live nmethods and from the sweeper
568 // for all methods.
569 bool CompiledMethod::cleanup_inline_caches_impl(bool unloading_occurred, bool clean_all) {
570 assert(CompiledICLocker::is_safe(this), "mt unsafe call");
571 ResourceMark rm;
572
573 // Find all calls in an nmethod and clear the ones that point to non-entrant,
574 // zombie and unloaded nmethods.
575 RelocIterator iter(this, oops_reloc_begin());
576 while(iter.next()) {
|
538
539 // Exception cache only needs to be called if unloading occurred
540 if (unloading_occurred) {
541 clean_exception_cache();
542 }
543
544 if (!cleanup_inline_caches_impl(unloading_occurred, false)) {
545 return false;
546 }
547
548 // All static stubs need to be cleaned.
549 clean_ic_stubs();
550
551 // Check that the metadata embedded in the nmethod is alive
552 DEBUG_ONLY(metadata_do(check_class));
553 return true;
554 }
555
556 void CompiledMethod::cleanup_inline_caches(bool clean_all) {
557 for (;;) {
558 DEBUG_ONLY(ICRefillVerifier ic_refill_verifier;)
559 { CompiledICLocker ic_locker(this);
560 if (cleanup_inline_caches_impl(false, clean_all)) {
561 return;
562 }
563 }
564 InlineCacheBuffer::refill_ic_stubs();
565 }
566 }
567
568 // Called to clean up after class unloading for live nmethods and from the sweeper
569 // for all methods.
570 bool CompiledMethod::cleanup_inline_caches_impl(bool unloading_occurred, bool clean_all) {
571 assert(CompiledICLocker::is_safe(this), "mt unsafe call");
572 ResourceMark rm;
573
574 // Find all calls in an nmethod and clear the ones that point to non-entrant,
575 // zombie and unloaded nmethods.
576 RelocIterator iter(this, oops_reloc_begin());
577 while(iter.next()) {
|