changeset 20610:d4562805b030

Merge
author thartmann
date Wed, 05 Nov 2014 08:35:02 +0000
parents 468850e35e48 (diff) 4cb90023bf2b (current diff)
children 3c87c13918fb
files
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/simpleThresholdPolicy.cpp	Mon Oct 13 16:09:57 2014 -0700
+++ b/src/share/vm/runtime/simpleThresholdPolicy.cpp	Wed Nov 05 08:35:02 2014 +0000
@@ -196,7 +196,6 @@
     // Don't trigger other compiles in testing mode
     return NULL;
   }
-  nmethod *osr_nm = NULL;
 
   handle_counter_overflow(method());
   if (method() != inlinee()) {
@@ -210,14 +209,16 @@
   if (bci == InvocationEntryBci) {
     method_invocation_event(method, inlinee, comp_level, nm, thread);
   } else {
+    // method == inlinee if the event originated in the main method
     method_back_branch_event(method, inlinee, bci, comp_level, nm, thread);
-    // method == inlinee if the event originated in the main method
-    int highest_level = inlinee->highest_osr_comp_level();
-    if (highest_level > comp_level) {
-      osr_nm = inlinee->lookup_osr_nmethod_for(bci, highest_level, false);
+    // Check if event led to a higher level OSR compilation
+    nmethod* osr_nm = inlinee->lookup_osr_nmethod_for(bci, comp_level, false);
+    if (osr_nm != NULL && osr_nm->comp_level() > comp_level) {
+      // Perform OSR with new nmethod
+      return osr_nm;
     }
   }
-  return osr_nm;
+  return NULL;
 }
 
 // Check if the method can be compiled, change level if necessary