|
32 | 32 | import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary;
|
33 | 33 | import com.oracle.graal.python.nodes.ErrorMessages;
|
34 | 34 | import com.oracle.graal.python.nodes.classes.IsSubtypeNode;
|
35 |
| -import com.oracle.truffle.api.Assumption; |
36 | 35 | import com.oracle.truffle.api.CompilerAsserts;
|
37 | 36 | import com.oracle.truffle.api.dsl.Cached;
|
38 |
| -import com.oracle.truffle.api.dsl.Specialization; |
39 | 37 | import com.oracle.truffle.api.interop.InteropLibrary;
|
40 | 38 | import com.oracle.truffle.api.library.CachedLibrary;
|
41 | 39 | import com.oracle.truffle.api.library.ExportLibrary;
|
@@ -83,29 +81,11 @@ boolean isMetaObject() {
|
83 | 81 | }
|
84 | 82 |
|
85 | 83 | @ExportMessage
|
86 |
| - static class IsMetaInstance { |
87 |
| - |
88 |
| - protected static boolean isInstance(PythonBuiltinClass receiver, Object instance, PythonObjectLibrary plib, IsSubtypeNode isSubtype) { |
89 |
| - return isSubtype.execute(plib.getLazyPythonClass(instance), receiver); |
90 |
| - } |
91 |
| - |
92 |
| - @SuppressWarnings("unused") |
93 |
| - @Specialization(guards = "instance == instanceCached", assumptions = "singleContextAssumption", limit = "3") |
94 |
| - static boolean isMetaInstanceCached(PythonBuiltinClass receiver, Object instance, |
95 |
| - @CachedLibrary("instance") PythonObjectLibrary plib, |
96 |
| - @Cached IsSubtypeNode isSubtype, |
97 |
| - @Cached("instance") Object instanceCached, |
98 |
| - @Cached("isInstance(receiver, instanceCached, plib, isSubtype)") boolean isInstance, |
99 |
| - @SuppressWarnings("unused") @Cached(value = "getSingleContextAssumption()", allowUncached = true) Assumption singleContextAssumption) { |
100 |
| - return isInstance; |
101 |
| - } |
102 |
| - |
103 |
| - @Specialization(replaces = "isMetaInstanceCached") |
104 |
| - static boolean isMetaInstance(PythonBuiltinClass receiver, Object instance, |
105 |
| - @CachedLibrary(limit = "3") PythonObjectLibrary plib, |
106 |
| - @Cached IsSubtypeNode isSubtype) { |
107 |
| - return isInstance(receiver, instance, plib, isSubtype); |
108 |
| - } |
| 84 | + @SuppressWarnings("static-method") |
| 85 | + boolean isMetaInstance(Object instance, |
| 86 | + @CachedLibrary(limit = "3") PythonObjectLibrary plib, |
| 87 | + @Cached IsSubtypeNode isSubtype) { |
| 88 | + return isSubtype.execute(plib.getLazyPythonClass(instance), this); |
109 | 89 | }
|
110 | 90 |
|
111 | 91 | @ExportMessage
|
|
0 commit comments