@@ -121,7 +121,25 @@ protected Object builtinFunctionCall(VirtualFrame frame, PBuiltinFunction callab
121
121
return dispatch .executeCall (frame , callable , createArgs .execute (callable , arguments , keywords ));
122
122
}
123
123
124
- @ Specialization (guards = "!isCallable(callableObject)" )
124
+ @ Specialization
125
+ protected Object doType (VirtualFrame frame , PythonBuiltinClassType callableObject , Object [] arguments , PKeyword [] keywords ,
126
+ @ Cached PRaiseNode raise ,
127
+ @ Cached ("create(__CALL__)" ) LookupInheritedAttributeNode callAttrGetterNode ,
128
+ @ Cached CallVarargsMethodNode callCallNode ) {
129
+ Object call = callAttrGetterNode .execute (callableObject );
130
+ return callCall (frame , callableObject , arguments , keywords , raise , callCallNode , call );
131
+ }
132
+
133
+ @ Specialization (guards = "isPythonClass(callableObject)" , replaces = "doType" )
134
+ protected Object doPythonClass (VirtualFrame frame , Object callableObject , Object [] arguments , PKeyword [] keywords ,
135
+ @ Cached PRaiseNode raise ,
136
+ @ Cached ("create(__CALL__)" ) LookupInheritedAttributeNode callAttrGetterNode ,
137
+ @ Cached CallVarargsMethodNode callCallNode ) {
138
+ Object call = callAttrGetterNode .execute (callableObject );
139
+ return callCall (frame , callableObject , arguments , keywords , raise , callCallNode , call );
140
+ }
141
+
142
+ @ Specialization (guards = "!isCallable(callableObject)" , replaces = {"doType" , "doPythonClass" })
125
143
protected Object doObjectAndType (VirtualFrame frame , Object callableObject , Object [] arguments , PKeyword [] keywords ,
126
144
@ Shared ("raise" ) @ Cached PRaiseNode raise ,
127
145
@ Shared ("lookupCall" ) @ Cached ("create(__CALL__)" ) LookupInheritedAttributeNode callAttrGetterNode ,
0 commit comments