hotspot/src/share/vm/oops/instanceKlass.cpp
changeset 36812 4f96f15e4a46
parent 36508 5f9eee6b383b
parent 36802 18b1db5a7e70
child 37242 91e5f98fff6f
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Mar 22 18:41:09 2016 -0700
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Wed Mar 23 15:01:42 2016 +0100
@@ -2614,8 +2614,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");
@@ -2624,6 +2624,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
@@ -2634,6 +2635,7 @@
   }
   nmethod* next = NULL;
   if (cur == n) {
+    found = true;
     next = cur->osr_link();
     if (last == NULL) {
       // Remove first element
@@ -2654,6 +2656,7 @@
     }
     m->set_highest_osr_comp_level(max_level);
   }
+  return found;
 }
 
 int InstanceKlass::mark_osr_nmethods(const Method* m) {