Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7c3b89b871f3
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3dafe3f0a8dd
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Mar 16, 2015

  1. Verified

    This commit was signed with the committer’s verified signature.
    headius Charles Oliver Nutter
    Copy the full SHA
    9092267 View commit details

Commits on Mar 17, 2015

  1. Merge pull request #2709 from bjfish/truffle_array_fannduch_fix

    [Truffle] Fixing Array#[]= for Fannduch benchmark.
    chrisseaton committed Mar 17, 2015
    Copy the full SHA
    3dafe3f View commit details
Showing with 8 additions and 2 deletions.
  1. +8 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
Original file line number Diff line number Diff line change
@@ -486,12 +486,18 @@ public Object setOtherArray(VirtualFrame frame, RubyArray array, int start, int

@Specialization(guards = "!isRubyArray(arguments[2])")
public Object setRange(VirtualFrame frame, RubyArray array, RubyRange.IntegerFixnumRange range, Object other, UndefinedPlaceholder unused) {
return setObject(frame, array, range.getBegin(), range.getLength(), other);
final int normalizedStart = array.normalizeIndex(range.getBegin());
final int normalizedEnd = range.doesExcludeEnd() ? array.normalizeIndex(range.getEnd()) - 1 : array.normalizeIndex(range.getEnd());
final int length = normalizedEnd - normalizedStart + 1;
return setObject(frame, array, normalizedStart, length, other);
}

@Specialization
public Object setRangeArray(VirtualFrame frame, RubyArray array, RubyRange.IntegerFixnumRange range, RubyArray other, UndefinedPlaceholder unused) {
return setOtherArray(frame, array, range.getBegin(), range.getLength(), other);
final int normalizedStart = array.normalizeIndex(range.getBegin());
final int normalizedEnd = range.doesExcludeEnd() ? array.normalizeIndex(range.getEnd()) - 1 : array.normalizeIndex(range.getEnd());
final int length = normalizedEnd - normalizedStart + 1;
return setOtherArray(frame, array, normalizedStart, length, other);
}

}