Skip to content
Permalink
Browse files
Merge branch 'master' into truffle-head
  • Loading branch information
chrisseaton committed Oct 12, 2014
2 parents 450c4b5 + 7b8a61f commit 12e8bb64bb6cfb3f1d33566210f8fb107b807928
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
@@ -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
@@ -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
@@ -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) {
@@ -34,10 +34,4 @@ public String toString() {
public void updateResult(Variable v) {
this.result = v;
}

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

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

}
@@ -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) {
@@ -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
@@ -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
@@ -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);
}
}

}

0 comments on commit 12e8bb6

Please sign in to comment.