Skip to content

Commit

Permalink
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -3200,7 +3200,7 @@ public Operand buildReturn(ReturnNode returnNode, IRScope s) {
// If this happens to be a module body, the runtime throws a local jump error if the
// closure is a proc. If the closure is a lambda, then this becomes a normal return.
IRMethod m = s.getNearestMethod();
addInstr(s, new RuntimeHelperCall(null, CHECK_FOR_LJE, new Operand[] { new Boolean(m == null) }));
addInstr(s, new RuntimeHelperCall(null, CHECK_FOR_LJE, new Operand[] { m == null ? Boolean.TRUE : Boolean.FALSE }));
retVal = processEnsureRescueBlocks(s, retVal);
addInstr(s, new NonlocalReturnInstr(retVal, m == null ? "--none--" : m.getName()));
} else if (s.isModuleBody()) {
11 changes: 5 additions & 6 deletions core/src/main/java/org/jruby/ir/IRManager.java
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@
import org.jruby.RubyInstanceConfig;
import org.jruby.ir.listeners.IRScopeListener;
import org.jruby.ir.listeners.InstructionsListener;
import org.jruby.ir.operands.Nil;
import org.jruby.ir.operands.TemporaryLocalVariable;
import org.jruby.ir.operands.*;
import org.jruby.ir.operands.Boolean;
import org.jruby.ir.passes.BasicCompilerPassListener;
import org.jruby.ir.passes.CompilerPass;
import org.jruby.ir.passes.CompilerPassListener;
@@ -24,8 +24,7 @@ public class IRManager {
private int dummyMetaClassCount = 0;
private final IRModuleBody object = new IRClassBody(this, null, "Object", "", 0, null);
private final Nil nil = new Nil();
private final org.jruby.ir.operands.Boolean trueObject = new org.jruby.ir.operands.Boolean(true);
private final org.jruby.ir.operands.Boolean falseObject = new org.jruby.ir.operands.Boolean(false);

// Listeners for debugging and testing of IR
private Set<CompilerPassListener> passListeners = new HashSet<CompilerPassListener>();
private CompilerPassListener defaultListener = new BasicCompilerPassListener();
@@ -63,11 +62,11 @@ public Nil getNil() {
}

public org.jruby.ir.operands.Boolean getTrue() {
return trueObject;
return Boolean.TRUE;
}

public org.jruby.ir.operands.Boolean getFalse() {
return falseObject;
return Boolean.FALSE;
}

public IRModuleBody getObject() {
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/operands/Boolean.java
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ public class Boolean extends ImmutableLiteral {
public static final Boolean TRUE = new Boolean(true);
public static final Boolean FALSE = new Boolean(false);

public Boolean(boolean truthy) {
private Boolean(boolean truthy) {
super(OperandType.BOOLEAN);

this.truthy = truthy;

0 comments on commit 8fbe84a

Please sign in to comment.