140
140
import com .oracle .graal .python .nodes .datamodel .IsSequenceNode ;
141
141
import com .oracle .graal .python .nodes .function .PythonBuiltinBaseNode ;
142
142
import com .oracle .graal .python .nodes .function .PythonBuiltinNode ;
143
+ import com .oracle .graal .python .nodes .function .builtins .PythonBinaryBuiltinNode ;
143
144
import com .oracle .graal .python .nodes .function .builtins .PythonVarargsBuiltinNode ;
144
145
import com .oracle .graal .python .nodes .object .GetClassNode ;
145
146
import com .oracle .graal .python .nodes .subscript .SliceLiteralNode ;
@@ -809,29 +810,29 @@ public Object createInt(PythonClass cls, Object obj, PNone keywordArg,
809
810
@ Builtin (name = BOOL , minNumOfArguments = 1 , maxNumOfArguments = 2 , constructsClass = Boolean .class , base = PInt .class )
810
811
@ GenerateNodeFactory
811
812
@ SuppressWarnings ("unused" )
812
- public abstract static class BoolNode extends PythonBuiltinNode {
813
+ public abstract static class BoolNode extends PythonBinaryBuiltinNode {
813
814
@ Specialization
814
- public boolean bool (Object cls , boolean arg ) {
815
+ public boolean boolB (Object cls , boolean arg ) {
815
816
return arg ;
816
817
}
817
818
818
819
@ Specialization
819
- public boolean bool (Object cls , int arg ) {
820
+ public boolean boolI (Object cls , int arg ) {
820
821
return arg != 0 ;
821
822
}
822
823
823
824
@ Specialization
824
- public boolean bool (Object cls , double arg ) {
825
+ public boolean boolD (Object cls , double arg ) {
825
826
return arg != 0.0 ;
826
827
}
827
828
828
829
@ Specialization
829
- public boolean bool (Object cls , String arg ) {
830
+ public boolean boolS (Object cls , String arg ) {
830
831
return !arg .isEmpty ();
831
832
}
832
833
833
834
@ Specialization
834
- public boolean bool (Object cls , PNone arg ) {
835
+ public boolean boolN (Object cls , PNone arg ) {
835
836
return false ;
836
837
}
837
838
@@ -850,7 +851,7 @@ public boolean bool(Object cls, Object obj,
850
851
// list([iterable])
851
852
@ Builtin (name = LIST , minNumOfArguments = 1 , maxNumOfArguments = 2 , constructsClass = PList .class )
852
853
@ GenerateNodeFactory
853
- public abstract static class ListNode extends PythonBuiltinNode {
854
+ public abstract static class ListNode extends PythonBinaryBuiltinNode {
854
855
855
856
@ Specialization
856
857
protected PList constructList (PythonClass cls , Object value ,
@@ -1129,7 +1130,7 @@ private ConditionProfile getIsPStringProfile() {
1129
1130
// tuple([iterable])
1130
1131
@ Builtin (name = TUPLE , minNumOfArguments = 1 , maxNumOfArguments = 2 , constructsClass = PTuple .class )
1131
1132
@ GenerateNodeFactory
1132
- public abstract static class TupleNode extends PythonBuiltinNode {
1133
+ public abstract static class TupleNode extends PythonBinaryBuiltinNode {
1133
1134
1134
1135
@ Specialization
1135
1136
protected PTuple constructTuple (PythonClass cls , Object value ,
0 commit comments