Skip to content

Commit ff3ceb6

Browse files
committed
remove usages of PositionalArgumentsNode outside PythonCallNode
1 parent 2e0749b commit ff3ceb6

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/type/TypeBuiltins.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ public abstract static class CallNode extends PythonVarargsBuiltinNode {
144144
@Child CallVarargsMethodNode dispatchInit = CallVarargsMethodNode.create();
145145
@Child LookupAttributeInMRONode lookupInit = LookupAttributeInMRONode.create(__INIT__);
146146
@Child GetClassNode getClass = GetClassNode.create();
147-
@Child PositionalArgumentsNode createArgs = PositionalArgumentsNode.create();
148147

149148
public static CallNode create() {
150149
return CallNodeFactory.create();
@@ -186,7 +185,7 @@ private Object op(PythonClass self, Object[] arguments, PKeyword[] keywords, boo
186185
Object newMethod = lookupNew.execute(self);
187186
if (newMethod != PNone.NO_VALUE) {
188187
CompilerAsserts.partialEvaluationConstant(doCreateArgs);
189-
Object[] newArgs = doCreateArgs ? createArgs.executeWithArguments(self, arguments) : arguments;
188+
Object[] newArgs = doCreateArgs ? PositionalArgumentsNode.prependArgument(self, arguments, arguments.length) : arguments;
190189
Object newInstance = dispatchNew.execute(newMethod, newArgs, keywords);
191190
PythonClass newInstanceKlass = getClass.execute(newInstance);
192191
if (newInstanceKlass == self) {
@@ -199,7 +198,7 @@ private Object op(PythonClass self, Object[] arguments, PKeyword[] keywords, boo
199198
if (newMethod != PNone.NO_VALUE) {
200199
Object[] initArgs;
201200
if (doCreateArgs) {
202-
initArgs = createArgs.executeWithArguments(newInstance, arguments);
201+
initArgs = PositionalArgumentsNode.prependArgument(newInstance, arguments, arguments.length);
203202
} else {
204203
// XXX: (tfel) is this valid? I think it should be fine...
205204
arguments[0] = newInstance;

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,13 @@ protected static boolean isNoCallable(Object callee) {
8080
@Specialization(guards = {"isNoCallable(callableObject) || isClass(callableObject)"})
8181
protected Object specialCall(Object callableObject, Object[] arguments, PKeyword[] keywords,
8282
@Cached("create(__CALL__)") LookupInheritedAttributeNode callAttrGetterNode,
83-
@Cached("create()") CallVarargsMethodNode callCallNode,
84-
@Cached("create()") PositionalArgumentsNode callArgsNode) {
83+
@Cached("create()") CallVarargsMethodNode callCallNode) {
8584
Object call = callAttrGetterNode.execute(callableObject);
8685
if (isNoCallable(call)) {
8786
CompilerDirectives.transferToInterpreter();
8887
throw raise(PythonErrorType.TypeError, "'%p' object is not callable", callableObject);
8988
}
90-
return callCallNode.execute(call, callArgsNode.executeWithArguments(callableObject, arguments), keywords);
89+
return callCallNode.execute(call, PositionalArgumentsNode.prependArgument(callableObject, arguments, arguments.length), keywords);
9190
}
9291

9392
@Specialization

0 commit comments

Comments
 (0)