--- old/src/share/vm/c1/c1_Runtime1.cpp 2014-05-06 15:13:00.000000000 -0700 +++ new/src/share/vm/c1/c1_Runtime1.cpp 2014-05-06 15:12:59.000000000 -0700 @@ -685,7 +685,7 @@ JRT_END // Cf. OptoRuntime::deoptimize_caller_frame -JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread)) +JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread, jint trap_request)) // Called from within the owner thread, so no need for safepoint RegisterMap reg_map(thread, false); frame stub_frame = thread->last_frame(); @@ -694,10 +694,17 @@ // We are coming from a compiled method; check this is true. assert(CodeCache::find_nmethod(caller_frame.pc()) != NULL, "sanity"); + Deoptimization::DeoptAction action = Deoptimization::trap_request_action(trap_request); + + if (action == Deoptimization::Action_make_not_entrant) { + nmethod* nm = CodeCache::find_nmethod(caller_frame.pc()); + if (nm != NULL) { + nm->make_not_entrant(); + } + } // Deoptimize the caller frame. Deoptimization::deoptimize_frame(thread, caller_frame.id()); - // Return to the now deoptimized frame. JRT_END