--- old/src/share/vm/oops/instanceKlass.cpp 2014-10-27 15:42:57.714739195 +0100 +++ new/src/share/vm/oops/instanceKlass.cpp 2014-10-27 15:42:57.426739208 +0100 @@ -2845,7 +2845,8 @@ } } -nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_level, bool match_level) const { +nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_level, + bool match_level, bool skip_marked) const { // This is a short non-blocking critical region, so the no safepoint check is ok. MutexLockerEx ml(OsrList_lock, Mutex::_no_safepoint_check_flag); nmethod* osr = osr_nmethods_head(); @@ -2858,7 +2859,7 @@ // while we overflow in the c1 code at back branches we don't want to // try and switch to the same code as we are already running - if (osr->method() == m && + if (osr->method() == m && !(skip_marked && osr->is_marked_for_deoptimization()) && (bci == InvocationEntryBci || osr->osr_entry_bci() == bci)) { if (match_level) { if (osr->comp_level() == comp_level) {