Skip to content

Commit

Permalink
Merge branch 'master' into truffle-head
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Oct 12, 2014
2 parents 450c4b5 + 7b8a61f commit 12e8bb6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
5 changes: 2 additions & 3 deletions core/src/main/java/org/jruby/ir/instructions/BreakInstr.java
Expand Up @@ -92,10 +92,9 @@ public Instr clone(CloneInfo info) {
}

return new BreakInstr(returnValue.cloneForInlining(ii), scopeName);
} else {
throw new UnsupportedOperationException("Break instructions shouldn't show up outside closures.");
}

throw new UnsupportedOperationException();
//return super.clone(ii);
}

@Override
Expand Down
Expand Up @@ -47,10 +47,9 @@ public Instr clone(CloneInfo info) {
}

return new NonlocalReturnInstr(returnValue.cloneForInlining(ii), methodName, maybeLambda);
} else {
throw new UnsupportedOperationException("Nonlocal returns shouldn't show up outside closures.");
}

throw new UnsupportedOperationException();
//return super.clone(ii);
}

@Override
Expand Down
Expand Up @@ -5,7 +5,7 @@
import org.jruby.ir.operands.Variable;
import org.jruby.ir.transformations.inlining.CloneInfo;

public class ReceiveExceptionBase extends Instr implements ResultInstr, FixedArityInstr {
public abstract class ReceiveExceptionBase extends Instr implements ResultInstr, FixedArityInstr {
protected Variable result;

public ReceiveExceptionBase(Operation op, Variable result) {
Expand Down Expand Up @@ -34,10 +34,4 @@ public String toString() {
public void updateResult(Variable v) {
this.result = v;
}

@Override
public Instr clone(CloneInfo info) {
throw new UnsupportedOperationException();
}

}
Expand Up @@ -50,5 +50,4 @@ public String toString() {
public Instr clone(CloneInfo info) {
throw new UnsupportedOperationException();
}

}
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/ir/operands/LocalVariable.java
Expand Up @@ -16,9 +16,9 @@
* @author enebo
*/
public class LocalVariable extends Variable implements DepthCloneable {
protected String name;
protected int scopeDepth;
protected int offset;
protected final String name;
protected final int scopeDepth;
protected final int offset;

// FIXME: We should resolve to an index into an array but localvariable has no allocator
public LocalVariable(String name, int scopeDepth, int location) {
Expand Down
21 changes: 15 additions & 6 deletions core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
Expand Up @@ -1517,15 +1517,18 @@ public boolean require(RubyString feature) {
public abstract static class RespondToNode extends CoreMethodNode {

@Child protected DispatchHeadNode dispatch;
@Child protected DispatchHeadNode dispatchIgnoreVisibility;

public RespondToNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
dispatch = new DispatchHeadNode(context, false, Dispatch.MissingBehavior.CALL_METHOD_MISSING);
dispatchIgnoreVisibility = new DispatchHeadNode(context, true, Dispatch.MissingBehavior.CALL_METHOD_MISSING);
}

public RespondToNode(RespondToNode prev) {
super(prev);
dispatch = prev.dispatch;
dispatchIgnoreVisibility = prev.dispatchIgnoreVisibility;
}

@Specialization
Expand All @@ -1534,9 +1537,12 @@ public boolean doesRespondTo(VirtualFrame frame, Object object, RubyString name,
}

@Specialization
public boolean doesRespondTo(VirtualFrame frame, Object object, RubyString name, boolean dontCheckVisibility) {
// TODO(CS): check visibility flag
return dispatch.doesRespondTo(frame, name, object);
public boolean doesRespondTo(VirtualFrame frame, Object object, RubyString name, boolean ignoreVisibility) {
if (ignoreVisibility) {
return dispatchIgnoreVisibility.doesRespondTo(frame, name, object);
} else {
return dispatch.doesRespondTo(frame, name, object);
}
}

@Specialization
Expand All @@ -1545,9 +1551,12 @@ public boolean doesRespondTo(VirtualFrame frame, Object object, RubySymbol name,
}

@Specialization
public boolean doesRespondTo(VirtualFrame frame, Object object, RubySymbol name, boolean dontCheckVisibility) {
// TODO(CS): check visibility flag
return dispatch.doesRespondTo(frame, name, object);
public boolean doesRespondTo(VirtualFrame frame, Object object, RubySymbol name, boolean ignoreVisibility) {
if (ignoreVisibility) {
return dispatchIgnoreVisibility.doesRespondTo(frame, name, object);
} else {
return dispatch.doesRespondTo(frame, name, object);
}
}

}
Expand Down

0 comments on commit 12e8bb6

Please sign in to comment.