@@ -1593,7 +1593,7 @@ Object doNativeObjectIndirect(VirtualFrame frame, PythonManagedClass self, Objec
1593
1593
throw getReportAbstractClassNode ().execute (frame , self );
1594
1594
}
1595
1595
Object nativeBaseClass = findFirstNativeBaseClass (getMroNode .execute (self ));
1596
- return callNativeGenericNewNode (nativeBaseClass , varargs , kwargs );
1596
+ return callNativeGenericNewNode (self , nativeBaseClass , varargs , kwargs );
1597
1597
}
1598
1598
1599
1599
@ Specialization (guards = "isNativeClass(self)" )
@@ -1603,7 +1603,7 @@ Object doNativeObjectDirect(VirtualFrame frame, Object self, Object[] varargs, P
1603
1603
if ((getTypeFlagsNode .execute (self ) & TypeFlags .IS_ABSTRACT ) != 0 ) {
1604
1604
throw getReportAbstractClassNode ().execute (frame , self );
1605
1605
}
1606
- return callNativeGenericNewNode (self , varargs , kwargs );
1606
+ return callNativeGenericNewNode (self , self , varargs , kwargs );
1607
1607
}
1608
1608
1609
1609
@ SuppressWarnings ("unused" )
@@ -1622,7 +1622,7 @@ private static Object findFirstNativeBaseClass(PythonAbstractClass[] methodResol
1622
1622
throw new IllegalStateException ("class needs native allocation but has not native base class" );
1623
1623
}
1624
1624
1625
- private Object callNativeGenericNewNode (Object self , Object [] varargs , PKeyword [] kwargs ) {
1625
+ private Object callNativeGenericNewNode (Object type , Object nativeBase , Object [] varargs , PKeyword [] kwargs ) {
1626
1626
if (callCapiFunction == null ) {
1627
1627
CompilerDirectives .transferToInterpreterAndInvalidate ();
1628
1628
callCapiFunction = insert (PCallCapiFunction .create ());
@@ -1643,7 +1643,7 @@ private Object callNativeGenericNewNode(Object self, Object[] varargs, PKeyword[
1643
1643
PTuple targs = factory ().createTuple (varargs );
1644
1644
PDict dkwargs = factory ().createDict (kwarr );
1645
1645
return asPythonObjectNode .execute (
1646
- callCapiFunction .call (FUN_PY_OBJECT_NEW , toSulongNodes [0 ].execute (self ), toSulongNodes [1 ].execute (self ), toSulongNodes [2 ].execute (targs ),
1646
+ callCapiFunction .call (FUN_PY_OBJECT_NEW , toSulongNodes [0 ].execute (type ), toSulongNodes [1 ].execute (nativeBase ), toSulongNodes [2 ].execute (targs ),
1647
1647
toSulongNodes [3 ].execute (dkwargs )));
1648
1648
}
1649
1649
0 commit comments