diff -r 7e268f863ff0 -r dad45affbdaa src/hotspot/share/runtime/sharedRuntime.cpp --- a/src/hotspot/share/runtime/sharedRuntime.cpp Wed Dec 05 15:57:26 2018 +0100 +++ b/src/hotspot/share/runtime/sharedRuntime.cpp Wed Dec 05 16:11:53 2018 +0100 @@ -1059,7 +1059,7 @@ address pc = vfst.frame_pc(); { // Get call instruction under lock because another thread may be busy patching it. - MutexLockerEx ml_patch(Patching_lock, Mutex::_no_safepoint_check_flag); + CompiledICLocker ic_locker(caller); return caller->attached_method_before_pc(pc); } return NULL; @@ -1765,7 +1765,7 @@ { // Get call instruction under lock because another thread may be // busy patching it. - MutexLockerEx ml_patch(Patching_lock, Mutex::_no_safepoint_check_flag); + CompiledICLocker ml(caller_nm); // Location of call instruction call_addr = caller_nm->call_instruction_address(pc); } @@ -1940,9 +1940,8 @@ if (moop->code() == NULL) return; if (nm->is_in_use()) { - // Expect to find a native call there (unless it was no-inline cache vtable dispatch) - MutexLockerEx ml_patch(Patching_lock, Mutex::_no_safepoint_check_flag); + CompiledICLocker ic_locker(nm); if (NativeCall::is_call_before(return_pc)) { ResourceMark mark; NativeCallWrapper* call = nm->call_wrapper_before(return_pc);