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

Commits on Jun 16, 2015

  1. Copy the full SHA
    b5a3e8b View commit details
  2. Copy the full SHA
    2c4bff3 View commit details
Original file line number Diff line number Diff line change
@@ -21,6 +21,10 @@

public class FixnumOrBignumNode extends RubyNode {

public static FixnumOrBignumNode create(RubyContext context, SourceSection sourceSection) {
return new FixnumOrBignumNode(context, sourceSection);
}

public FixnumOrBignumNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}
Original file line number Diff line number Diff line change
@@ -10,9 +10,11 @@
package org.jruby.truffle.nodes.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.Cached;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;

import org.jruby.truffle.nodes.methods.UnsupportedOperationBehavior;
import org.jruby.truffle.runtime.NotProvided;
import org.jruby.truffle.runtime.RubyContext;
@@ -86,8 +88,6 @@ public abstract static class TimesNode extends YieldingCoreMethodNode {

// TODO CS 2-May-15 we badly need OSR in this node

@Child private FixnumOrBignumNode fixnumOrBignum;

public TimesNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}
@@ -147,14 +147,11 @@ public Object times(VirtualFrame frame, long n, RubyProc block) {
}

@Specialization(guards = "isRubyBignum(n)")
public Object times(VirtualFrame frame, RubyBasicObject n, RubyProc block) {
if (fixnumOrBignum == null) {
CompilerDirectives.transferToInterpreter();
fixnumOrBignum = insert(new FixnumOrBignumNode(getContext(), getSourceSection()));
}
public Object times(VirtualFrame frame, RubyBasicObject n, RubyProc block,
@Cached("create(getContext(), getSourceSection())") FixnumOrBignumNode fixnumOrBignumNode) {

for (BigInteger i = BigInteger.ZERO; i.compareTo(BignumNodes.getBigIntegerValue(n)) < 0; i = i.add(BigInteger.ONE)) {
yield(frame, block, fixnumOrBignum.fixnumOrBignum(i));
yield(frame, block, fixnumOrBignumNode.fixnumOrBignum(i));
}

return n;
Original file line number Diff line number Diff line change
@@ -163,6 +163,7 @@ public RubyNode compileFunctionNode(SourceSection sourceSection, String methodNa

if (isBlock) {
body = new RedoableNode(context, sourceSection, body);
body = new CatchNextNode(context, sourceSection, body);
body = new CatchReturnPlaceholderNode(context, sourceSection, body, environment.getReturnID());

body = new BehaveAsProcNode(context, sourceSection,
@@ -172,7 +173,6 @@ public RubyNode compileFunctionNode(SourceSection sourceSection, String methodNa
body = new CatchReturnNode(context, sourceSection, body, environment.getReturnID());
}

body = new CatchNextNode(context, sourceSection, body);
body = new CatchRetryAsErrorNode(context, sourceSection, body);

if (!isBlock) {