Skip to content

Commit 6503a7c

Browse files
committed
[GR-63182] [GR-65316] Enable FFM API by default.
PullRequest: graal/20770
2 parents 6d72c6a + 2059d28 commit 6503a7c

File tree

15 files changed

+189
-51
lines changed

15 files changed

+189
-51
lines changed

substratevm/mx.substratevm/mx_substratevm_benchmark.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,7 @@ def _empty_file():
931931
# 2. Native-image picks a different service provider than the JVM for javax.xml.transform.TransformerFactory.
932932
# We can simply remove the jar containing that provider as it is not required for the benchmark to run.
933933
'fop': [f"-Djava.util.logging.config.file={_empty_file()}",
934-
'--initialize-at-run-time=org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList',
935-
'-H:+ForeignAPISupport'],
934+
'--initialize-at-run-time=org.apache.fop.render.rtf.rtflib.rtfdoc.RtfList'],
936935
'batik': []
937936
}
938937

substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/AbiUtils.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ public enum Extracted {
118118
CaptureBufferAddress
119119
}
120120

121+
@Platforms(Platform.HOSTED_ONLY.class)
121122
public static class Result {
123+
@Platforms(Platform.HOSTED_ONLY.class)
122124
public record FullNativeAdaptation(
123125
Map<Extracted, ValueNode> extractedArguments,
124126
List<ValueNode> arguments,
@@ -131,10 +133,12 @@ public ValueNode getArgument(Extracted id) {
131133
}
132134
}
133135

136+
@Platforms(Platform.HOSTED_ONLY.class)
134137
public record TypeAdaptation(List<AssignedLocation> parametersAssignment, MethodType callType) {
135138
}
136139
}
137140

141+
@Platforms(Platform.HOSTED_ONLY.class)
138142
public static Result.FullNativeAdaptation adaptToNative(AbiUtils self, List<Adaptation> adaptations, List<ValueNode> originalArguments, NativeEntryPointInfo nep) {
139143
List<ValueNode> originalUnmodifiableArguments = Collections.unmodifiableList(originalArguments);
140144

@@ -175,6 +179,7 @@ public static Result.FullNativeAdaptation adaptToNative(AbiUtils self, List<Adap
175179
MethodType.methodType(nep.methodType().returnType(), argumentTypes), nodesToAppendToGraph);
176180
}
177181

182+
@Platforms(Platform.HOSTED_ONLY.class)
178183
public static Result.TypeAdaptation adaptFromNative(AbiUtils self, List<Adaptation> adaptations, JavaEntryPointInfo jep) {
179184
AssignedLocation[] originalAssignment = self.toMemoryAssignment(jep.parametersAssignment(), false);
180185

@@ -622,6 +627,7 @@ protected List<Adapter.Adaptation> generateAdaptations(NativeEntryPointInfo nep)
622627
}
623628

