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: bbd3d2959cf8
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7fcb6a301dd3
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Oct 31, 2014

  1. Revert "[Truffle] Remove now useless (and incorrect!) AddNode special…

    …ization."
    
    This reverts commit 27712b7.
    eregon committed Oct 31, 2014
    Copy the full SHA
    57f049f View commit details
  2. Copy the full SHA
    abb749d View commit details
  3. Revert "[Truffle] Introduce ImplicitCast from int to long."

    This reverts commit 032326d.
    eregon committed Oct 31, 2014
    Copy the full SHA
    7fcb6a3 View commit details
6 changes: 0 additions & 6 deletions core/src/main/java/org/jruby/truffle/nodes/RubyTypes.java
Original file line number Diff line number Diff line change
@@ -74,12 +74,6 @@

public class RubyTypes {

@ImplicitCast
public long int2long(int value) {
return value;
}


@ImplicitCast
public boolean unboxBoolean(RubyTrueClass value) {
return true;
Original file line number Diff line number Diff line change
@@ -122,10 +122,12 @@ public ReferenceEqualNode(ReferenceEqualNode prev) {
@Specialization public boolean equal(boolean a, BigInteger b) { return false; }

@Specialization public boolean equal(int a, boolean b) { return false; }
@Specialization public boolean equal(int a, long b) { return false; }
@Specialization public boolean equal(int a, double b) { return false; }
@Specialization public boolean equal(int a, BigInteger b) { return false; }

@Specialization public boolean equal(long a, boolean b) { return false; }
@Specialization public boolean equal(long a, int b) { return false; }
@Specialization public boolean equal(long a, double b) { return false; }
@Specialization public boolean equal(long a, BigInteger b) { return false; }

10 changes: 10 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/core/FixnumNodes.java
Original file line number Diff line number Diff line change
@@ -117,6 +117,16 @@ public double add(int a, double b) {
return a + b;
}

@Specialization(rewriteOn = ArithmeticException.class)
public long add(int a, long b) {
return ExactMath.addExact(a, b);
}

@Specialization
public Object addWithOverflow(int a, long b) {
return fixnumOrBignum.fixnumOrBignum(SlowPathBigInteger.add(BigInteger.valueOf(a), BigInteger.valueOf(b)));
}

@Specialization
public Object add(int a, BigInteger b) {
return fixnumOrBignum.fixnumOrBignum(SlowPathBigInteger.add(BigInteger.valueOf(a), b));
Original file line number Diff line number Diff line change
@@ -43,11 +43,21 @@ public RubyRange.IntegerFixnumRange doRange(int begin, int end) {
return new RubyRange.IntegerFixnumRange(getContext().getCoreLibrary().getRangeClass(), begin, end, excludeEnd);
}

@Specialization
public RubyRange.LongFixnumRange doRange(int begin, long end) {
return new RubyRange.LongFixnumRange(getContext().getCoreLibrary().getRangeClass(), begin, end, excludeEnd);
}

@Specialization
public RubyRange.LongFixnumRange doRange(long begin, long end) {
return new RubyRange.LongFixnumRange(getContext().getCoreLibrary().getRangeClass(), begin, end, excludeEnd);
}

@Specialization
public RubyRange.LongFixnumRange doRange(long begin, int end) {
return new RubyRange.LongFixnumRange(getContext().getCoreLibrary().getRangeClass(), begin, end, excludeEnd);
}

@Specialization
public Object doRange(Object begin, Object end) {
if (begin instanceof Integer) {