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

Commits on Jan 2, 2017

  1. Copy the full SHA
    aa5db01 View commit details
  2. 1
    Copy the full SHA
    1080499 View commit details
Original file line number Diff line number Diff line change
@@ -584,12 +584,7 @@ public int bitLength(DynamicObject value) {
@CoreMethod(names = "divmod", required = 1)
public abstract static class DivModNode extends CoreMethodArrayArgumentsNode {

@Child private GeneralDivModNode divModNode;

public DivModNode(SourceIndexLength sourceSection) {
super(sourceSection);
divModNode = new GeneralDivModNode(sourceSection);
}
@Child private GeneralDivModNode divModNode = new GeneralDivModNode();

@Specialization
public DynamicObject divMod(DynamicObject a, long b) {
Original file line number Diff line number Diff line change
@@ -472,12 +472,7 @@ public Object mod(long a, DynamicObject b) {
@CoreMethod(names = "divmod", required = 1)
public abstract static class DivModNode extends CoreMethodArrayArgumentsNode {

@Child private GeneralDivModNode divModNode;

public DivModNode(SourceIndexLength sourceSection) {
super(sourceSection);
divModNode = new GeneralDivModNode(sourceSection);
}
@Child private GeneralDivModNode divModNode = new GeneralDivModNode();

@Specialization
public DynamicObject divMod(long a, long b) {
Original file line number Diff line number Diff line change
@@ -30,11 +30,12 @@ public static FixnumOrBignumNode create(SourceIndexLength sourceSection) {
}

public FixnumOrBignumNode() {
this(null);
}

public FixnumOrBignumNode(SourceIndexLength sourceSection) {
super(sourceSection);
if (sourceSection != null) {
unsafeSetSourceSection(sourceSection);
}
}

private final ConditionProfile lowerProfile = ConditionProfile.createBinaryProfile();
Original file line number Diff line number Diff line change
@@ -284,12 +284,7 @@ public Object modCoerced(
@CoreMethod(names = "divmod", required = 1)
public abstract static class DivModNode extends CoreMethodArrayArgumentsNode {

@Child private GeneralDivModNode divModNode;

public DivModNode(SourceIndexLength sourceSection) {
super(sourceSection);
divModNode = new GeneralDivModNode(sourceSection);
}
@Child private GeneralDivModNode divModNode = new GeneralDivModNode();

@Specialization
public DynamicObject divMod(double a, long b) {
Original file line number Diff line number Diff line change
@@ -22,8 +22,8 @@

public class GeneralDivModNode extends RubyBaseNode {

@Child private FixnumOrBignumNode fixnumOrBignumQuotient;
@Child private FixnumOrBignumNode fixnumOrBignumRemainder;
@Child private FixnumOrBignumNode fixnumOrBignumQuotient = new FixnumOrBignumNode();
@Child private FixnumOrBignumNode fixnumOrBignumRemainder = new FixnumOrBignumNode();

private final BranchProfile bZeroProfile = BranchProfile.create();
private final BranchProfile bMinusOneProfile = BranchProfile.create();
@@ -32,12 +32,6 @@ public class GeneralDivModNode extends RubyBaseNode {
private final BranchProfile useFixnumPairProfile = BranchProfile.create();
private final BranchProfile useObjectPairProfile = BranchProfile.create();

public GeneralDivModNode(SourceIndexLength sourceSection) {
super(sourceSection);
fixnumOrBignumQuotient = new FixnumOrBignumNode();
fixnumOrBignumRemainder = new FixnumOrBignumNode();
}

public DynamicObject execute(long a, long b) {
return divMod(a, b);
}
Original file line number Diff line number Diff line change
@@ -57,15 +57,6 @@ public abstract class RubyBaseNode extends Node {

private int flags;

public RubyBaseNode() {
}

public RubyBaseNode(SourceIndexLength sourceSection) {
if (sourceSection != null) {
unsafeSetSourceSection(sourceSection);
}
}

// Guards which use the context and so can't be static

protected boolean isNil(Object value) {
Original file line number Diff line number Diff line change
@@ -23,7 +23,9 @@ public RubyNode() {
}

public RubyNode(SourceIndexLength sourceSection) {
super(sourceSection);
if (sourceSection != null) {
unsafeSetSourceSection(sourceSection);
}
}

// Fundamental execute methods