From 5865d3062feae76bbf61bc6e42044cd675367e2d Mon Sep 17 00:00:00 2001 From: Chris Plummer Date: Tue, 7 Nov 2017 14:13:18 -0800 Subject: [PATCH] 8059334: nsk/jvmti/scenarios/hotswap/HS201/hs201t001 fails with exit code 0 after timeout 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hotspot/share/interpreter/interpreterRuntime.cpp b/src/hotspot/share/interpreter/interpreterRuntime.cpp index 4288922afa3..d322cfd33af 100644 --- a/src/hotspot/share/interpreter/interpreterRuntime.cpp +++ b/src/hotspot/share/interpreter/interpreterRuntime.cpp @@ -921,6 +921,14 @@ nmethod* InterpreterRuntime::frequency_counter_overflow(JavaThread* thread, addr 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) {