Skip to content

Commit 9a56418

Browse files
committed
Fix hardcoded limit attribute in ArrayNodes and set to storageStrategyLimit()
1 parent 95ee7ab commit 9a56418

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/org/truffleruby/core/array/ArrayNodes.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,7 @@ RubyArray initializeSizeTooBig(RubyArray array, long size, NotProvided fillingVa
11561156
@Specialization(guards = "size >= 0")
11571157
RubyArray initializeWithSizeNoValue(RubyArray array, int size, NotProvided fillingValue, Nil block,
11581158
@Cached @Shared IsSharedNode isSharedNode,
1159-
@CachedLibrary(limit = "2") @Exclusive ArrayStoreLibrary stores) {
1159+
@CachedLibrary(limit = "storageStrategyLimit()") @Exclusive ArrayStoreLibrary stores) {
11601160
final Object store;
11611161
if (isSharedNode.execute(this, array)) {
11621162
store = new SharedArrayStorage(new Object[size]);
@@ -1206,7 +1206,7 @@ RubyArray initializeSizeOther(RubyArray array, Object size, Object fillingValue,
12061206
@Specialization(guards = "size >= 0")
12071207
static Object initializeBlock(RubyArray array, int size, Object unusedFillingValue, RubyProc block,
12081208
@Cached ArrayBuilderNode arrayBuilder,
1209-
@CachedLibrary(limit = "2") @Exclusive ArrayStoreLibrary stores,
1209+
@CachedLibrary(limit = "storageStrategyLimit()") @Exclusive ArrayStoreLibrary stores,
12101210
// @Exclusive to fix truffle-interpreted-performance warning
12111211
@Cached @Exclusive IsSharedNode isSharedNode,
12121212
@Cached @Exclusive LoopConditionProfile loopProfile,
@@ -1820,7 +1820,7 @@ RubyArray replace(RubyArray array, Object otherObject,
18201820
@Cached ToAryNode toAryNode,
18211821
@Cached ArrayCopyOnWriteNode cowNode,
18221822
@Cached IsSharedNode isSharedNode,
1823-
@CachedLibrary(limit = "2") ArrayStoreLibrary stores) {
1823+
@CachedLibrary(limit = "storageStrategyLimit()") ArrayStoreLibrary stores) {
18241824
final var other = toAryNode.execute(this, otherObject);
18251825
final int size = other.size;
18261826
Object store = cowNode.execute(other, 0, size);
@@ -2221,7 +2221,7 @@ RubyArray stealStorageNoOp(RubyArray array, RubyArray other) {
22212221

22222222
@Specialization(guards = "array != other")
22232223
static RubyArray stealStorage(RubyArray array, RubyArray other,
2224-
@CachedLibrary(limit = "2") ArrayStoreLibrary stores,
2224+
@CachedLibrary(limit = "storageStrategyLimit()") ArrayStoreLibrary stores,
22252225
@Cached PropagateSharingNode propagateSharingNode,
22262226
@Bind("this") Node node) {
22272227
propagateSharingNode.execute(node, array, other);

0 commit comments

Comments
 (0)