58
58
import static com .oracle .graal .python .builtins .objects .cext .structs .CFields .PyModuleDef__m_slots ;
59
59
import static com .oracle .graal .python .builtins .objects .cext .structs .CFields .PyObject__ob_type ;
60
60
import static com .oracle .graal .python .builtins .objects .cext .structs .CFields .PyTypeObject__tp_as_buffer ;
61
+ import static com .oracle .graal .python .nodes .HiddenAttr .METHOD_DEF_PTR ;
61
62
import static com .oracle .graal .python .nodes .SpecialMethodNames .T___COMPLEX__ ;
62
63
import static com .oracle .graal .python .nodes .StringLiterals .J_NFI_LANGUAGE ;
63
64
import static com .oracle .graal .python .runtime .exception .PythonErrorType .SystemError ;
@@ -1825,12 +1826,13 @@ public abstract static class CreateMethodNode extends PNodeWithContext {
1825
1826
public abstract PBuiltinFunction execute (Node inliningTarget , Object legacyMethodDef , int element );
1826
1827
1827
1828
@ Specialization
1828
- static PBuiltinFunction doIt (Object methodDef , int element ,
1829
+ static PBuiltinFunction doIt (Node inliningTarget , Object methodDef , int element ,
1829
1830
@ CachedLibrary (limit = "2" ) InteropLibrary resultLib ,
1830
1831
@ Cached (inline = false ) CStructAccess .ReadPointerNode readPointerNode ,
1831
1832
@ Cached (inline = false ) CStructAccess .ReadI32Node readI32Node ,
1832
1833
@ Cached (inline = false ) FromCharPointerNode fromCharPointerNode ,
1833
1834
@ Cached (inline = false ) PythonObjectFactory factory ,
1835
+ @ Cached HiddenAttr .WriteNode writeHiddenAttrNode ,
1834
1836
@ Cached (inline = false ) WriteAttributeToDynamicObjectNode writeAttributeToDynamicObjectNode ) {
1835
1837
Object methodNamePtr = readPointerNode .readStructArrayElement (methodDef , element , PyMethodDef__ml_name );
1836
1838
if (resultLib .isNull (methodNamePtr ) || (methodNamePtr instanceof Long && ((long ) methodNamePtr ) == 0 )) {
@@ -1853,6 +1855,7 @@ static PBuiltinFunction doIt(Object methodDef, int element,
1853
1855
mlMethObj = CExtContext .ensureExecutable (mlMethObj , sig );
1854
1856
PKeyword [] kwDefaults = ExternalFunctionNodes .createKwDefaults (mlMethObj );
1855
1857
PBuiltinFunction function = factory .createBuiltinFunction (methodName , null , PythonUtils .EMPTY_OBJECT_ARRAY , kwDefaults , flags , callTarget );
1858
+ writeHiddenAttrNode .execute (inliningTarget , function , METHOD_DEF_PTR , methodDef );
1856
1859
1857
1860
// write doc string; we need to directly write to the storage otherwise it is disallowed
1858
1861
// writing to builtin types.
0 commit comments