|
96 | 96 | import com.oracle.graal.python.builtins.objects.type.PythonBuiltinClass;
|
97 | 97 | import com.oracle.graal.python.builtins.objects.type.PythonClass;
|
98 | 98 | import com.oracle.graal.python.builtins.objects.type.PythonManagedClass;
|
| 99 | +import com.oracle.graal.python.builtins.objects.type.SpecialMethodSlot; |
99 | 100 | import com.oracle.graal.python.builtins.objects.type.TypeNodes;
|
100 | 101 | import com.oracle.graal.python.builtins.objects.type.TypeNodes.GetMroNode;
|
101 | 102 | import com.oracle.graal.python.lib.PyLongCheckExactNode;
|
|
107 | 108 | import com.oracle.graal.python.nodes.PRaiseNode;
|
108 | 109 | import com.oracle.graal.python.nodes.SpecialMethodNames;
|
109 | 110 | import com.oracle.graal.python.nodes.attributes.LookupAttributeInMRONode;
|
| 111 | +import com.oracle.graal.python.nodes.attributes.LookupCallableSlotInMRONode; |
110 | 112 | import com.oracle.graal.python.nodes.attributes.LookupInheritedAttributeNode;
|
111 | 113 | import com.oracle.graal.python.nodes.attributes.ReadAttributeFromObjectNode;
|
112 | 114 | import com.oracle.graal.python.nodes.call.CallNode;
|
@@ -1331,17 +1333,19 @@ public static IsImmutable getUncached() {
|
1331 | 1333 | * uncached version.
|
1332 | 1334 | */
|
1333 | 1335 | @GenerateUncached
|
| 1336 | + @ImportStatic(SpecialMethodSlot.class) |
1334 | 1337 | public abstract static class PInteropSubscriptNode extends Node {
|
1335 | 1338 |
|
1336 | 1339 | public abstract Object execute(Object primary, Object index);
|
1337 | 1340 |
|
1338 | 1341 | @Specialization
|
1339 |
| - Object doSpecialObject(Object primary, Object index, |
1340 |
| - @Cached LookupInheritedAttributeNode.Dynamic lookupGetItemNode, |
| 1342 | + static Object doSpecialObject(Object primary, Object index, |
| 1343 | + @Cached GetClassNode getClassNode, |
| 1344 | + @Cached(parameters = "GetItem") LookupCallableSlotInMRONode lookupInMRONode, |
1341 | 1345 | @Cached CallBinaryMethodNode callGetItemNode,
|
1342 | 1346 | @Cached PRaiseNode raiseNode,
|
1343 | 1347 | @Cached ConditionProfile profile) {
|
1344 |
| - Object attrGetItem = lookupGetItemNode.execute(primary, __GETITEM__); |
| 1348 | + Object attrGetItem = lookupInMRONode.execute(getClassNode.execute(primary)); |
1345 | 1349 | if (profile.profile(attrGetItem == PNone.NO_VALUE)) {
|
1346 | 1350 | throw raiseNode.raise(PythonBuiltinClassType.TypeError, ErrorMessages.OBJ_NOT_SUBSCRIPTABLE, primary);
|
1347 | 1351 | }
|
|
0 commit comments