@@ -5809,8 +5809,9 @@ class INTERPRETER_CLASS
5809
5809
}
5810
5810
#if JAVA_SPEC_VERSION >= 24
5811
5811
j9object_t syncObject = J9VMJDKINTERNALVMCONTINUATION_BLOCKER (_currentThread, continuationObject);
5812
-
5813
- switch (_currentThread->currentContinuation ->returnState ) {
5812
+ UDATA returnState = _currentThread->currentContinuation ->returnState ;
5813
+ _currentThread->currentContinuation ->returnState = 0 ;
5814
+ switch (returnState) {
5814
5815
case J9VM_CONTINUATION_RETURN_FROM_YIELD:
5815
5816
returnSingleFromINL (REGISTER_ARGS, JNI_TRUE, 1 );
5816
5817
break ;
@@ -5878,8 +5879,21 @@ class INTERPRETER_CLASS
5878
5879
case J9VM_CONTINUATION_RETURN_FROM_JIT_MONITOR_ENTER: {
5879
5880
rc = tryEnterBlockingMonitor (REGISTER_ARGS, syncObject, J9VM_CONTINUATION_RETURN_FROM_JIT_MONITOR_ENTER);
5880
5881
if ((NULL != _currentThread->currentContinuation ) && (EXECUTE_BYTECODE == rc)) {
5881
- void *returnAddress = restoreJITResolveFrame (REGISTER_ARGS);
5882
- VMStructHasBeenUpdated (REGISTER_ARGS);
5882
+ J9SFJITResolveFrame *resolveFrame = (J9SFJITResolveFrame*)_currentThread->sp ;
5883
+ void *returnAddress = NULL ;
5884
+ J9JITDecompilationInfo *decompilationStack = _currentThread->decompilationStack ;
5885
+ if ((NULL != decompilationStack) && ((void **)&resolveFrame->returnAddress == (void **)decompilationStack->pcAddress )) {
5886
+ /*
5887
+ * The return address has been patched to point to the decompile helper. This helper assumes the
5888
+ * JIT resolve frame is still on the stack. Instead of popping the resolve frame just jump to the return
5889
+ * address and leave the frame in place. The decompile helper will pop the frame.
5890
+ */
5891
+ returnAddress = resolveFrame->returnAddress ;
5892
+ } else {
5893
+ returnAddress = restoreJITResolveFrame (REGISTER_ARGS);
5894
+ VMStructHasBeenUpdated (REGISTER_ARGS);
5895
+ }
5896
+
5883
5897
rc = promotedMethodOnTransitionFromJIT (REGISTER_ARGS, returnAddress, _vm->jitConfig ->jitExitInterpreter0RestoreAll , true );
5884
5898
}
5885
5899
break ;
0 commit comments