Skip to content

Commit af248da

Browse files
committed
force inlining of generator functions
1 parent b8ba18b commit af248da

File tree

1 file changed

+5
-2
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,11 @@ public abstract class InvokeNode extends AbstractInvokeNode {
154154
private final PCell[] closure;
155155
protected final boolean isBuiltin;
156156

157-
protected InvokeNode(CallTarget callTarget, Arity calleeArity, PythonObject globals, PCell[] closure, boolean isBuiltin) {
157+
protected InvokeNode(CallTarget callTarget, Arity calleeArity, PythonObject globals, PCell[] closure, boolean isBuiltin, boolean isGenerator) {
158158
this.callNode = Truffle.getRuntime().createDirectCallNode(callTarget);
159+
if (isGenerator) {
160+
this.callNode.forceInlining();
161+
}
159162
this.arity = calleeArity;
160163
this.globals = globals;
161164
this.closure = closure;
@@ -172,7 +175,7 @@ public static InvokeNode create(PythonCallable callee) {
172175
if (builtin && shouldSplit(callee)) {
173176
callTarget = split(callTarget);
174177
}
175-
return InvokeNodeGen.create(callTarget, getArity(callee), callee.getGlobals(), callee.getClosure(), builtin);
178+
return InvokeNodeGen.create(callTarget, getArity(callee), callee.getGlobals(), callee.getClosure(), builtin, callee.isGeneratorFunction());
176179
}
177180

178181
/**

0 commit comments

Comments
 (0)