Skip to content

Commit ccbefdf

Browse files
committed
Use __call__ slot in CallNode
1 parent 0809939 commit ccbefdf

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public enum SpecialMethodSlot {
164164
SetName(__SET_NAME__, NO_BUILTIN_DESCRIPTORS),
165165
InstanceCheck(__INSTANCECHECK__),
166166
Subclasscheck(__SUBCLASSCHECK__),
167-
Call(__CALL__),
167+
Call(__CALL__, NO_BUILTIN_DESCRIPTORS),
168168

169169
GetItem(__GETITEM__),
170170
SetItem(__SETITEM__),

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import com.oracle.graal.python.nodes.argument.CreateArgumentsNode;
5656
import com.oracle.graal.python.nodes.argument.positional.PositionalArgumentsNode;
5757
import com.oracle.graal.python.nodes.attributes.LookupInheritedAttributeNode;
58+
import com.oracle.graal.python.nodes.attributes.LookupInheritedSlotNode;
5859
import com.oracle.graal.python.nodes.call.special.CallVarargsMethodNode;
5960
import com.oracle.graal.python.nodes.truffle.PythonTypes;
6061
import com.oracle.truffle.api.dsl.Cached;
@@ -124,7 +125,7 @@ protected Object builtinFunctionCall(VirtualFrame frame, PBuiltinFunction callab
124125
@Specialization
125126
protected Object doType(VirtualFrame frame, PythonBuiltinClassType callableObject, Object[] arguments, PKeyword[] keywords,
126127
@Shared("raise") @Cached PRaiseNode raise,
127-
@Shared("lookupCall") @Cached("create(__CALL__)") LookupInheritedAttributeNode callAttrGetterNode,
128+
@Shared("lookupCall") @Cached("create(Call)") LookupInheritedSlotNode callAttrGetterNode,
128129
@Shared("callCall") @Cached CallVarargsMethodNode callCallNode) {
129130
Object call = callAttrGetterNode.execute(callableObject);
130131
return callCall(frame, callableObject, arguments, keywords, raise, callCallNode, call);
@@ -133,7 +134,7 @@ protected Object doType(VirtualFrame frame, PythonBuiltinClassType callableObjec
133134
@Specialization(guards = "isPythonClass(callableObject)", replaces = "doType")
134135
protected Object doPythonClass(VirtualFrame frame, Object callableObject, Object[] arguments, PKeyword[] keywords,
135136
@Shared("raise") @Cached PRaiseNode raise,
136-
@Shared("lookupCall") @Cached("create(__CALL__)") LookupInheritedAttributeNode callAttrGetterNode,
137+
@Shared("lookupCall") @Cached("create(Call)") LookupInheritedSlotNode callAttrGetterNode,
137138
@Shared("callCall") @Cached CallVarargsMethodNode callCallNode) {
138139
Object call = callAttrGetterNode.execute(callableObject);
139140
return callCall(frame, callableObject, arguments, keywords, raise, callCallNode, call);
@@ -142,7 +143,7 @@ protected Object doPythonClass(VirtualFrame frame, Object callableObject, Object
142143
@Specialization(guards = "!isCallable(callableObject)", replaces = {"doType", "doPythonClass"})
143144
protected Object doObjectAndType(VirtualFrame frame, Object callableObject, Object[] arguments, PKeyword[] keywords,
144145
@Shared("raise") @Cached PRaiseNode raise,
145-
@Shared("lookupCall") @Cached("create(__CALL__)") LookupInheritedAttributeNode callAttrGetterNode,
146+
@Shared("lookupCall") @Cached("create(Call)") LookupInheritedSlotNode callAttrGetterNode,
146147
@Shared("callCall") @Cached CallVarargsMethodNode callCallNode) {
147148
Object call = callAttrGetterNode.execute(callableObject);
148149
return callCall(frame, callableObject, arguments, keywords, raise, callCallNode, call);
@@ -191,15 +192,15 @@ protected Object builtinMethodCallBuiltinDirect(VirtualFrame frame, PBuiltinMeth
191192
@Specialization(guards = "!isFunction(callable.getFunction())")
192193
protected Object methodCall(VirtualFrame frame, PMethod callable, Object[] arguments, PKeyword[] keywords,
193194
@Shared("raise") @Cached PRaiseNode raise,
194-
@Shared("lookupCall") @Cached("create(__CALL__)") LookupInheritedAttributeNode callAttrGetterNode,
195+
@Shared("lookupCall") @Cached("create(Call)") LookupInheritedSlotNode callAttrGetterNode,
195196
@Shared("callCall") @Cached CallVarargsMethodNode callCallNode) {
196197
return doObjectAndType(frame, callable, arguments, keywords, raise, callAttrGetterNode, callCallNode);
197198
}
198199

199200
@Specialization(guards = "!isFunction(callable.getFunction())")
200201
protected Object builtinMethodCall(VirtualFrame frame, PBuiltinMethod callable, Object[] arguments, PKeyword[] keywords,
201202
@Shared("raise") @Cached PRaiseNode raise,
202-
@Shared("lookupCall") @Cached("create(__CALL__)") LookupInheritedAttributeNode callAttrGetterNode,
203+
@Shared("lookupCall") @Cached("create(Call)") LookupInheritedSlotNode callAttrGetterNode,
203204
@Shared("callVarargs") @Cached CallVarargsMethodNode callCallNode) {
204205
return doObjectAndType(frame, callable, arguments, keywords, raise, callAttrGetterNode, callCallNode);
205206
}

0 commit comments

Comments
 (0)