@@ -559,7 +559,7 @@ static TruffleString repr(VirtualFrame frame, PArray self,
559
559
@ GenerateNodeFactory
560
560
abstract static class SqItemNode extends SqItemBuiltinNode {
561
561
@ Specialization
562
- static Object doIt (VirtualFrame frame , PArray self , int index ,
562
+ static Object doIt (PArray self , int index ,
563
563
@ Bind ("this" ) Node inliningTarget ,
564
564
@ Cached PRaiseNode .Lazy raiseNode ,
565
565
@ Cached ArrayNodes .GetValueNode getValueNode ) {
@@ -634,22 +634,21 @@ private static PException raiseNonIntIndex(Node inliningTarget, Lazy raiseNode)
634
634
abstract static class SetItemNode extends SqAssItemBuiltinNode {
635
635
636
636
@ Specialization (guards = "!isNoValue(value)" )
637
- static void setitem (VirtualFrame frame , PArray self , int idx , Object value ,
637
+ static void setitem (VirtualFrame frame , PArray self , int index , Object value ,
638
638
@ Bind ("this" ) Node inliningTarget ,
639
- @ Shared @ Cached ( "forArrayAssign()" ) NormalizeIndexNode normalizeIndexNode ,
640
- @ Cached ArrayNodes . PutValueNode putValueNode ) {
641
- int index = normalizeIndexNode . execute ( idx , self .getLength ());
639
+ @ Cached ArrayNodes . PutValueNode putValueNode ,
640
+ @ Shared @ Cached PRaiseNode . Lazy raiseNode ) {
641
+ checkBounds ( inliningTarget , raiseNode , ErrorMessages . ARRAY_ASSIGN_OUT_OF_BOUNDS , index , self .getLength ());
642
642
putValueNode .execute (frame , inliningTarget , self , index , value );
643
643
}
644
644
645
645
@ Specialization (guards = "isNoValue(value)" )
646
- static void delitem (PArray self , int idx , @ SuppressWarnings ("unused" ) Object value ,
646
+ static void delitem (PArray self , int index , @ SuppressWarnings ("unused" ) Object value ,
647
647
@ Bind ("this" ) Node inliningTarget ,
648
- @ Shared @ Cached ("forArrayAssign()" ) NormalizeIndexNode normalizeIndexNode ,
649
648
@ Cached DeleteArraySliceNode deleteSliceNode ,
650
- @ Cached PRaiseNode .Lazy raiseNode ) {
649
+ @ Shared @ Cached PRaiseNode .Lazy raiseNode ) {
650
+ checkBounds (inliningTarget , raiseNode , ErrorMessages .ARRAY_ASSIGN_OUT_OF_BOUNDS , index , self .getLength ());
651
651
self .checkCanResize (inliningTarget , raiseNode );
652
- int index = normalizeIndexNode .execute (idx , self .getLength ());
653
652
deleteSliceNode .execute (inliningTarget , self , index , 1 );
654
653
}
655
654
}
0 commit comments