hotspot/src/share/vm/oops/instanceKlass.cpp
changeset 27434 b4b185d05bb5
parent 27409 03622fc45677
child 27435 58d1380ceacb
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Wed Oct 29 15:42:48 2014 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Thu Oct 30 13:03:30 2014 +0100
@@ -2845,6 +2845,22 @@
   }
 }
 
+int InstanceKlass::mark_osr_nmethods(const Method* m) {
+  // 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();
+  int found = 0;
+  while (osr != NULL) {
+    assert(osr->is_osr_method(), "wrong kind of nmethod found in chain");
+    if (osr->method() == m) {
+      osr->mark_for_deoptimization();
+      found++;
+    }
+    osr = osr->osr_link();
+  }
+  return found;
+}
+
 nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_level, bool match_level) 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);