40
40
*/
41
41
package com .oracle .graal .python .nodes .classes ;
42
42
43
+ import com .oracle .graal .python .builtins .objects .type .LazyPythonClass ;
43
44
import com .oracle .graal .python .builtins .objects .type .PythonAbstractClass ;
44
45
import com .oracle .graal .python .builtins .objects .type .TypeNodes .GetMroStorageNode ;
45
46
import com .oracle .graal .python .builtins .objects .type .TypeNodes .IsSameTypeNode ;
@@ -114,8 +115,8 @@ boolean isSubtypeOfConstantType(@SuppressWarnings("unused") PythonAbstractClass
114
115
assumptions = "mro.getLookupStableAssumption()" //
115
116
)
116
117
@ ExplodeLoop
117
- boolean isSubtypeOfVariableType (@ SuppressWarnings ("unused" ) PythonAbstractClass derived , PythonAbstractClass cls ,
118
- @ Cached ("derived" ) @ SuppressWarnings ("unused" ) PythonAbstractClass cachedDerived ,
118
+ boolean isSubtypeOfVariableType (@ SuppressWarnings ("unused" ) LazyPythonClass derived , LazyPythonClass cls ,
119
+ @ Cached ("derived" ) @ SuppressWarnings ("unused" ) LazyPythonClass cachedDerived ,
119
120
@ Cached ("getMro(cachedDerived)" ) MroSequenceStorage mro ) {
120
121
for (PythonAbstractClass n : mro .getInternalClassArray ()) {
121
122
if (isSameType (n , cls )) {
@@ -126,7 +127,7 @@ boolean isSubtypeOfVariableType(@SuppressWarnings("unused") PythonAbstractClass
126
127
}
127
128
128
129
@ Specialization (replaces = {"isSubtypeOfConstantType" , "isSubtypeOfVariableType" })
129
- boolean issubTypeGeneric (PythonAbstractClass derived , PythonAbstractClass cls ) {
130
+ boolean issubTypeGeneric (LazyPythonClass derived , LazyPythonClass cls ) {
130
131
for (PythonAbstractClass n : getMro (derived ).getInternalClassArray ()) {
131
132
if (isSameType (n , cls )) {
132
133
return true ;
@@ -153,15 +154,15 @@ public boolean isSubclass(Object derived, Object cls) {
153
154
return abstractIsSubclassNode .execute (derived , cls );
154
155
}
155
156
156
- protected MroSequenceStorage getMro (PythonAbstractClass clazz ) {
157
+ protected MroSequenceStorage getMro (LazyPythonClass clazz ) {
157
158
if (getMroNode == null ) {
158
159
CompilerDirectives .transferToInterpreterAndInvalidate ();
159
160
getMroNode = insert (GetMroStorageNode .create ());
160
161
}
161
162
return getMroNode .execute (clazz );
162
163
}
163
164
164
- private boolean isSameType (PythonAbstractClass left , PythonAbstractClass right ) {
165
+ private boolean isSameType (LazyPythonClass left , LazyPythonClass right ) {
165
166
if (isSameTypeNode == null ) {
166
167
CompilerDirectives .transferToInterpreterAndInvalidate ();
167
168
isSameTypeNode = insert (IsSameTypeNode .create ());
0 commit comments