|
47 | 47 | import com.oracle.graal.python.builtins.CoreFunctions;
|
48 | 48 | import com.oracle.graal.python.builtins.PythonBuiltinClassType;
|
49 | 49 | import com.oracle.graal.python.builtins.PythonBuiltins;
|
50 |
| -import com.oracle.graal.python.builtins.modules.BuiltinFunctions.IsInstanceNode; |
51 | 50 | import com.oracle.graal.python.builtins.objects.PNone;
|
52 | 51 | import com.oracle.graal.python.builtins.objects.cell.CellBuiltins;
|
53 | 52 | import com.oracle.graal.python.builtins.objects.cell.PCell;
|
@@ -173,7 +172,6 @@ static Object uncached(SuperObject self) {
|
173 | 172 | @GenerateNodeFactory
|
174 | 173 | public abstract static class SuperInitNode extends PythonVarargsBuiltinNode {
|
175 | 174 | @Child private IsSubtypeNode isSubtypeNode;
|
176 |
| - @Child private IsInstanceNode isInstanceNode; |
177 | 175 | @Child private GetClassNode getClassNode;
|
178 | 176 | @Child private LookupAndCallBinaryNode getAttrNode;
|
179 | 177 | @Child private CellBuiltins.GetRefNode getRefNode;
|
@@ -324,14 +322,6 @@ private IsSubtypeNode getIsSubtype() {
|
324 | 322 | return isSubtypeNode;
|
325 | 323 | }
|
326 | 324 |
|
327 |
| - private IsInstanceNode getIsInstance() { |
328 |
| - if (isInstanceNode == null) { |
329 |
| - CompilerDirectives.transferToInterpreterAndInvalidate(); |
330 |
| - isInstanceNode = insert(IsInstanceNode.create()); |
331 |
| - } |
332 |
| - return isInstanceNode; |
333 |
| - } |
334 |
| - |
335 | 325 | private GetClassNode getGetClass() {
|
336 | 326 | if (getClassNode == null) {
|
337 | 327 | CompilerDirectives.transferToInterpreterAndInvalidate();
|
@@ -378,8 +368,9 @@ private Object supercheck(VirtualFrame frame, Object cls, Object object) {
|
378 | 368 | }
|
379 | 369 | }
|
380 | 370 |
|
381 |
| - if (getIsInstance().executeWith(frame, object, cls)) { |
382 |
| - return getGetClass().execute(object); |
| 371 | + Object objectType = getGetClass().execute(object); |
| 372 | + if (getIsSubtype().execute(frame, objectType, cls)) { |
| 373 | + return objectType; |
383 | 374 | } else {
|
384 | 375 | try {
|
385 | 376 | Object classObject = getGetAttr().executeObject(frame, object, SpecialAttributeNames.__CLASS__);
|
|
0 commit comments