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: 27067b041b3a
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 11b16fe7007e
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Dec 29, 2014

  1. [Truffle] Remove useless RubyBignum specializations when RubyBasicObj…

    …ect is enough.
    
    * And fix Kernel#String(String).
    eregon committed Dec 29, 2014
    Copy the full SHA
    85db07c View commit details
  2. [Truffle] Remove incorrect specializations in Kernel#String.

    * Fixnum#to_s should be called.
    eregon committed Dec 29, 2014
    Copy the full SHA
    11b16fe View commit details
Showing with 6 additions and 27 deletions.
  1. +6 −27 core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
33 changes: 6 additions & 27 deletions core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
Original file line number Diff line number Diff line change
@@ -390,11 +390,6 @@ public RubyClass getClass(long value) {
return getContext().getCoreLibrary().getFixnumClass();
}

@Specialization
public RubyClass getClass(RubyBignum value) {
return getContext().getCoreLibrary().getBignumClass();
}

@Specialization
public RubyClass getClass(double value) {
return getContext().getCoreLibrary().getFloatClass();
@@ -1071,6 +1066,11 @@ public int integer(int value) {
return value;
}

@Specialization
public long integer(long value) {
return value;
}

@Specialization
public RubyBignum integer(RubyBignum value) {
return value;
@@ -1791,12 +1791,6 @@ public RubyClass singletonClass(double self) {
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantDefineSingleton(this));
}

@Specialization
public RubyClass singletonClass(RubyBignum self) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantDefineSingleton(this));
}

@Specialization(guards = "!isRubyBignum")
public RubyClass singletonClass(RubyBasicObject self) {
notDesignedForCompilation();
@@ -1860,27 +1854,12 @@ public StringNode(StringNode prev) {
toS = prev.toS;
}

@Specialization
public RubyString string(int value) {
return getContext().makeString(Integer.toString(value));
}

@Specialization
public RubyString string(RubyBignum value) {
return getContext().makeString(value.toString());
}

@Specialization
public RubyString string(double value) {
return getContext().makeString(Double.toString(value));
}

@Specialization
public RubyString string(RubyString value) {
return value;
}

@Specialization
@Specialization(guards = "!isRubyString")
public Object string(VirtualFrame frame, Object value) {
return toS.call(frame, value, "to_s", null);
}