@@ -697,7 +697,7 @@ private Object delete(VirtualFrame frame, RubyArray array, Object value, Object
697
697
array .size = i ;
698
698
return found ;
699
699
} else {
700
- if (maybeBlock == NotProvided . INSTANCE ) {
700
+ if (maybeBlock == nil ) {
701
701
return nil ;
702
702
} else {
703
703
return yield ((RubyProc ) maybeBlock , value );
@@ -961,7 +961,7 @@ public abstract static class FillNode extends ArrayCoreMethodNode {
961
961
@ Specialization (
962
962
guards = { "args.length == 1" , "stores.acceptsValue(array.store, value(args))" },
963
963
limit = "storageStrategyLimit()" )
964
- protected RubyArray fill (RubyArray array , Object [] args , NotProvided block ,
964
+ protected RubyArray fill (RubyArray array , Object [] args , Nil block ,
965
965
@ CachedLibrary ("array.store" ) ArrayStoreLibrary stores ,
966
966
@ Cached PropagateSharingNode propagateSharingNode ,
967
967
@ Cached ("createCountingProfile()" ) LoopConditionProfile loopProfile ) {
@@ -983,7 +983,7 @@ protected Object value(Object[] args) {
983
983
}
984
984
985
985
@ Specialization
986
- protected Object fillFallback (VirtualFrame frame , RubyArray array , Object [] args , NotProvided block ,
986
+ protected Object fillFallback (VirtualFrame frame , RubyArray array , Object [] args , Nil block ,
987
987
@ Cached DispatchNode callFillInternal ) {
988
988
return callFillInternal .call (array , "fill_internal" , args );
989
989
}
@@ -1066,14 +1066,10 @@ public abstract static class InitializeNode extends YieldingCoreMethodNode {
1066
1066
@ Child private KernelNodes .RespondToNode respondToToAryNode ;
1067
1067
1068
1068
protected abstract RubyArray executeInitialize (RubyArray array , Object size , Object fillingValue ,
1069
- NotProvided block );
1069
+ Nil block );
1070
1070
1071
1071
@ Specialization
1072
- protected RubyArray initializeNoArgs (
1073
- RubyArray array ,
1074
- NotProvided size ,
1075
- NotProvided fillingValue ,
1076
- NotProvided block ) {
1072
+ protected RubyArray initializeNoArgs (RubyArray array , NotProvided size , NotProvided fillingValue , Nil block ) {
1077
1073
setStoreAndSize (array , ArrayStoreLibrary .INITIAL_STORE , 0 );
1078
1074
return array ;
1079
1075
}
@@ -1112,20 +1108,12 @@ protected RubyArray initializeNegativeLongSize(
1112
1108
1113
1109
@ TruffleBoundary
1114
1110
@ Specialization (guards = "size >= MAX_INT" )
1115
- protected RubyArray initializeSizeTooBig (
1116
- RubyArray array ,
1117
- long size ,
1118
- NotProvided fillingValue ,
1119
- NotProvided block ) {
1111
+ protected RubyArray initializeSizeTooBig (RubyArray array , long size , NotProvided fillingValue , Nil block ) {
1120
1112
throw new RaiseException (getContext (), coreExceptions ().argumentError ("array size too big" , this ));
1121
1113
}
1122
1114
1123
1115
@ Specialization (guards = "size >= 0" )
1124
- protected RubyArray initializeWithSizeNoValue (
1125
- RubyArray array ,
1126
- int size ,
1127
- NotProvided fillingValue ,
1128
- NotProvided block ) {
1116
+ protected RubyArray initializeWithSizeNoValue (RubyArray array , int size , NotProvided fillingValue , Nil block ) {
1129
1117
final Object [] store = new Object [size ];
1130
1118
Arrays .fill (store , nil );
1131
1119
setStoreAndSize (array , store , size );
@@ -1135,11 +1123,7 @@ protected RubyArray initializeWithSizeNoValue(
1135
1123
@ Specialization (
1136
1124
guards = { "size >= 0" , "wasProvided(fillingValue)" },
1137
1125
limit = "storageStrategyLimit()" )
1138
- protected RubyArray initializeWithSizeAndValue (
1139
- RubyArray array ,
1140
- int size ,
1141
- Object fillingValue ,
1142
- NotProvided block ,
1126
+ protected RubyArray initializeWithSizeAndValue (RubyArray array , int size , Object fillingValue , Nil block ,
1143
1127
@ CachedLibrary ("array.store" ) ArrayStoreLibrary stores ,
1144
1128
@ CachedLibrary (limit = "1" ) ArrayStoreLibrary allocatedStores ,
1145
1129
@ Cached ConditionProfile needsFill ,
@@ -1159,7 +1143,7 @@ protected RubyArray initializeWithSizeAndValue(
1159
1143
1160
1144
@ Specialization (
1161
1145
guards = { "wasProvided(size)" , "!isInteger(size)" , "!isLong(size)" , "wasProvided(fillingValue)" })
1162
- protected RubyArray initializeSizeOther (RubyArray array , Object size , Object fillingValue , NotProvided block ) {
1146
+ protected RubyArray initializeSizeOther (RubyArray array , Object size , Object fillingValue , Nil block ) {
1163
1147
int intSize = toInt (size );
1164
1148
return executeInitialize (array , intSize , fillingValue , block );
1165
1149
}
@@ -1202,7 +1186,7 @@ protected RubyArray initializeFromArray(
1202
1186
1203
1187
@ Specialization (
1204
1188
guards = { "!isInteger(object)" , "!isLong(object)" , "wasProvided(object)" , "!isRubyArray(object)" })
1205
- protected RubyArray initialize (RubyArray array , Object object , NotProvided unusedValue , NotProvided block ) {
1189
+ protected RubyArray initialize (RubyArray array , Object object , NotProvided unusedValue , Nil block ) {
1206
1190
RubyArray copy = null ;
1207
1191
if (respondToToAry (getLanguage (), object )) {
1208
1192
Object toAryResult = callToAry (object );
@@ -1212,10 +1196,10 @@ protected RubyArray initialize(RubyArray array, Object object, NotProvided unuse
1212
1196
}
1213
1197
1214
1198
if (copy != null ) {
1215
- return executeInitialize (array , copy , NotProvided .INSTANCE , NotProvided . INSTANCE );
1199
+ return executeInitialize (array , copy , NotProvided .INSTANCE , nil );
1216
1200
} else {
1217
1201
int size = toInt (object );
1218
- return executeInitialize (array , size , NotProvided .INSTANCE , NotProvided . INSTANCE );
1202
+ return executeInitialize (array , size , NotProvided .INSTANCE , nil );
1219
1203
}
1220
1204
}
1221
1205
@@ -2116,7 +2100,7 @@ protected RubyArray sortEmpty(RubyArray array, Object unusedBlock) {
2116
2100
@ Specialization (
2117
2101
guards = { "!isEmptyArray(array)" , "isSmall(array)" },
2118
2102
limit = "storageStrategyLimit()" )
2119
- protected RubyArray sortVeryShort (VirtualFrame frame , RubyArray array , NotProvided block ,
2103
+ protected RubyArray sortVeryShort (VirtualFrame frame , RubyArray array , Nil block ,
2120
2104
@ CachedLibrary ("array.store" ) ArrayStoreLibrary originalStores ,
2121
2105
@ CachedLibrary (limit = "1" ) ArrayStoreLibrary stores ,
2122
2106
@ Cached DispatchNode compareDispatchNode ,
@@ -2165,7 +2149,7 @@ protected RubyArray sortVeryShort(VirtualFrame frame, RubyArray array, NotProvid
2165
2149
"getLanguage().coreMethodAssumptions.integerCmpAssumption" ,
2166
2150
"getLanguage().coreMethodAssumptions.floatCmpAssumption" },
2167
2151
limit = "storageStrategyLimit()" )
2168
- protected Object sortPrimitiveArrayNoBlock (RubyArray array , NotProvided block ,
2152
+ protected Object sortPrimitiveArrayNoBlock (RubyArray array , Nil block ,
2169
2153
@ CachedLibrary ("array.store" ) ArrayStoreLibrary stores ,
2170
2154
@ CachedLibrary (limit = "1" ) ArrayStoreLibrary mutableStores ) {
2171
2155
final int size = array .size ;
@@ -2179,7 +2163,7 @@ protected Object sortPrimitiveArrayNoBlock(RubyArray array, NotProvided block,
2179
2163
@ Specialization (
2180
2164
guards = { "!isEmptyArray(array)" , "!isSmall(array)" },
2181
2165
limit = "storageStrategyLimit()" )
2182
- protected Object sortArrayWithoutBlock (RubyArray array , NotProvided block ,
2166
+ protected Object sortArrayWithoutBlock (RubyArray array , Nil block ,
2183
2167
@ CachedLibrary ("array.store" ) ArrayStoreLibrary stores ,
2184
2168
@ Cached DispatchNode fallbackNode ) {
2185
2169
return fallbackNode .call (array , "sort_fallback" );
0 commit comments