51
51
public final class BuiltinFunctionRootNode extends PRootNode {
52
52
private final Signature signature ;
53
53
private final Builtin builtin ;
54
+ private final String name ;
54
55
private final NodeFactory <? extends PythonBuiltinBaseNode > factory ;
55
56
private final boolean declaresExplicitSelf ;
56
57
@@ -145,8 +146,10 @@ public Object execute(VirtualFrame frame) {
145
146
146
147
public BuiltinFunctionRootNode (PythonLanguage language , Builtin builtin , NodeFactory <? extends PythonBuiltinBaseNode > factory , boolean declaresExplicitSelf ) {
147
148
super (language );
149
+ CompilerAsserts .neverPartOfCompilation ();
148
150
this .signature = createSignature (factory , builtin , declaresExplicitSelf );
149
151
this .builtin = builtin ;
152
+ this .name = builtin .name ();
150
153
this .factory = factory ;
151
154
this .declaresExplicitSelf = declaresExplicitSelf ;
152
155
if (builtin .alwaysNeedsCallerFrame ()) {
@@ -207,6 +210,7 @@ private static Signature createSignature(NodeFactory<? extends PythonBuiltinBase
207
210
*/
208
211
private static ReadArgumentNode [] createArgumentsList (Builtin builtin , boolean needsExplicitSelf ) {
209
212
ArrayList <ReadArgumentNode > args = new ArrayList <>();
213
+
210
214
String [] parameterNames = builtin .parameterNames ();
211
215
int maxNumPosArgs = Math .max (builtin .minNumOfPositionalArgs (), parameterNames .length );
212
216
@@ -305,7 +309,7 @@ public Object execute(VirtualFrame frame) {
305
309
}
306
310
307
311
public String getFunctionName () {
308
- return builtin . name () ;
312
+ return name ;
309
313
}
310
314
311
315
public NodeFactory <? extends PythonBuiltinBaseNode > getFactory () {
@@ -315,12 +319,12 @@ public NodeFactory<? extends PythonBuiltinBaseNode> getFactory() {
315
319
@ Override
316
320
public String toString () {
317
321
CompilerAsserts .neverPartOfCompilation ();
318
- return "<builtin function " + builtin . name () + " at " + Integer .toHexString (hashCode ()) + ">" ;
322
+ return "<builtin function " + name + " at " + Integer .toHexString (hashCode ()) + ">" ;
319
323
}
320
324
321
325
@ Override
322
326
public String getName () {
323
- return builtin . name () ;
327
+ return name ;
324
328
}
325
329
326
330
public boolean declaresExplicitSelf () {
0 commit comments