@@ -714,9 +714,9 @@ public Object values(VirtualFrame frame, Object obj,
714714 @ Builtin (name = "PySequence_SetItem" , minNumOfPositionalArgs = 3 )
715715 @ GenerateNodeFactory
716716 public abstract static class PySequenceSetItemNode extends PythonTernaryBuiltinNode {
717- @ Specialization (guards = "checkNode.execute(obj)" )
717+ @ Specialization (guards = "checkNode.execute(obj)" , limit = "1" )
718718 public Object setItem (VirtualFrame frame , Object obj , Object key , Object value ,
719- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
719+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
720720 @ Cached PyObjectLookupAttr lookupAttrNode ,
721721 @ Cached ConditionProfile hasSetItem ,
722722 @ Cached CallNode callNode ,
@@ -735,9 +735,9 @@ public Object setItem(VirtualFrame frame, Object obj, Object key, Object value,
735735 }
736736 }
737737
738- @ Specialization (guards = "!checkNode.execute(obj)" )
738+ @ Specialization (guards = "!checkNode.execute(obj)" , limit = "1" )
739739 Object setItem (VirtualFrame frame , Object obj , @ SuppressWarnings ("unused" ) Object key , @ SuppressWarnings ("unused" ) Object value ,
740- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
740+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
741741 @ Cached PRaiseNativeNode raiseNativeNode ) {
742742 return raiseNativeNode .raiseInt (frame , -1 , TypeError , ErrorMessages .IS_NOT_A_SEQUENCE , obj );
743743 }
@@ -748,9 +748,9 @@ Object setItem(VirtualFrame frame, Object obj, @SuppressWarnings("unused") Objec
748748 @ GenerateNodeFactory
749749 abstract static class PySequenceGetSliceNode extends PythonTernaryBuiltinNode {
750750
751- @ Specialization (guards = "checkNode.execute(obj)" )
751+ @ Specialization (guards = "checkNode.execute(obj)" , limit = "1" )
752752 Object getSlice (VirtualFrame frame , Object obj , long iLow , long iHigh ,
753- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
753+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
754754 @ Cached PyObjectLookupAttr lookupAttrNode ,
755755 @ Cached SliceLiteralNode sliceNode ,
756756 @ Cached CallNode callNode ,
@@ -764,9 +764,9 @@ Object getSlice(VirtualFrame frame, Object obj, long iLow, long iHigh,
764764 }
765765 }
766766
767- @ Specialization (guards = "!checkNode.execute(obj)" )
767+ @ Specialization (guards = "!checkNode.execute(obj)" , limit = "1" )
768768 Object getSlice (VirtualFrame frame , Object obj , @ SuppressWarnings ("unused" ) Object key , @ SuppressWarnings ("unused" ) Object value ,
769- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
769+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
770770 @ Cached PRaiseNativeNode raiseNativeNode ) {
771771 return raiseNativeNode .raise (frame , getContext ().getNativeNull (), TypeError , ErrorMessages .OBJ_IS_UNSLICEABLE , obj );
772772 }
@@ -792,9 +792,9 @@ static Object contains(VirtualFrame frame, Object haystack, Object needle,
792792 @ Builtin (name = "PySequence_Repeat" , minNumOfPositionalArgs = 2 )
793793 @ GenerateNodeFactory
794794 abstract static class PySequenceRepeatNode extends PythonBinaryBuiltinNode {
795- @ Specialization (guards = "checkNode.execute(obj)" )
795+ @ Specialization (guards = "checkNode.execute(obj)" , limit = "1" )
796796 Object repeat (VirtualFrame frame , Object obj , long n ,
797- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
797+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
798798 @ Cached ("createMul()" ) MulNode mulNode ,
799799 @ Cached TransformExceptionToNativeNode transformExceptionToNativeNode ) {
800800 try {
@@ -805,9 +805,9 @@ Object repeat(VirtualFrame frame, Object obj, long n,
805805 }
806806 }
807807
808- @ Specialization (guards = "!checkNode.execute(obj)" )
808+ @ Specialization (guards = "!checkNode.execute(obj)" , limit = "1" )
809809 protected Object repeat (VirtualFrame frame , Object obj , @ SuppressWarnings ("unused" ) Object n ,
810- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
810+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
811811 @ Cached PRaiseNativeNode raiseNativeNode ) {
812812 return raiseNativeNode .raise (frame , getContext ().getNativeNull (), TypeError , ErrorMessages .OBJ_CANT_BE_REPEATED , obj );
813813 }
@@ -820,12 +820,12 @@ protected MulNode createMul() {
820820 @ Builtin (name = "PySequence_InPlaceRepeat" , minNumOfPositionalArgs = 2 )
821821 @ GenerateNodeFactory
822822 abstract static class PySequenceInPlaceRepeatNode extends PythonBinaryBuiltinNode {
823- @ Specialization (guards = {"checkNode.execute(obj)" })
823+ @ Specialization (guards = {"checkNode.execute(obj)" }, limit = "1" )
824824 Object repeat (VirtualFrame frame , Object obj , long n ,
825825 @ Cached PyObjectLookupAttr lookupNode ,
826826 @ Cached CallNode callNode ,
827827 @ Cached ("createMul()" ) MulNode mulNode ,
828- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
828+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
829829 @ Cached TransformExceptionToNativeNode transformExceptionToNativeNode ) {
830830 try {
831831 Object imulCallable = lookupNode .execute (frame , obj , __IMUL__ );
@@ -840,9 +840,9 @@ Object repeat(VirtualFrame frame, Object obj, long n,
840840 }
841841 }
842842
843- @ Specialization (guards = "!checkNode.execute(obj)" )
843+ @ Specialization (guards = "!checkNode.execute(obj)" , limit = "1" )
844844 protected Object repeat (VirtualFrame frame , Object obj , @ SuppressWarnings ("unused" ) Object n ,
845- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
845+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
846846 @ Cached PRaiseNativeNode raiseNativeNode ) {
847847 return raiseNativeNode .raise (frame , getContext ().getNativeNull (), TypeError , ErrorMessages .OBJ_CANT_BE_REPEATED , obj );
848848 }
@@ -855,9 +855,9 @@ protected MulNode createMul() {
855855 @ Builtin (name = "PySequence_Concat" , minNumOfPositionalArgs = 2 )
856856 @ GenerateNodeFactory
857857 abstract static class PySequenceConcatNode extends PythonBinaryBuiltinNode {
858- @ Specialization (guards = {"checkNode.execute(s1)" , "checkNode.execute(s1)" })
858+ @ Specialization (guards = {"checkNode.execute(s1)" , "checkNode.execute(s1)" }, limit = "1" )
859859 Object concat (VirtualFrame frame , Object s1 , Object s2 ,
860- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
860+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
861861 @ Cached ("createAdd()" ) BinaryArithmetic .AddNode addNode ,
862862 @ Cached TransformExceptionToNativeNode transformExceptionToNativeNode ) {
863863 try {
@@ -868,9 +868,9 @@ Object concat(VirtualFrame frame, Object s1, Object s2,
868868 }
869869 }
870870
871- @ Specialization (guards = {"!checkNode.execute(s1) || checkNode.execute(s2)" })
871+ @ Specialization (guards = {"!checkNode.execute(s1) || checkNode.execute(s2)" }, limit = "1" )
872872 protected Object cantConcat (VirtualFrame frame , Object s1 , @ SuppressWarnings ("unused" ) Object s2 ,
873- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
873+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
874874 @ Cached PRaiseNativeNode raiseNativeNode ) {
875875 return raiseNativeNode .raise (frame , getContext ().getNativeNull (), TypeError , ErrorMessages .OBJ_CANT_BE_CONCATENATED , s1 );
876876 }
@@ -884,12 +884,12 @@ protected BinaryArithmetic.AddNode createAdd() {
884884 @ GenerateNodeFactory
885885 abstract static class PySequenceInPlaceConcatNode extends PythonBinaryBuiltinNode {
886886
887- @ Specialization (guards = {"checkNode.execute(s1)" })
887+ @ Specialization (guards = {"checkNode.execute(s1)" }, limit = "1" )
888888 Object concat (VirtualFrame frame , Object s1 , Object s2 ,
889889 @ Cached PyObjectLookupAttr lookupNode ,
890890 @ Cached CallNode callNode ,
891891 @ Cached ("createAdd()" ) BinaryArithmetic .AddNode addNode ,
892- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
892+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
893893 @ Cached TransformExceptionToNativeNode transformExceptionToNativeNode ) {
894894 try {
895895 Object iaddCallable = lookupNode .execute (frame , s1 , __IADD__ );
@@ -903,9 +903,9 @@ Object concat(VirtualFrame frame, Object s1, Object s2,
903903 }
904904 }
905905
906- @ Specialization (guards = "!checkNode.execute(s1)" )
906+ @ Specialization (guards = "!checkNode.execute(s1)" , limit = "1" )
907907 protected Object concat (VirtualFrame frame , Object s1 , @ SuppressWarnings ("unused" ) Object s2 ,
908- @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
908+ @ Shared ( "check" ) @ SuppressWarnings ("unused" ) @ Cached com .oracle .graal .python .lib .PySequenceCheckNode checkNode ,
909909 @ Cached PRaiseNativeNode raiseNativeNode ) {
910910 return raiseNativeNode .raise (frame , getContext ().getNativeNull (), TypeError , ErrorMessages .OBJ_CANT_BE_CONCATENATED , s1 );
911911 }
@@ -1270,8 +1270,8 @@ static Object notMapping(VirtualFrame frame, Object obj,
12701270 protected static boolean isSetOrDeque (Object obj , IsSameTypeNode isSameType , GetClassNode getClassNode ) {
12711271 Object cls = getClassNode .execute (obj );
12721272 return isSameType .execute (cls , PythonBuiltinClassType .PSet ) ||
1273- isSameType .execute (cls , PythonBuiltinClassType .PFrozenSet ) ||
1274- isSameType .execute (cls , PythonBuiltinClassType .PDeque );
1273+ isSameType .execute (cls , PythonBuiltinClassType .PFrozenSet ) ||
1274+ isSameType .execute (cls , PythonBuiltinClassType .PDeque );
12751275 }
12761276 }
12771277
0 commit comments