@@ -2042,10 +2042,11 @@ long doGeneric(Object n) {
2042
2042
2043
2043
@ Builtin (name = "PyType_IsSubtype" , fixedNumOfPositionalArgs = 2 )
2044
2044
@ GenerateNodeFactory
2045
- abstract static class PyType_IsSubtype extends PythonBuiltinNode {
2045
+ abstract static class PyType_IsSubtype extends PythonBinaryBuiltinNode {
2046
2046
2047
2047
@ Child private IsSubtypeNode isSubtypeNode = IsSubtypeNode .create ();
2048
2048
@ Child private CExtNodes .AsPythonObjectNode asPythonObjectNode = CExtNodes .AsPythonObjectNode .create ();
2049
+ @ Child private CExtNodes .ToJavaNode toJavaNode ;
2049
2050
2050
2051
@ Specialization (guards = {"a == cachedA" , "b == cachedB" })
2051
2052
int doCached (@ SuppressWarnings ("unused" ) PythonNativeWrapper a , @ SuppressWarnings ("unused" ) PythonNativeWrapper b ,
@@ -2056,10 +2057,19 @@ int doCached(@SuppressWarnings("unused") PythonNativeWrapper a, @SuppressWarning
2056
2057
}
2057
2058
2058
2059
@ Specialization (replaces = "doCached" )
2059
- int doGeneric (PythonNativeWrapper a , PythonNativeWrapper b ) {
2060
+ int doUncached (PythonNativeWrapper a , PythonNativeWrapper b ) {
2060
2061
return isNativeSubtype (a , b );
2061
2062
}
2062
2063
2064
+ @ Fallback
2065
+ int doGeneric (Object a , Object b ) {
2066
+ if (toJavaNode == null ) {
2067
+ CompilerDirectives .transferToInterpreterAndInvalidate ();
2068
+ toJavaNode = insert (CExtNodes .ToJavaNode .create ());
2069
+ }
2070
+ return isSubtypeNode .execute (toJavaNode .execute (a ), toJavaNode .execute (b )) ? 1 : 0 ;
2071
+ }
2072
+
2063
2073
protected int isNativeSubtype (PythonNativeWrapper a , PythonNativeWrapper b ) {
2064
2074
assert a instanceof PythonClassNativeWrapper || a instanceof PythonClassInitNativeWrapper ;
2065
2075
assert b instanceof PythonClassNativeWrapper || b instanceof PythonClassInitNativeWrapper ;
0 commit comments