8059334: nsk/jvmti/scenarios/hotswap/HS201/hs201t001 fails with exit code 0 after timeout
authorcjplummer
Tue, 07 Nov 2017 14:13:18 -0800
changeset 47804 fa06ab2a0570
parent 47803 2cd7d700217f
child 47805 506775a4f446
8059334: nsk/jvmti/scenarios/hotswap/HS201/hs201t001 fails with exit code 0 after timeout Summary: check if we are in "interp only" mode before returning an nm for an OSR request Reviewed-by: sspitsyn, dcubed, kvn
src/hotspot/share/interpreter/interpreterRuntime.cpp
--- a/src/hotspot/share/interpreter/interpreterRuntime.cpp	Tue Nov 07 08:47:47 2017 +0100
+++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp	Tue Nov 07 14:13:18 2017 -0800
@@ -921,6 +921,14 @@
     int bci = method->bci_from(last_frame.bcp());
     nm = method->lookup_osr_nmethod_for(bci, CompLevel_none, false);
   }
+  if (nm != NULL && thread->is_interp_only_mode()) {
+    // Normally we never get an nm if is_interp_only_mode() is true, because
+    // policy()->event has a check for this and won't compile the method when
+    // true. However, it's possible for is_interp_only_mode() to become true
+    // during the compilation. We don't want to return the nm in that case
+    // because we want to continue to execute interpreted.
+    nm = NULL;
+  }
 #ifndef PRODUCT
   if (TraceOnStackReplacement) {
     if (nm != NULL) {