624629
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+27/src/java.base/share/classes/jdk/internal/foreign/abi/x64/sysv/CallArranger.java#L280-L290")
630+
@Platforms(Platform.HOSTED_ONLY.class)
625631
private static void handleCriticalWithHeapAccess(NativeEntryPointInfo nep, int i, List<Adaptation> adaptations, Adaptation adaptation) {
626632
VMError.guarantee(nep.allowHeapAccess(), "A storage may only be null when the Linker.Option.critical(true) option is passed.");
627633
VMError.guarantee(
@@ -709,6 +715,7 @@ public AssignedLocation[] toMemoryAssignment(VMStorage[] moves, boolean forRetur
709715
}
710716

711717
@Override
718+
@Platforms(Platform.HOSTED_ONLY.class)
712719
protected List<Adapter.Adaptation> generateAdaptations(NativeEntryPointInfo nep) {
713720
return fail();
714721
}
@@ -1017,6 +1024,7 @@ protected CallingSequence makeCallingSequence(MethodType type, FunctionDescripto
10171024
}
10181025

10191026
@Override
1027+
@Platforms(Platform.HOSTED_ONLY.class)
10201028
protected List<Adapter.Adaptation> generateAdaptations(NativeEntryPointInfo nep) {
10211029
var adaptations = super.generateAdaptations(nep);
10221030
var assignments = nep.parametersAssignment();
@@ -1088,6 +1096,7 @@ protected CallingSequence makeCallingSequence(MethodType type, FunctionDescripto
10881096
* assignments of float/double parameters to a cpu register.
10891097
*/
10901098
@Override
1099+
@Platforms(Platform.HOSTED_ONLY.class)
10911100
protected List<Adapter.Adaptation> generateAdaptations(NativeEntryPointInfo nep) {
10921101
List<Adapter.Adaptation> adaptations = super.generateAdaptations(nep);
10931102

substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/ForeignAPIPredicates.java

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@
2626

2727
import java.util.function.BooleanSupplier;
2828

29+
import org.graalvm.nativeimage.Platform;
30+
import org.graalvm.nativeimage.Platforms;
31+
2932
import com.oracle.svm.core.SubstrateOptions;
33+
import com.oracle.svm.core.option.SubstrateOptionsParser;
34+
import com.oracle.svm.core.util.VMError;
3035

3136
/**
3237
* Set of predicates used to control activation of substitutions (depending on method
@@ -39,21 +44,51 @@ public final class ForeignAPIPredicates {
3944
public static final class Enabled implements BooleanSupplier {
4045
@Override
4146
public boolean getAsBoolean() {
42-
return SubstrateOptions.ForeignAPISupport.getValue();
47+
return SubstrateOptions.isForeignAPIEnabled();
4348
}
4449
}
4550

4651
public static final class FunctionCallsSupported implements BooleanSupplier {
4752
@Override
4853
public boolean getAsBoolean() {
49-
return SubstrateOptions.ForeignAPISupport.getValue() && ForeignFunctionsRuntime.areFunctionCallsSupported();
54+
return SubstrateOptions.isForeignAPIEnabled() && ForeignFunctionsRuntime.areFunctionCallsSupported();
5055
}
5156
}
5257

5358
public static final class FunctionCallsUnsupported implements BooleanSupplier {
5459
@Override
5560
public boolean getAsBoolean() {
56-
return SubstrateOptions.ForeignAPISupport.getValue() && !ForeignFunctionsRuntime.areFunctionCallsSupported();
61+
return SubstrateOptions.isForeignAPIEnabled() && !ForeignFunctionsRuntime.areFunctionCallsSupported();
62+
}
63+
}
64+
65+
@Platforms(Platform.HOSTED_ONLY.class)
66+
public static final class SharedArenasEnabled implements BooleanSupplier {
67+
public static boolean getValue() {
68+
return SubstrateOptions.isForeignAPIEnabled() && SubstrateOptions.SharedArenaSupport.getValue();
69+
}
70+
71+
@Override
72+
public boolean getAsBoolean() {
73+
return SharedArenasEnabled.getValue();
74+
}
75+
}
76+
77+
public static final class SharedArenasDisabled implements BooleanSupplier {
78+
private static final String SHARED_ARENA_SUPPORT_OPTION_NAME = SubstrateOptionsParser.commandArgument(SubstrateOptions.SharedArenaSupport, "+");
79+
80+
@Platforms(Platform.HOSTED_ONLY.class)
81+
SharedArenasDisabled() {
82+
}
83+
84+
@Override
85+
public boolean getAsBoolean() {
86+
return !SharedArenasEnabled.getValue();
87+
}
88+
89+
public static RuntimeException fail() {
90+
assert !SharedArenasEnabled.getValue();
91+
throw VMError.unsupportedFeature("Support for Arena.ofShared is not active: enable with " + SHARED_ARENA_SUPPORT_OPTION_NAME);
5792
}
5893
}
5994
}

substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/ForeignFunctionsRuntime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public static boolean areFunctionCallsSupported() {
9898
}
9999

100100
public static RuntimeException functionCallsUnsupported() {
101-
assert SubstrateOptions.ForeignAPISupport.getValue();
101+
assert SubstrateOptions.isForeignAPIEnabled();
102102
throw VMError.unsupportedFeature("Calling foreign functions is currently not supported on platform: " +
103103
(OS.getCurrent().className + "-" + SubstrateUtil.getArchitectureName()).toLowerCase(Locale.ROOT));
104104
}

substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/RuntimeSystemLookup.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,15 @@
3333
import java.util.Optional;
3434
import java.util.function.Function;
3535

36+
import org.graalvm.nativeimage.Platform;
37+
import org.graalvm.nativeimage.Platform.DARWIN;
3638
import org.graalvm.nativeimage.Platform.WINDOWS;
3739
import org.graalvm.nativeimage.Platforms;
3840
import org.graalvm.nativeimage.c.function.CFunction;
3941
import org.graalvm.nativeimage.c.function.CFunction.Transition;
4042
import org.graalvm.nativeimage.c.function.CLibrary;
4143
import org.graalvm.word.Pointer;
4244

43-
import com.oracle.svm.core.OS;
4445
import com.oracle.svm.core.SubstrateUtil;
4546
import com.oracle.svm.core.util.BasedOnJDKClass;
4647

@@ -56,7 +57,7 @@ public final class RuntimeSystemLookup {
5657
static final SymbolLookup INSTANCE = makeSystemLookup();
5758

5859
public static SymbolLookup makeSystemLookup() {
59-
if (OS.WINDOWS.isCurrent()) {
60+
if (Platform.includedIn(WINDOWS.class)) {
6061
/*
6162
* Windows support has some subtleties: one would ideally load ucrtbase.dll, but some
6263
* old installs might not have it, in which case msvcrt.dll should be loaded instead. If
@@ -93,7 +94,7 @@ public static SymbolLookup makeSystemLookup() {
9394
}
9495

9596
return lookup;
96-
} else if (OS.DARWIN.isCurrent()) {
97+
} else if (Platform.includedIn(DARWIN.class)) {
9798
return Util_java_lang_foreign_SymbolLookup.libraryLookup(LookupNativeLibraries::loadLibraryPlatformSpecific, List.of("/usr/lib/libSystem.B.dylib"));
9899
} else {
99100
/*
@@ -114,6 +115,7 @@ public static SymbolLookup makeSystemLookup() {
114115
@CFunction(value = "__svm_get_syslookup_func", transition = Transition.NO_TRANSITION)
115116
public static native Pointer getSyslookupFunc(int i, int nExpected);
116117

118+
@Platforms(WINDOWS.class)
117119
private static Pointer getWindowsFallbackSymbol(String name) {
118120
try {
119121
assert Target_jdk_internal_foreign_SystemLookup_WindowsFallbackSymbols.class.isEnum();

substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/Target_jdk_internal_foreign_SystemLookup.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@
2525
package com.oracle.svm.core.foreign;
2626

2727
import java.lang.foreign.MemorySegment;
28+
import java.lang.foreign.SymbolLookup;
2829
import java.util.Optional;
2930

31+
import com.oracle.svm.core.annotate.Alias;
32+
import com.oracle.svm.core.annotate.RecomputeFieldValue;
33+
import com.oracle.svm.core.annotate.RecomputeFieldValue.Kind;
3034
import com.oracle.svm.core.annotate.Substitute;
3135
import com.oracle.svm.core.annotate.TargetClass;
3236

@@ -37,11 +41,22 @@
3741
*/
3842
@TargetClass(className = "jdk.internal.foreign.SystemLookup", onlyWith = ForeignAPIPredicates.Enabled.class)
3943
public final class Target_jdk_internal_foreign_SystemLookup {
44+
// Checkstyle: stop
45+
46+
/*
47+
* This field must be cleared because on Windows, it references a closure which contains a
48+
* native memory segment.
49+
*/
50+
@Alias //
51+
@RecomputeFieldValue(isFinal = true, kind = Kind.Reset) //
52+
static SymbolLookup SYSTEM_LOOKUP;
53+
4054
@SuppressWarnings("static-method")
4155
@Substitute
4256
public Optional<MemorySegment> find(String name) {
4357
return RuntimeSystemLookup.INSTANCE.find(name);
4458
}
59+
// Checkstyle: resume
4560
}
4661

4762
/*

substratevm/src/com.oracle.svm.core.foreign/src/com/oracle/svm/core/foreign/Target_jdk_internal_misc_ScopedMemoryAccess.java

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333
import com.oracle.svm.core.ArenaIntrinsics;
3434
import com.oracle.svm.core.annotate.Substitute;
3535
import com.oracle.svm.core.annotate.TargetClass;
36+
import com.oracle.svm.core.annotate.TargetElement;
37+
import com.oracle.svm.core.foreign.ForeignAPIPredicates.SharedArenasDisabled;
38+
import com.oracle.svm.core.foreign.ForeignAPIPredicates.SharedArenasEnabled;
3639
import com.oracle.svm.core.nodes.foreign.MemoryArenaValidInScopeNode;
3740
import com.oracle.svm.core.util.BasedOnJDKFile;
3841

@@ -96,7 +99,8 @@ static void registerNatives() {
9699
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+20/src/java.base/share/classes/java/nio/MappedMemoryUtils.java#L50-L77")
97100
@SuppressWarnings("static-method")
98101
@Substitute
99-
@Target_jdk_internal_misc_ScopedMemoryAccess_Scoped
102+
@TargetElement(onlyWith = SharedArenasEnabled.class)
103+
@SVMScoped
100104
@AlwaysInline("Safepoints must be visible in caller")
101105
public void loadInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, long address, boolean isSync, long size) {
102106
SubstrateForeignUtil.checkIdentity(mappedUtils, Target_java_nio_MappedMemoryUtils.PROXY);
@@ -116,7 +120,8 @@ public void loadInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mappe
116120
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+14/src/java.base/share/classes/java/nio/MappedMemoryUtils.java#L182-L185")
117121
@SuppressWarnings("static-method")
118122
@Substitute
119-
@Target_jdk_internal_misc_ScopedMemoryAccess_Scoped
123+
@TargetElement(onlyWith = SharedArenasEnabled.class)
124+
@SVMScoped
120125
@AlwaysInline("Safepoints must be visible in caller")
121126
public boolean isLoadedInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, long address, boolean isSync, long size) {
122127
SubstrateForeignUtil.checkIdentity(mappedUtils, Target_java_nio_MappedMemoryUtils.PROXY);
@@ -137,7 +142,8 @@ public boolean isLoadedInternal(MemorySessionImpl session, MappedMemoryUtilsProx
137142
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+14/src/java.base/share/classes/java/nio/MappedMemoryUtils.java#L192-L195")
138143
@SuppressWarnings("static-method")
139144
@Substitute
140-
@Target_jdk_internal_misc_ScopedMemoryAccess_Scoped
145+
@TargetElement(onlyWith = SharedArenasEnabled.class)
146+
@SVMScoped
141147
@AlwaysInline("Safepoints must be visible in caller")
142148
public void unloadInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, long address, boolean isSync, long size) {
143149
SubstrateForeignUtil.checkIdentity(mappedUtils, Target_java_nio_MappedMemoryUtils.PROXY);
@@ -159,7 +165,8 @@ public void unloadInternal(MemorySessionImpl session, MappedMemoryUtilsProxy map
159165
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+14/src/java.base/share/classes/java/nio/MappedMemoryUtils.java#L197-L200")
160166
@SuppressWarnings("static-method")
161167
@Substitute
162-
@Target_jdk_internal_misc_ScopedMemoryAccess_Scoped
168+
@TargetElement(onlyWith = SharedArenasEnabled.class)
169+
@SVMScoped
163170
@AlwaysInline("Safepoints must be visible in caller")
164171
public void forceInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mappedUtils, FileDescriptor fd, long address, boolean isSync, long index, long length) {
165172
SubstrateForeignUtil.checkIdentity(mappedUtils, Target_java_nio_MappedMemoryUtils.PROXY);
@@ -196,13 +203,19 @@ public void forceInternal(MemorySessionImpl session, MappedMemoryUtilsProxy mapp
196203
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+20/src/hotspot/share/prims/scopedMemoryAccess.cpp#L215-L218")
197204
@SuppressWarnings("static-method")
198205
@Substitute
206+
@TargetElement(onlyWith = SharedArenasEnabled.class)
199207
void closeScope0(Target_jdk_internal_foreign_MemorySessionImpl session, @SuppressWarnings("unused") Target_jdk_internal_misc_ScopedMemoryAccess_ScopedAccessError error) {
200208
new SyncCloseScopeOperation(session).enqueue();
201209
}
210+
211+
@Substitute
212+
@TargetElement(name = "closeScope0", onlyWith = SharedArenasDisabled.class)
213+
@SuppressWarnings({"unused", "static-method"})
214+
void closeScope0Unsupported(Target_jdk_internal_foreign_MemorySessionImpl session, Target_jdk_internal_misc_ScopedMemoryAccess_ScopedAccessError error) {
215+
throw SharedArenasDisabled.fail();
216+
}
202217
}
203218

204219
@Retention(RetentionPolicy.RUNTIME)
205-
@TargetClass(className = "jdk.internal.misc.ScopedMemoryAccess$Scoped", onlyWith = ForeignAPIPredicates.Enabled.class)
206-
@interface Target_jdk_internal_misc_ScopedMemoryAccess_Scoped {
207-
220+
@interface SVMScoped {
208221
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -34,7 +34,7 @@ public interface ForeignSupport {
3434
@Fold
3535
static boolean isAvailable() {
3636
boolean result = ImageSingletons.contains(ForeignSupport.class);
37-
assert result || !SubstrateOptions.ForeignAPISupport.getValue();
37+
assert result || !SubstrateOptions.isForeignAPIEnabled();
3838
return result;
3939
}
4040

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@
5151
import com.oracle.svm.core.c.libc.LibCBase;
5252
import com.oracle.svm.core.c.libc.MuslLibC;
5353
import com.oracle.svm.core.config.ConfigurationValues;
54+
import com.oracle.svm.core.graal.RuntimeCompilation;
5455
import com.oracle.svm.core.heap.ReferenceHandler;
5556
import com.oracle.svm.core.imagelayer.ImageLayerBuildingSupport;
57+
import com.oracle.svm.core.jdk.VectorAPIEnabled;
5658
import com.oracle.svm.core.option.APIOption;
5759
import com.oracle.svm.core.option.APIOptionGroup;
5860
import com.oracle.svm.core.option.AccumulatingLocatableMultiOptionValue;
@@ -1421,11 +1423,34 @@ public enum ReportingMode {
14211423
public static final HostedOptionKey<Boolean> UseBaseLayerInclusionPolicy = new HostedOptionKey<>(false);
14221424

14231425
@Option(help = "Support for calls via the Java Foreign Function and Memory API", type = Expert) //
1424-
public static final HostedOptionKey<Boolean> ForeignAPISupport = new HostedOptionKey<>(false);
1426+
public static final HostedOptionKey<Boolean> ForeignAPISupport = new HostedOptionKey<>(true);
1427+
1428+
@Fold
1429+
public static boolean isForeignAPIEnabled() {
1430+
/*
1431+
* FFM API should be enabled by default only if running on a supported and tested platform.
1432+
* However, if the option is explicitly enabled, we still return 'true'.
1433+
*/
1434+
return SubstrateOptions.ForeignAPISupport.getValue() &&
1435+
(SubstrateOptions.ForeignAPISupport.hasBeenSet() || Platform.includedIn(PLATFORM_JNI.class) && Platform.includedIn(NATIVE_ONLY.class));
1436+
}
14251437

14261438
@Option(help = "Support for intrinsics from the Java Vector API", type = Expert) //
14271439
public static final HostedOptionKey<Boolean> VectorAPISupport = new HostedOptionKey<>(false);
14281440

1441+
@Option(help = "Enable support for Arena.ofShared ", type = Expert)//
1442+
public static final HostedOptionKey<Boolean> SharedArenaSupport = new HostedOptionKey<>(false, key -> {
1443+
if (key.getValue()) {
1444+
// GR-65268: Shared arenas cannot be used together with runtime compilations
1445+
UserError.guarantee(!RuntimeCompilation.isEnabled(), "Arena.ofShared is not supported with runtime compilations. " +
1446+
"Replace usages of Arena.ofShared with Arena.ofAuto and disable shared arena support.");
1447+
// GR-65162: Shared arenas cannot be used together with Vector API support
1448+
UserError.guarantee(!VectorAPIEnabled.getValue(), "Support for Arena.ofShared is not available with Vector API support. " +
1449+
"Either disable Vector API support using %s or replace usages of Arena.ofShared with Arena.ofAuto and disable shared arena support.",
1450+
SubstrateOptionsParser.commandArgument(VectorAPISupport, "-"));
1451+
}
1452+
});
1453+
14291454
@Option(help = "Assume new types cannot be added after analysis", type = OptionType.Expert) //
14301455
public static final HostedOptionKey<Boolean> ClosedTypeWorld = new HostedOptionKey<>(true) {
14311456
@Override

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,7 @@
4545
final class ForeignDisabled implements BooleanSupplier {
4646
@Override
4747
public boolean getAsBoolean() {
48-
return !SubstrateOptions.ForeignAPISupport.getValue();
48+
return !SubstrateOptions.isForeignAPIEnabled();
4949
}
5050
}
5151

@@ -173,7 +173,7 @@ final class ForeignDisabledSubstitutions {
173173
private static final String OPTION_NAME = SubstrateOptionsParser.commandArgument(SubstrateOptions.ForeignAPISupport, "+");
174174

175175
static RuntimeException fail() {
176-
assert !SubstrateOptions.ForeignAPISupport.getValue();
176+
assert !SubstrateOptions.isForeignAPIEnabled();
177177
throw VMError.unsupportedFeature("Support for the Java Foreign Function and Memory API is not active: enable with " + OPTION_NAME);
178178
}
179179
}

0 commit comments

Comments
 (0)