@@ -173,16 +173,17 @@ Object doit(Object klass,
173
173
@ Builtin (name = "mro" , minNumOfPositionalArgs = 1 )
174
174
@ GenerateNodeFactory
175
175
public abstract static class MroNode extends PythonBuiltinNode {
176
- @ Specialization
177
- Object doit (LazyPythonClass klass ,
178
- @ Cached ("create()" ) GetMroNode getMroNode ) {
176
+ @ Specialization (guards = "lib.isLazyPythonClass(klass)" )
177
+ Object doit (Object klass ,
178
+ @ Cached ("create()" ) GetMroNode getMroNode ,
179
+ @ SuppressWarnings ("unused" ) @ CachedLibrary (limit = "2" ) PythonObjectLibrary lib ) {
179
180
PythonAbstractClass [] mro = getMroNode .execute (klass );
180
181
return factory ().createList (Arrays .copyOf (mro , mro .length , Object [].class ));
181
182
}
182
183
183
- @ Specialization (guards = "!isClass (object, iLib)" , limit = "3 " )
184
+ @ Specialization (guards = "!lib.isLazyPythonClass (object) " )
184
185
Object doit (Object object ,
185
- @ SuppressWarnings ("unused" ) @ CachedLibrary ("object " ) InteropLibrary iLib ) {
186
+ @ SuppressWarnings ("unused" ) @ CachedLibrary (limit = "2 " ) PythonObjectLibrary lib ) {
186
187
throw raise (TypeError , ErrorMessages .DESCRIPTOR_REQUIRES_OBJ , "mro" , "type" , object );
187
188
}
188
189
}
@@ -235,7 +236,7 @@ protected Object doItUnboxedUser(VirtualFrame frame, @SuppressWarnings("unused")
235
236
@ Cached ("first(arguments)" ) Object cachedSelf ,
236
237
@ SuppressWarnings ("unused" ) @ CachedLibrary (limit = "3" ) InteropLibrary lib ,
237
238
@ CachedLibrary (limit = "3" ) PythonObjectLibrary plib ) {
238
- return op (frame , ( PythonAbstractClass ) cachedSelf , arguments , keywords , false , plib );
239
+ return op (frame , cachedSelf , arguments , keywords , false , plib );
239
240
240
241
}
241
242
@@ -244,7 +245,7 @@ protected Object doItUnboxedBuiltinType(VirtualFrame frame, @SuppressWarnings("u
244
245
@ Cached ("first(arguments)" ) Object cachedSelf ,
245
246
@ SuppressWarnings ("unused" ) @ CachedLibrary (limit = "3" ) InteropLibrary lib ,
246
247
@ CachedLibrary (limit = "3" ) PythonObjectLibrary plib ) {
247
- return op (frame , ( PythonBuiltinClassType ) cachedSelf , arguments , keywords , false , plib );
248
+ return op (frame , cachedSelf , arguments , keywords , false , plib );
248
249
}
249
250
250
251
@ Specialization (replaces = {"doItUnboxedUser" , "doItUnboxedBuiltin" , "doItUnboxedBuiltinType" })
@@ -324,7 +325,7 @@ protected Object doItIndirect1(VirtualFrame frame, PythonNativeObject self, Obje
324
325
return op (frame , PythonNativeClass .cast (self ), arguments , keywords , true , plib );
325
326
}
326
327
327
- private Object op (VirtualFrame frame , LazyPythonClass self , Object [] arguments , PKeyword [] keywords , boolean doCreateArgs , PythonObjectLibrary lib ) {
328
+ private Object op (VirtualFrame frame , Object self , Object [] arguments , PKeyword [] keywords , boolean doCreateArgs , PythonObjectLibrary lib ) {
328
329
Object newMethod = lookupNew .execute (self );
329
330
if (newMethod != PNone .NO_VALUE ) {
330
331
CompilerAsserts .partialEvaluationConstant (doCreateArgs );
@@ -597,8 +598,8 @@ private PythonObject getInstanceClassAttr(VirtualFrame frame, Object instance) {
597
598
return null ;
598
599
}
599
600
600
- @ Specialization
601
- boolean isInstance (VirtualFrame frame , LazyPythonClass cls , Object instance ,
601
+ @ Specialization ( guards = "plib.isLazyPythonClass(cls)" )
602
+ boolean isInstance (VirtualFrame frame , Object cls , Object instance ,
602
603
@ Cached ("create()" ) IsSubtypeNode isSubtypeNode ,
603
604
@ CachedLibrary (limit = "4" ) PythonObjectLibrary plib ) {
604
605
if (instance instanceof PythonObject && isSubtypeNode .execute (frame , plib .getLazyPythonClass (instance ), cls )) {
0 commit comments