File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call/special Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 47
47
import com .oracle .graal .python .builtins .PythonBuiltinClassType ;
48
48
import com .oracle .graal .python .builtins .objects .PNone ;
49
49
import com .oracle .graal .python .builtins .objects .PNotImplemented ;
50
+ import com .oracle .graal .python .builtins .objects .function .BuiltinMethodDescriptor .BinaryBuiltinDescriptor ;
50
51
import com .oracle .graal .python .builtins .objects .function .PBuiltinFunction ;
51
52
import com .oracle .graal .python .builtins .objects .method .PBuiltinMethod ;
52
53
import com .oracle .graal .python .builtins .objects .type .PythonBuiltinClass ;
54
+ import com .oracle .graal .python .builtins .objects .type .SpecialMethodSlot ;
53
55
import com .oracle .graal .python .builtins .objects .type .TypeNodes ;
54
56
import com .oracle .graal .python .builtins .objects .type .TypeNodes .GetNameNode ;
55
57
import com .oracle .graal .python .nodes .ErrorMessages ;
@@ -174,6 +176,15 @@ private CallBinaryMethodNode ensureReverseDispatch() {
174
176
}
175
177
176
178
protected final PythonBinaryBuiltinNode getBinaryBuiltin (PythonBuiltinClassType clazz ) {
179
+ if (SpecialMethodSlot .canBeSpecial (name )) {
180
+ SpecialMethodSlot slot = SpecialMethodSlot .findSpecialSlot (name );
181
+ if (slot != null ) {
182
+ Object attribute = slot .getValue (clazz );
183
+ if (attribute instanceof BinaryBuiltinDescriptor ) {
184
+ return ((BinaryBuiltinDescriptor ) attribute ).createNode ();
185
+ }
186
+ }
187
+ }
177
188
Object attribute = LookupAttributeInMRONode .Dynamic .getUncached ().execute (clazz , name );
178
189
if (attribute instanceof PBuiltinFunction ) {
179
190
PBuiltinFunction builtinFunction = (PBuiltinFunction ) attribute ;
You can’t perform that action at this time.
0 commit comments