Skip to content

Commit 3c63bf5

Browse files
committed
Remove SubstrateVirtualThreads.
1 parent 08e385a commit 3c63bf5

13 files changed

+43
-1349
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/SubstrateOptions.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,6 @@ protected void onValueUpdate(EconomicMap<OptionKey<?>, Object> values, Boolean o
138138
}
139139
};
140140

141-
@Option(help = "Support continuations (without requiring a Project Loom JDK)") //
142-
public static final HostedOptionKey<Boolean> SupportContinuations = new HostedOptionKey<>(false);
143-
144141
public static final int ForceFallback = 10;
145142
public static final int Automatic = 5;
146143
public static final int NoFallback = 0;

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_jdk_internal_misc_VM.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@
2828

2929
import com.oracle.svm.core.NeverInline;
3030
import com.oracle.svm.core.SubstrateOptions;
31-
import com.oracle.svm.core.Uninterruptible;
3231
import com.oracle.svm.core.annotate.Alias;
33-
import com.oracle.svm.core.annotate.AnnotateOriginal;
3432
import com.oracle.svm.core.annotate.Delete;
3533
import com.oracle.svm.core.annotate.InjectAccessors;
3634
import com.oracle.svm.core.annotate.RecomputeFieldValue;
@@ -52,10 +50,6 @@ public static String getSavedProperty(String name) {
5250
return SystemPropertiesSupport.singleton().getSavedProperties().get(name);
5351
}
5452

55-
@AnnotateOriginal
56-
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
57-
public static native Thread.State toThreadState(int threadStatus);
58-
5953
@Substitute
6054
@NeverInline("Starting a stack walk in the caller frame")
6155
public static ClassLoader latestUserDefinedLoader0() {

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

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import org.graalvm.word.WordFactory;
3333

3434
import com.oracle.svm.core.NeverInline;
35-
import com.oracle.svm.core.SubstrateOptions;
3635
import com.oracle.svm.core.heap.StoredContinuation;
3736
import com.oracle.svm.core.heap.StoredContinuationAccess;
3837
import com.oracle.svm.core.heap.VMOperationInfos;
@@ -42,15 +41,12 @@
4241
import com.oracle.svm.core.stack.StackOverflowCheck;
4342
import com.oracle.svm.core.util.VMError;
4443

45-
/**
46-
* Foundation for continuation support via {@link SubstrateVirtualThread} or
47-
* {@linkplain Target_jdk_internal_vm_Continuation Project Loom}.
48-
*/
44+
/** Foundation for {@linkplain Target_jdk_internal_vm_Continuation Project Loom} support. */
4945
@InternalVMMethod
5046
public final class Continuation {
5147
@Fold
5248
public static boolean isSupported() {
53-
return SubstrateOptions.SupportContinuations.getValue() || LoomSupport.isEnabled();
49+
return LoomSupport.isEnabled();
5450
}
5551

5652
public static final int YIELDING = -2;
@@ -69,7 +65,6 @@ public static boolean isSupported() {
6965
/** While executing, frame pointer of initial frame of continuation, {@code null} otherwise. */
7066
private Pointer baseSP;
7167

72-
private boolean done;
7368
private int overflowCheckState;
7469

7570
Continuation(Runnable target) {
@@ -167,7 +162,6 @@ private void enter2() {
167162
Pointer returnSP = sp;
168163
CodePointer returnIP = ip;
169164

170-
done = true;
171165
ip = WordFactory.nullPointer();
172166
sp = WordFactory.nullPointer();
173167
baseSP = WordFactory.nullPointer();
@@ -215,18 +209,14 @@ private Integer yield0() {
215209
throw VMError.shouldNotReachHereAtRuntime();
216210
}
217211

218-
public boolean isStarted() {
212+
boolean isStarted() {
219213
return stored != null || ip.isNonNull();
220214
}
221215

222-
public boolean isEmpty() {
216+
boolean isEmpty() {
223217
return stored == null;
224218
}
225219

226-
public boolean isDone() {
227-
return done;
228-
}
229-
230220
private static final class TryPreemptOperation extends JavaVMOperation {
231221
int preemptStatus = FREEZE_OK;
232222

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

Lines changed: 0 additions & 170 deletions
This file was deleted.

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
import com.oracle.svm.core.feature.InternalFeature;
3737
import com.oracle.svm.core.heap.StoredContinuation;
3838
import com.oracle.svm.core.heap.StoredContinuationAccess;
39-
import com.oracle.svm.core.option.SubstrateOptionsParser;
40-
import com.oracle.svm.core.util.UserError;
4139
import com.oracle.svm.core.util.VMError;
4240
import com.oracle.svm.util.ReflectionUtil;
4341

@@ -78,22 +76,6 @@ public void afterRegistration(AfterRegistrationAccess access) {
7876
LoomVirtualThreads vt = new LoomVirtualThreads();
7977
ImageSingletons.add(VirtualThreads.class, vt);
8078
ImageSingletons.add(LoomVirtualThreads.class, vt); // for simpler check in LoomSupport
81-
} else if (SubstrateOptions.SupportContinuations.getValue()) {
82-
if (DeoptimizationSupport.enabled()) {
83-
throw UserError.abort("Option %s is in use, but is not supported together with Truffle JIT compilation.",
84-
SubstrateOptionsParser.commandArgument(SubstrateOptions.SupportContinuations, "+"));
85-
} else if (SubstrateOptions.useLLVMBackend()) {
86-
throw UserError.abort("Option %s is in use, but is not supported together with the LLVM backend.",
87-
SubstrateOptionsParser.commandArgument(SubstrateOptions.SupportContinuations, "+"));
88-
} else if (JavaVersionUtil.JAVA_SPEC == 17) {
89-
ImageSingletons.add(VirtualThreads.class, new SubstrateVirtualThreads());
90-
} else if (JavaVersionUtil.JAVA_SPEC >= firstLoomPreviewVersion && JavaVersionUtil.JAVA_SPEC <= lastLoomPreviewVersion) {
91-
throw UserError.abort("Virtual threads on JDK %d are supported only with preview features enabled (--enable-preview). Using option %s is unnecessary.",
92-
JavaVersionUtil.JAVA_SPEC, SubstrateOptionsParser.commandArgument(SubstrateOptions.SupportContinuations, "+"));
93-
} else {
94-
throw UserError.abort("Option %s is in use, but is not supported on JDK %d.",
95-
SubstrateOptionsParser.commandArgument(SubstrateOptions.SupportContinuations, "+"), JavaVersionUtil.JAVA_SPEC);
96-
}
9779
}
9880
finishedRegistration = true;
9981
}
@@ -129,6 +111,6 @@ public void beforeCompilation(BeforeCompilationAccess access) {
129111
}
130112

131113
static void abortIfUnsupported() {
132-
VMError.guarantee(Continuation.isSupported(), "Virtual thread internals are reachable but support is not available or active.");
114+
VMError.guarantee(Continuation.isSupported(), "Virtual threads internals are reachable but support is not available or active.");
133115
}
134116
}

0 commit comments

Comments
 (0)