Skip to content

Commit 1ca816f

Browse files
committed
[Truffle] Allow Array indexing with an integer index to compile.
Without this, the chunky-encode-png-image-pass-to-stream benchmark from bench9000 fails to run.
1 parent bc23c47 commit 1ca816f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

core/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -658,10 +658,9 @@ public Object index(RubyArray array, int index, UndefinedPlaceholder undefined)
658658

659659
@Specialization(guards = "isIntegerFixnum")
660660
public Object sliceIntegerFixnum(RubyArray array, int start, int length) {
661-
notDesignedForCompilation();
662-
663661
final int normalisedIndex = array.normaliseIndex(start);
664662

663+
// TODO (nirvdrum 12-Jan-15) Add branch profiling.
665664
if (normalisedIndex < 0 || normalisedIndex > array.getSize() || length < 0) {
666665
return getContext().getCoreLibrary().getNilObject();
667666
} else if (normalisedIndex == array.getSize()) {

0 commit comments

Comments
 (0)