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

Commits on May 26, 2016

  1. Copy the full SHA
    7bed12f View commit details
  2. Copy the full SHA
    eb8e2a5 View commit details

Commits on Jun 28, 2016

  1. Copy the full SHA
    0585bd1 View commit details
  2. Copy the full SHA
    142030e View commit details

Commits on Jul 9, 2016

  1. Copy the full SHA
    1462657 View commit details
  2. Copy the full SHA
    2039e84 View commit details
  3. Merge pull request #3930 from headius/misc_optz

    Misc optz
    headius authored Jul 9, 2016
    Copy the full SHA
    fa5698e View commit details
8 changes: 8 additions & 0 deletions core/src/main/java/org/jruby/RubyBasicObject.java
Original file line number Diff line number Diff line change
@@ -1119,6 +1119,14 @@ public IRubyObject op_not(ThreadContext context) {
return context.runtime.newBoolean(!this.isTrue());
}

/**
* The != method implemented for BasicObject. Note that this version is currently
* replaced by a Ruby version in basicobject.rb for better caching characteristics.
*
* @param context thread context
* @param other other object
* @return false if this == other, true otherwise
*/
@JRubyMethod(name = "!=", required = 1)
public IRubyObject op_not_equal(ThreadContext context, IRubyObject other) {
return context.runtime.newBoolean(!invokedynamic(context, this, OP_EQUAL, other).isTrue());
9 changes: 9 additions & 0 deletions core/src/main/java/org/jruby/RubyNumeric.java
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@
import org.jruby.ast.util.ArgsUtil;
import org.jruby.common.RubyWarnings;
import org.jruby.exceptions.RaiseException;
import org.jruby.ext.bigdecimal.RubyBigDecimal;
import org.jruby.javasupport.JavaUtil;
import org.jruby.runtime.Block;
import org.jruby.runtime.ClassIndex;
@@ -275,6 +276,14 @@ private static IRubyObject numericToFloat(Ruby runtime, IRubyObject num) {
throw runtime.newTypeError("can't convert " + num.getType() + " into Float");
}

if (num instanceof RubyFloat) {
return num;
}

if (num instanceof RubyFixnum && !runtime.isFixnumReopened()) {
return ((RubyFixnum) num).to_f();
}

return TypeConverter.convertToType(num, runtime.getFloat(), "to_f");
}

Original file line number Diff line number Diff line change
@@ -19,8 +19,6 @@
import org.jruby.runtime.ThreadContext;
import org.jruby.runtime.builtin.IRubyObject;

import static org.jruby.ir.IRFlags.REQUIRES_FRAME;

/**
* Instruction representing Ruby code of the form: "a['str']"
* which is equivalent to: a.[]('str'). Because a Hash receiver
Original file line number Diff line number Diff line change
@@ -37,7 +37,10 @@ public boolean computeScopeFlags(IRScope scope) {
// by passing in the frame self explicitly to Helpers.invoke(..)
// rather than try to get it off context.getFrameSelf()
super.computeScopeFlags(scope);
scope.getFlags().add(REQUIRES_FRAME);
if (targetRequiresCallersFrame()) {
// This can be narrowed further by filtering out cases with literals other than String and Regexp
scope.getFlags().add(REQUIRES_FRAME);
}
return true;
}

Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@ public static LoadFrameClosureInstr decode(IRReaderDecoder d) {

@Override
public boolean computeScopeFlags(IRScope scope) {
super.computeScopeFlags(scope);
scope.getFlags().add(REQUIRES_FRAME);
return true;
}
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ public UnresolvedSuperInstr(Variable result, Operand receiver, Operand[] args, O
public boolean computeScopeFlags(IRScope scope) {
super.computeScopeFlags(scope);
scope.getFlags().add(IRFlags.REQUIRES_FRAME); // for current class and method name
scope.getFlags().add(IRFlags.REQUIRES_DYNSCOPE); // for current class and method name
return true;
}

3 changes: 2 additions & 1 deletion core/src/main/ruby/jruby/kernel.rb
Original file line number Diff line number Diff line change
@@ -33,4 +33,5 @@
load 'jruby/kernel/gc.rb'
load 'jruby/kernel/range.rb'
load 'jruby/kernel/load_error.rb'
load 'jruby/kernel/file.rb'
load 'jruby/kernel/file.rb'
load 'jruby/kernel/basicobject.rb'
6 changes: 6 additions & 0 deletions core/src/main/ruby/jruby/kernel/basicobject.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class BasicObject
# replace Java versions that don't cache with Ruby versions that do
def !=(other)
!(self == other)
end
end