hotspot/src/share/vm/code/compiledIC.cpp
changeset 25492 d27050bdfb04
parent 25491 70fb742e40aa
child 26580 8cca7fbe77b8
equal deleted inserted replaced
25491:70fb742e40aa 25492:d27050bdfb04
    97     }
    97     }
    98     tty->cr();
    98     tty->cr();
    99   }
    99   }
   100 
   100 
   101   {
   101   {
   102   MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
   102     MutexLockerEx pl(SafepointSynchronize::is_at_safepoint() ? NULL : Patching_lock, Mutex::_no_safepoint_check_flag);
   103 #ifdef ASSERT
   103 #ifdef ASSERT
   104   CodeBlob* cb = CodeCache::find_blob_unsafe(_ic_call);
   104     CodeBlob* cb = CodeCache::find_blob_unsafe(_ic_call);
   105   assert(cb != NULL && cb->is_nmethod(), "must be nmethod");
   105     assert(cb != NULL && cb->is_nmethod(), "must be nmethod");
   106 #endif
   106 #endif
   107   _ic_call->set_destination_mt_safe(entry_point);
   107      _ic_call->set_destination_mt_safe(entry_point);
   108 }
   108   }
   109 
   109 
   110   if (is_optimized() || is_icstub) {
   110   if (is_optimized() || is_icstub) {
   111     // Optimized call sites don't have a cache value and ICStub call
   111     // Optimized call sites don't have a cache value and ICStub call
   112     // sites only change the entry point.  Changing the value in that
   112     // sites only change the entry point.  Changing the value in that
   113     // case could lead to MT safety issues.
   113     // case could lead to MT safety issues.
   527 // ----------------------------------------------------------------------------
   527 // ----------------------------------------------------------------------------
   528 
   528 
   529 void CompiledStaticCall::set_to_clean() {
   529 void CompiledStaticCall::set_to_clean() {
   530   assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call");
   530   assert (CompiledIC_lock->is_locked() || SafepointSynchronize::is_at_safepoint(), "mt unsafe call");
   531   // Reset call site
   531   // Reset call site
   532   MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
   532   MutexLockerEx pl(SafepointSynchronize::is_at_safepoint() ? NULL : Patching_lock, Mutex::_no_safepoint_check_flag);
   533 #ifdef ASSERT
   533 #ifdef ASSERT
   534   CodeBlob* cb = CodeCache::find_blob_unsafe(this);
   534   CodeBlob* cb = CodeCache::find_blob_unsafe(this);
   535   assert(cb != NULL && cb->is_nmethod(), "must be nmethod");
   535   assert(cb != NULL && cb->is_nmethod(), "must be nmethod");
   536 #endif
   536 #endif
   537   set_destination_mt_safe(SharedRuntime::get_resolve_static_call_stub());
   537   set_destination_mt_safe(SharedRuntime::get_resolve_static_call_stub());