Skip to content

Commit c2fdf82

Browse files
committed
Command line option for disabling forced splits.
1 parent bf8b440 commit c2fdf82

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call/InvokeNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public abstract class InvokeNode extends AbstractInvokeNode {
214214

215215
protected InvokeNode(CallTarget callTarget, Arity calleeArity, PythonObject globals, PCell[] closure, boolean isBuiltin, boolean isGenerator) {
216216
this.callNode = Truffle.getRuntime().createDirectCallNode(callTarget);
217-
if (isBuiltin) {
217+
if (isBuiltin && PythonOptions.getEnableForcedSplits()) {
218218
callNode.cloneCallTarget();
219219
}
220220
if (isGenerator && shouldInlineGenerators()) {

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ private PythonOptions() {
116116
@Option(category = OptionCategory.DEBUG, help = "Minimal size of string, when lazy strings are used. Default 20") //
117117
public static final OptionKey<Integer> MinLazyStringLength = new OptionKey<>(20);
118118

119+
@Option(category = OptionCategory.EXPERT, help = "Enable forced splitting (of builtins). Default true.") //
120+
public static final OptionKey<Boolean> EnableForcedSplits = new OptionKey<>(true);
121+
119122
public static OptionDescriptors createDescriptors() {
120123
return new PythonOptionsOptionDescriptors();
121124
}
@@ -163,4 +166,8 @@ public static int getMinLazyStringLength() {
163166
public static boolean isWithThread() {
164167
return getOption(PythonLanguage.getContextRef().get(), WithThread);
165168
}
169+
170+
public static boolean getEnableForcedSplits() {
171+
return getOption(PythonLanguage.getContextRef().get(), EnableForcedSplits);
172+
}
166173
}

0 commit comments

Comments
 (0)