Skip to content

Commit 9acaf31

Browse files
committed
[GR-55107] Enable NFI Panama by default on GraalPy on HotSpot
1 parent 214eb2d commit 9acaf31

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/PythonOptions.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
6262
import com.oracle.truffle.api.Option;
6363
import com.oracle.truffle.api.TruffleLanguage.Env;
64+
import com.oracle.truffle.api.TruffleOptions;
6465
import com.oracle.truffle.api.dsl.Idempotent;
6566
import com.oracle.truffle.api.exception.AbstractTruffleException;
6667
import com.oracle.truffle.api.nodes.ExplodeLoop;
@@ -362,8 +363,8 @@ public static void checkBytecodeDSLEnv() {
362363
@Option(category = OptionCategory.EXPERT, usageSyntax = "<bytes>", help = "Initial native memory heap size that triggers a GC (default: 256 MB).") //
363364
public static final OptionKey<Long> InitialNativeMemory = new OptionKey<>(1L << 28);
364365

365-
@Option(category = OptionCategory.EXPERT, usageSyntax = "true|false", help = "Use the experimental panama backend for NFI.", stability = OptionStability.EXPERIMENTAL) //
366-
public static final OptionKey<Boolean> UsePanama = new OptionKey<>(false);
366+
@Option(category = OptionCategory.EXPERT, usageSyntax = "true|false", help = "Use the panama backend for NFI.", stability = OptionStability.EXPERIMENTAL) //
367+
public static final OptionKey<Boolean> UsePanama = new OptionKey<>(!TruffleOptions.AOT && Runtime.version().feature() >= 22);
367368

368369
@Option(category = OptionCategory.EXPERT, usageSyntax = "true|false", help = "Set by the launcher to true (false means that GraalPy is being embedded in an application).") //
369370
public static final OptionKey<Boolean> RunViaLauncher = new OptionKey<>(false);

0 commit comments

Comments
 (0)