Skip to content

Commit 2167561

Browse files
committed
GR-63795: restore com.oracle.svm.core.thread.Safepoint.existSlowPathCheck()
1 parent 12bdf4d commit 2167561

File tree

1 file changed

+15
-0
lines changed
  • substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread

1 file changed

+15
-0
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/Safepoint.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@
6565
import com.oracle.svm.core.nodes.SafepointCheckNode;
6666
import com.oracle.svm.core.option.HostedOptionKey;
6767
import com.oracle.svm.core.option.RuntimeOptionKey;
68+
import com.oracle.svm.core.snippets.KnownIntrinsics;
6869
import com.oracle.svm.core.snippets.SnippetRuntime;
6970
import com.oracle.svm.core.snippets.SnippetRuntime.SubstrateForeignCallDescriptor;
7071
import com.oracle.svm.core.snippets.SubstrateForeignCallTarget;
7172
import com.oracle.svm.core.stack.JavaFrameAnchors;
73+
import com.oracle.svm.core.thread.VMThreads.ActionOnExitSafepointSupport;
7274
import com.oracle.svm.core.thread.VMThreads.ActionOnTransitionToJavaSupport;
7375
import com.oracle.svm.core.thread.VMThreads.SafepointBehavior;
7476
import com.oracle.svm.core.thread.VMThreads.StatusSupport;
@@ -196,6 +198,7 @@ private static void slowPathSafepointCheck(int newStatus, boolean callerHasJavaF
196198
*/
197199
VMError.shouldNotReachHere(ex);
198200
}
201+
exitSlowPathCheck();
199202
}
200203

201204
/**
@@ -422,6 +425,18 @@ public static void slowPathSafepointCheck() throws Throwable {
422425
slowPathSafepointCheck(StatusSupport.STATUS_IN_JAVA, false, false);
423426
}
424427

428+
@Uninterruptible(reason = "Must not contain safepoint checks")
429+
private static void exitSlowPathCheck() {
430+
if (ActionOnExitSafepointSupport.isActionPending()) {
431+
if (LoomSupport.isEnabled() && ActionOnExitSafepointSupport.isSwitchStackPending()) {
432+
ActionOnExitSafepointSupport.clearActions();
433+
KnownIntrinsics.farReturn(0, ActionOnExitSafepointSupport.getSwitchStackSP(), ActionOnExitSafepointSupport.getSwitchStackIP(), false);
434+
} else {
435+
assert false : "Unexpected action pending.";
436+
}
437+
}
438+
}
439+
425440
/**
426441
* Transition from native to Java, checking for safepoint.
427442
*

0 commit comments

Comments
 (0)