5151public final class BuiltinFunctionRootNode extends PRootNode {
5252 private final Signature signature ;
5353 private final Builtin builtin ;
54+ private final String name ;
5455 private final NodeFactory <? extends PythonBuiltinBaseNode > factory ;
5556 private final boolean declaresExplicitSelf ;
5657
@@ -145,8 +146,10 @@ public Object execute(VirtualFrame frame) {
145146
146147 public BuiltinFunctionRootNode (PythonLanguage language , Builtin builtin , NodeFactory <? extends PythonBuiltinBaseNode > factory , boolean declaresExplicitSelf ) {
147148 super (language );
149+ CompilerAsserts .neverPartOfCompilation ();
148150 this .signature = createSignature (factory , builtin , declaresExplicitSelf );
149151 this .builtin = builtin ;
152+ this .name = builtin .name ();
150153 this .factory = factory ;
151154 this .declaresExplicitSelf = declaresExplicitSelf ;
152155 if (builtin .alwaysNeedsCallerFrame ()) {
@@ -207,6 +210,7 @@ private static Signature createSignature(NodeFactory<? extends PythonBuiltinBase
207210 */
208211 private static ReadArgumentNode [] createArgumentsList (Builtin builtin , boolean needsExplicitSelf ) {
209212 ArrayList <ReadArgumentNode > args = new ArrayList <>();
213+
210214 String [] parameterNames = builtin .parameterNames ();
211215 int maxNumPosArgs = Math .max (builtin .minNumOfPositionalArgs (), parameterNames .length );
212216
@@ -305,7 +309,7 @@ public Object execute(VirtualFrame frame) {
305309 }
306310
307311 public String getFunctionName () {
308- return builtin . name () ;
312+ return name ;
309313 }
310314
311315 public NodeFactory <? extends PythonBuiltinBaseNode > getFactory () {
@@ -315,12 +319,12 @@ public NodeFactory<? extends PythonBuiltinBaseNode> getFactory() {
315319 @ Override
316320 public String toString () {
317321 CompilerAsserts .neverPartOfCompilation ();
318- return "<builtin function " + builtin . name () + " at " + Integer .toHexString (hashCode ()) + ">" ;
322+ return "<builtin function " + name + " at " + Integer .toHexString (hashCode ()) + ">" ;
319323 }
320324
321325 @ Override
322326 public String getName () {
323- return builtin . name () ;
327+ return name ;
324328 }
325329
326330 public boolean declaresExplicitSelf () {
0 commit comments