Skip to content

Commit 4cbfd06

Browse files
committed
Mark the Continuation enter lambda as VMMethod
1 parent b39388c commit 4cbfd06

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

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

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@
2626

2727
import org.graalvm.nativeimage.CurrentIsolate;
2828

29+
import com.oracle.svm.core.NeverInline;
2930
import com.oracle.svm.core.annotate.Alias;
3031
import com.oracle.svm.core.annotate.Inject;
31-
import com.oracle.svm.core.NeverInline;
3232
import com.oracle.svm.core.annotate.RecomputeFieldValue;
3333
import com.oracle.svm.core.annotate.Substitute;
3434
import com.oracle.svm.core.annotate.TargetClass;
35+
import com.oracle.svm.core.jdk.InternalVMMethod;
3536
import com.oracle.svm.core.jdk.JDK19OrLater;
3637
import com.oracle.svm.core.jdk.LoomJDK;
3738
import com.oracle.svm.core.jdk.NotLoomJDK;
@@ -123,12 +124,27 @@ boolean isStarted() {
123124
@Alias
124125
public static native Target_jdk_internal_vm_Continuation getCurrentContinuation(Target_jdk_internal_vm_ContinuationScope scope);
125126

127+
/* GR-44975 Needs to be removed and reverted to a method reference */
128+
@InternalVMMethod
129+
private static class ContinuationEnter0 implements Runnable {
130+
private final Target_jdk_internal_vm_Continuation continuation;
131+
132+
ContinuationEnter0(Target_jdk_internal_vm_Continuation c) {
133+
this.continuation = c;
134+
}
135+
136+
@Override
137+
public void run() {
138+
continuation.enter0();
139+
}
140+
}
141+
126142
@Substitute
127143
static void enterSpecial(Target_jdk_internal_vm_Continuation c, boolean isContinue, boolean isVirtualThread) {
128144
assert isVirtualThread;
129145
if (!isContinue) {
130146
assert c.internal == null;
131-
c.internal = new Continuation(c::enter0);
147+
c.internal = new Continuation(new ContinuationEnter0(c));
132148
}
133149
c.internal.enter();
134150
}

0 commit comments

Comments
 (0)