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

Commits on Nov 27, 2014

  1. Copy the full SHA
    f1b7aa7 View commit details
  2. Copy the full SHA
    000fe09 View commit details
Showing with 10 additions and 38 deletions.
  1. +7 −35 core/src/main/java/org/jruby/truffle/nodes/core/FalseClassNodes.java
  2. +3 −3 core/src/main/java/org/jruby/truffle/nodes/core/NilClassNodes.java
Original file line number Diff line number Diff line change
@@ -34,57 +34,29 @@ public boolean and(Object other) {
}
}

@CoreMethod(names = "|", needsSelf = false, required = 1)
public abstract static class OrNode extends CoreMethodNode {
@CoreMethod(names = { "|", "^" }, needsSelf = false, required = 1)
public abstract static class OrXorNode extends CoreMethodNode {

public OrNode(RubyContext context, SourceSection sourceSection) {
public OrXorNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public OrNode(OrNode prev) {
public OrXorNode(OrXorNode prev) {
super(prev);
}

@Specialization
public boolean or(boolean other) {
public boolean orXor(boolean other) {
return other;
}

@Specialization
public boolean or(RubyNilClass other) {
public boolean orXor(RubyNilClass other) {
return false;
}

@Specialization(guards = "!isNil")
public boolean or(RubyObject other) {
return true;
}

}

@CoreMethod(names = "^", needsSelf = false, required = 1)
public abstract static class XorNode extends CoreMethodNode {

public XorNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public XorNode(XorNode prev) {
super(prev);
}

@Specialization
public boolean xor(boolean other) {
return false ^ other;
}

@Specialization
public boolean xor(RubyNilClass other) {
return false;
}

@Specialization(guards = "!isNil")
public boolean xor(RubyObject other) {
public boolean orXor(RubyObject other) {
return true;
}

Original file line number Diff line number Diff line change
@@ -131,17 +131,17 @@ public OrXorNode(OrXorNode prev) {
}

@Specialization
public boolean or(boolean other) {
public boolean orXor(boolean other) {
return other;
}

@Specialization
public boolean or(RubyNilClass other) {
public boolean orXor(RubyNilClass other) {
return false;
}

@Specialization(guards = "!isNil")
public boolean or(RubyObject other) {
public boolean orXor(RubyObject other) {
return true;
}
}