101101import com .oracle .graal .python .builtins .objects .dict .PDict ;
102102import com .oracle .graal .python .builtins .objects .exception .PBaseException ;
103103import com .oracle .graal .python .builtins .objects .frame .PFrame ;
104- import com .oracle .graal .python .builtins .objects .function .Arity ;
104+ import com .oracle .graal .python .builtins .objects .function .Signature ;
105105import com .oracle .graal .python .builtins .objects .function .PArguments ;
106106import com .oracle .graal .python .builtins .objects .function .PBuiltinFunction ;
107107import com .oracle .graal .python .builtins .objects .function .PFunction ;
@@ -330,37 +330,37 @@ Object runWithoutCWrapper(PBuiltinFunction descriptor, Object self) {
330330 @ GenerateNodeFactory
331331 @ TypeSystemReference (PythonArithmeticTypes .class )
332332 abstract static class CreateFunctionNode extends PythonBuiltinNode {
333- private static final Arity ARITY = Arity .createVarArgsAndKwArgsOnly ();
333+ private static final Signature SIGNATURE = Signature .createVarArgsAndKwArgsOnly ();
334334
335335 @ Specialization (guards = "isNoValue(cwrapper)" )
336336 @ TruffleBoundary
337337 PBuiltinFunction runWithoutCWrapper (String name , TruffleObject callable , @ SuppressWarnings ("unused" ) PNone cwrapper , LazyPythonClass type ) {
338338 CompilerDirectives .transferToInterpreter ();
339- RootCallTarget callTarget = Truffle .getRuntime ().createCallTarget (new ExternalFunctionNode (getRootNode ().getLanguage (PythonLanguage .class ), name , null , callable , ARITY ));
339+ RootCallTarget callTarget = Truffle .getRuntime ().createCallTarget (new ExternalFunctionNode (getRootNode ().getLanguage (PythonLanguage .class ), name , null , callable , SIGNATURE ));
340340 return factory ().createBuiltinFunction (name , type , 0 , callTarget );
341341 }
342342
343343 @ Specialization (guards = {"isNoValue(cwrapper)" , "isNoValue(type)" })
344344 @ TruffleBoundary
345345 PBuiltinFunction runWithoutCWrapper (String name , TruffleObject callable , @ SuppressWarnings ("unused" ) PNone cwrapper , @ SuppressWarnings ("unused" ) PNone type ) {
346346 CompilerDirectives .transferToInterpreter ();
347- RootCallTarget callTarget = Truffle .getRuntime ().createCallTarget (new ExternalFunctionNode (getRootNode ().getLanguage (PythonLanguage .class ), name , null , callable , ARITY ));
347+ RootCallTarget callTarget = Truffle .getRuntime ().createCallTarget (new ExternalFunctionNode (getRootNode ().getLanguage (PythonLanguage .class ), name , null , callable , SIGNATURE ));
348348 return factory ().createBuiltinFunction (name , null , 0 , callTarget );
349349 }
350350
351351 @ Specialization (guards = {"!isNoValue(cwrapper)" , "isNoValue(type)" })
352352 @ TruffleBoundary
353353 PBuiltinFunction runWithoutCWrapper (String name , TruffleObject callable , TruffleObject cwrapper , @ SuppressWarnings ("unused" ) PNone type ) {
354354 CompilerDirectives .transferToInterpreter ();
355- RootCallTarget callTarget = Truffle .getRuntime ().createCallTarget (new ExternalFunctionNode (getRootNode ().getLanguage (PythonLanguage .class ), name , cwrapper , callable , ARITY ));
355+ RootCallTarget callTarget = Truffle .getRuntime ().createCallTarget (new ExternalFunctionNode (getRootNode ().getLanguage (PythonLanguage .class ), name , cwrapper , callable , SIGNATURE ));
356356 return factory ().createBuiltinFunction (name , null , 0 , callTarget );
357357 }
358358
359359 @ Specialization (guards = "!isNoValue(cwrapper)" )
360360 @ TruffleBoundary
361361 PBuiltinFunction run (String name , TruffleObject callable , TruffleObject cwrapper , LazyPythonClass type ) {
362362 CompilerDirectives .transferToInterpreter ();
363- RootCallTarget callTarget = Truffle .getRuntime ().createCallTarget (new ExternalFunctionNode (getRootNode ().getLanguage (PythonLanguage .class ), name , cwrapper , callable , ARITY ));
363+ RootCallTarget callTarget = Truffle .getRuntime ().createCallTarget (new ExternalFunctionNode (getRootNode ().getLanguage (PythonLanguage .class ), name , cwrapper , callable , SIGNATURE ));
364364 return factory ().createBuiltinFunction (name , type , 0 , callTarget );
365365 }
366366 }
@@ -669,7 +669,7 @@ public static CheckFunctionResultNode create() {
669669 }
670670
671671 static class ExternalFunctionNode extends PRootNode {
672- private final Arity arity ;
672+ private final Signature signature ;
673673 private final TruffleObject cwrapper ;
674674 private final TruffleObject callable ;
675675 private final String name ;
@@ -680,9 +680,9 @@ static class ExternalFunctionNode extends PRootNode {
680680 @ Child private CheckFunctionResultNode checkResultNode = CheckFunctionResultNode .create ();
681681 @ Child private PForeignToPTypeNode fromForeign = PForeignToPTypeNode .create ();
682682
683- ExternalFunctionNode (PythonLanguage lang , String name , TruffleObject cwrapper , TruffleObject callable , Arity arity ) {
683+ ExternalFunctionNode (PythonLanguage lang , String name , TruffleObject cwrapper , TruffleObject callable , Signature signature ) {
684684 super (lang );
685- this .arity = arity ;
685+ this .signature = signature ;
686686 this .name = name ;
687687 this .cwrapper = cwrapper ;
688688 this .callable = callable ;
@@ -758,8 +758,8 @@ public boolean isCloningAllowed() {
758758 }
759759
760760 @ Override
761- public Arity getArity () {
762- return arity ;
761+ public Signature getSignature () {
762+ return signature ;
763763 }
764764 }
765765
@@ -1537,7 +1537,7 @@ public String toString() {
15371537 }
15381538
15391539 static class MethKeywordsRoot extends MethodDescriptorRoot {
1540- private static final Arity ARITY = new Arity (true , 1 , false , new String []{"self" }, new String [0 ]);
1540+ private static final Signature SIGNATURE = new Signature (true , 1 , false , new String []{"self" }, new String [0 ]);
15411541
15421542 @ Child private ReadVarArgsNode readVarargsNode ;
15431543 @ Child private ReadVarKeywordsNode readKwargsNode ;
@@ -1559,13 +1559,13 @@ public Object execute(VirtualFrame frame) {
15591559 }
15601560
15611561 @ Override
1562- public Arity getArity () {
1563- return ARITY ;
1562+ public Signature getSignature () {
1563+ return SIGNATURE ;
15641564 }
15651565 }
15661566
15671567 static class MethVarargsRoot extends MethodDescriptorRoot {
1568- private static final Arity ARITY = new Arity (false , 1 , false , new String []{"self" }, new String [0 ]);
1568+ private static final Signature SIGNATURE = new Signature (false , 1 , false , new String []{"self" }, new String [0 ]);
15691569
15701570 @ Child private ReadVarArgsNode readVarargsNode ;
15711571
@@ -1584,13 +1584,13 @@ public Object execute(VirtualFrame frame) {
15841584 }
15851585
15861586 @ Override
1587- public Arity getArity () {
1588- return ARITY ;
1587+ public Signature getSignature () {
1588+ return SIGNATURE ;
15891589 }
15901590 }
15911591
15921592 static class MethNoargsRoot extends MethodDescriptorRoot {
1593- private static final Arity ARITY = new Arity (false , -1 , false , new String []{"self" }, new String [0 ]);
1593+ private static final Signature SIGNATURE = new Signature (false , -1 , false , new String []{"self" }, new String [0 ]);
15941594
15951595 protected MethNoargsRoot (PythonLanguage language , PythonObjectFactory factory , CallTarget callTarget ) {
15961596 super (language , factory , callTarget );
@@ -1605,13 +1605,13 @@ public Object execute(VirtualFrame frame) {
16051605 }
16061606
16071607 @ Override
1608- public Arity getArity () {
1609- return ARITY ;
1608+ public Signature getSignature () {
1609+ return SIGNATURE ;
16101610 }
16111611 }
16121612
16131613 static class MethORoot extends MethodDescriptorRoot {
1614- private static final Arity ARITY = new Arity (false , -1 , false , new String []{"self" , "arg" }, new String [0 ]);
1614+ private static final Signature SIGNATURE = new Signature (false , -1 , false , new String []{"self" , "arg" }, new String [0 ]);
16151615
16161616 @ Child private ReadIndexedArgumentNode readArgNode ;
16171617
@@ -1630,13 +1630,13 @@ public Object execute(VirtualFrame frame) {
16301630 }
16311631
16321632 @ Override
1633- public Arity getArity () {
1634- return ARITY ;
1633+ public Signature getSignature () {
1634+ return SIGNATURE ;
16351635 }
16361636 }
16371637
16381638 static class MethFastcallRoot extends MethodDescriptorRoot {
1639- private static final Arity ARITY = new Arity (true , 1 , false , new String []{"self" }, new String [0 ]);
1639+ private static final Signature SIGNATURE = new Signature (true , 1 , false , new String []{"self" }, new String [0 ]);
16401640
16411641 @ Child private ReadVarArgsNode readVarargsNode ;
16421642 @ Child private ReadVarKeywordsNode readKwargsNode ;
@@ -1658,8 +1658,8 @@ public Object execute(VirtualFrame frame) {
16581658 }
16591659
16601660 @ Override
1661- public Arity getArity () {
1662- return ARITY ;
1661+ public Signature getSignature () {
1662+ return SIGNATURE ;
16631663 }
16641664 }
16651665
@@ -1943,9 +1943,9 @@ public boolean visit(Node node) {
19431943 });
19441944
19451945 RootNode rootNode = null ;
1946- Arity funcArity = func .getArity ();
1947- if (funcArity .takesPositionalOnly ()) {
1948- switch (funcArity .getMaxNumOfPositionalArgs ()) {
1946+ Signature funcSignature = func .getSignature ();
1947+ if (funcSignature .takesPositionalOnly ()) {
1948+ switch (funcSignature .getMaxNumOfPositionalArgs ()) {
19491949 case 1 :
19501950 rootNode = new BuiltinFunctionRootNode (getRootNode ().getLanguage (PythonLanguage .class ), unaryBuiltin ,
19511951 new MayRaiseNodeFactory <PythonUnaryBuiltinNode >(MayRaiseUnaryNodeGen .create (func , errorResult )),
0 commit comments