@@ -366,6 +366,7 @@ public static GetSuperClassNode getUncached() {
366
366
367
367
@ TypeSystemReference (PythonTypes .class )
368
368
@ ImportStatic (NativeMemberNames .class )
369
+ @ GenerateUncached
369
370
public abstract static class GetSubclassesNode extends PNodeWithContext {
370
371
371
372
public abstract Set <PythonAbstractClass > execute (Object obj );
@@ -382,7 +383,6 @@ Set<PythonAbstractClass> doPythonClass(PythonBuiltinClassType obj,
382
383
}
383
384
384
385
@ Specialization
385
- @ TruffleBoundary
386
386
Set <PythonAbstractClass > doNativeClass (PythonNativeClass obj ,
387
387
@ Cached GetTypeMemberNode getTpSubclassesNode ,
388
388
@ Cached ("createClassProfile()" ) ValueProfile profile ) {
@@ -397,21 +397,6 @@ Set<PythonAbstractClass> doNativeClass(PythonNativeClass obj,
397
397
}
398
398
399
399
@ TruffleBoundary
400
- public static Set <PythonAbstractClass > doSlowPath (Object obj ) {
401
- if (obj instanceof PythonManagedClass ) {
402
- return ((PythonManagedClass ) obj ).getSubClasses ();
403
- } else if (obj instanceof PythonBuiltinClassType ) {
404
- return PythonLanguage .getCore ().lookupType ((PythonBuiltinClassType ) obj ).getSubClasses ();
405
- } else if (PGuards .isNativeClass (obj )) {
406
- Object tpSubclasses = GetTypeMemberNode .getUncached ().execute (obj , NativeMemberNames .TP_SUBCLASSES );
407
- if (tpSubclasses instanceof PDict ) {
408
- return wrapDict (tpSubclasses );
409
- }
410
- throw new IllegalStateException ("invalid subclasses dict " + tpSubclasses .getClass ().getName ());
411
- }
412
- throw new IllegalStateException ("unknown type " + obj .getClass ().getName ());
413
- }
414
-
415
400
private static Set <PythonAbstractClass > wrapDict (Object tpSubclasses ) {
416
401
return new Set <PythonAbstractClass >() {
417
402
private final PDict dict = (PDict ) tpSubclasses ;
@@ -492,6 +477,10 @@ public static GetSubclassesNode create() {
492
477
return GetSubclassesNodeGen .create ();
493
478
}
494
479
480
+ public static GetSubclassesNode getUncached () {
481
+ return GetSubclassesNodeGen .getUncached ();
482
+ }
483
+
495
484
}
496
485
497
486
@ GenerateUncached
0 commit comments