diff -r 37014ee7264c -r 18b1db5a7e70 hotspot/src/share/vm/oops/instanceKlass.cpp --- a/hotspot/src/share/vm/oops/instanceKlass.cpp Thu Mar 17 12:04:04 2016 -0700 +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Fri Mar 18 09:32:29 2016 +0100 @@ -2523,8 +2523,8 @@ } } - -void InstanceKlass::remove_osr_nmethod(nmethod* n) { +// Remove osr nmethod from the list. Return true if found and removed. +bool InstanceKlass::remove_osr_nmethod(nmethod* n) { // This is a short non-blocking critical region, so the no safepoint check is ok. MutexLockerEx ml(OsrList_lock, Mutex::_no_safepoint_check_flag); assert(n->is_osr_method(), "wrong kind of nmethod"); @@ -2533,6 +2533,7 @@ int max_level = CompLevel_none; // Find the max comp level excluding n Method* m = n->method(); // Search for match + bool found = false; while(cur != NULL && cur != n) { if (TieredCompilation && m == cur->method()) { // Find max level before n @@ -2543,6 +2544,7 @@ } nmethod* next = NULL; if (cur == n) { + found = true; next = cur->osr_link(); if (last == NULL) { // Remove first element @@ -2563,6 +2565,7 @@ } m->set_highest_osr_comp_level(max_level); } + return found; } int InstanceKlass::mark_osr_nmethods(const Method* m) {