@@ -115,9 +115,10 @@ protected PyCFunctionWrapper(RootCallTarget callTarget, Signature signature) {
115
115
assert signature != null ;
116
116
this .callTarget = callTarget ;
117
117
this .signature = signature ;
118
- this .callTargetName = PythonUtils .toTruffleStringUncached (callTarget .getRootNode ().getName ());
118
+ String ctName = callTarget .getRootNode ().getName ();
119
+ this .callTargetName = PythonUtils .toTruffleStringUncached (ctName );
119
120
this .builtinMethodDescriptor = null ;
120
- this .timing = CApiTiming .create (false , this );
121
+ this .timing = CApiTiming .create (false , ctName );
121
122
this .skipSelf = false ;
122
123
}
123
124
@@ -127,7 +128,7 @@ protected PyCFunctionWrapper(BuiltinMethodDescriptor builtinMethodDescriptor) {
127
128
this .signature = null ;
128
129
this .callTargetName = null ;
129
130
this .builtinMethodDescriptor = builtinMethodDescriptor ;
130
- this .timing = CApiTiming .create (false , this );
131
+ this .timing = CApiTiming .create (false , builtinMethodDescriptor . getName () );
131
132
this .skipSelf = builtinMethodDescriptor .getEnclosingType () == null && !builtinMethodDescriptor .getBuiltinAnnotation ().declaresExplicitSelf ();
132
133
}
133
134
@@ -180,12 +181,16 @@ protected long asPointer() {
180
181
181
182
protected abstract String getFlagsRepr ();
182
183
184
+ @ TruffleBoundary
185
+ private static String toString (Object name , String flagsRepr , long pointer ) {
186
+ String ptr = pointer != 0 ? " at 0x" + Long .toHexString (pointer ) : "" ;
187
+ return String .format ("PyCFunction(%s, %s)%s" , name , flagsRepr , ptr );
188
+ }
189
+
183
190
@ Override
184
191
@ TruffleBoundary
185
192
public String toString () {
186
- Object name = builtinMethodDescriptor != null ? builtinMethodDescriptor .getName () : callTargetName ;
187
- String ptr = pointer != 0 ? " at 0x" + Long .toHexString (pointer ) : "" ;
188
- return String .format ("PyCFunction(%s, %s)%s" , name , getFlagsRepr (), ptr );
193
+ return PyCFunctionWrapper .toString (builtinMethodDescriptor != null ? builtinMethodDescriptor .getName () : callTargetName , getFlagsRepr (), pointer );
189
194
}
190
195
191
196
/**
0 commit comments