Skip to content
Permalink
Browse files
[Truffle] Remove #callcc.
  • Loading branch information
chrisseaton committed Nov 26, 2014
1 parent 48a12f5 commit b60b386522bb5f5d81bd695b411d1d8cd56a0bdd
@@ -62,7 +62,6 @@ public void init() {
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, BindingNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, BignumNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, ClassNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, ContinuationNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, ComparableNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, DirNodesFactory.getFactories());
CoreMethodNodeManager.addCoreMethodNodes(rubyObjectClass, ExceptionNodesFactory.getFactories());
@@ -115,10 +115,6 @@ public RubyClass executeRubyClass(VirtualFrame frame) throws UnexpectedResultExc
return RubyTypesGen.RUBYTYPES.expectRubyClass(execute(frame));
}

public RubyContinuation executeRubyContinuation(VirtualFrame frame) throws UnexpectedResultException {
return RubyTypesGen.RUBYTYPES.expectRubyContinuation(execute(frame));
}

public RubyException executeRubyException(VirtualFrame frame) throws UnexpectedResultException {
return RubyTypesGen.RUBYTYPES.expectRubyException(execute(frame));
}
@@ -45,7 +45,6 @@
RubyBignum.class, //
RubyBinding.class, //
RubyClass.class, //
RubyContinuation.class, //
RubyException.class, //
RubyFiber.class, //
RubyFile.class, //
@@ -99,11 +99,6 @@ public RubyClass executeRubyClass(VirtualFrame frame) throws UnexpectedResultExc
return child.executeRubyClass(frame);
}

@Override
public RubyContinuation executeRubyContinuation(VirtualFrame frame) throws UnexpectedResultException {
return child.executeRubyContinuation(frame);
}

@Override
public RubyException executeRubyException(VirtualFrame frame) throws UnexpectedResultException {
return child.executeRubyException(frame);

This file was deleted.

@@ -299,35 +299,6 @@ public boolean blockGiven() {
}
}

// TODO(CS): should hide this in a feature

@CoreMethod(names = "callcc", isModuleFunction = true, needsBlock = true)
public abstract static class CallccNode extends CoreMethodNode {

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

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

@Specialization
public Object callcc(RubyProc block) {
notDesignedForCompilation();

final RubyContext context = getContext();

if (block == null) {
// TODO(CS): should really have acceptsBlock and needsBlock to do this automatically
throw new RaiseException(context.getCoreLibrary().localJumpError("no block given", this));
}

final RubyContinuation continuation = new RubyContinuation(context.getCoreLibrary().getContinuationClass());
return continuation.enter(block);
}
}

@CoreMethod(names = "caller", isModuleFunction = true, optional = 1)
public abstract static class CallerNode extends CoreMethodNode {

@@ -288,25 +288,6 @@ public RubyClass executeRubyClass(VirtualFrame frame) throws UnexpectedResultExc
return result;
}

@Override
public RubyContinuation executeRubyContinuation(VirtualFrame frame) throws UnexpectedResultException {
enter(frame);

final RubyContinuation result;

try {
result = child.executeRubyContinuation(frame);
leave(frame, result);
} catch (KillException e) {
throw (e);
} catch (Exception e) {
leaveExceptional(frame, e);
throw e;
}

return result;
}

@Override
public RubyException executeRubyException(VirtualFrame frame) throws UnexpectedResultException {
enter(frame);

This file was deleted.

This file was deleted.

@@ -2,3 +2,5 @@ fails:Continuation#call using #call transfers execution to right after the Kerne
fails:Continuation#call #[] is an alias for #call
fails:Continuation#call escapes an inner ensure block
fails:Continuation#call executes an outer ensure block
fails:Continuation#call arguments given to #call (or nil) are returned by the Kernel.callcc block (as Array unless only one object)
fails:Continuation#call closes over lexical environments
@@ -2,3 +2,5 @@ fails:Continuation#[] using #call transfers execution to right after the Kernel.
fails:Continuation#[] #[] is an alias for #call
fails:Continuation#[] escapes an inner ensure block
fails:Continuation#[] executes an outer ensure block
fails:Continuation#[] arguments given to #call (or nil) are returned by the Kernel.callcc block (as Array unless only one object)
fails:Continuation#[] closes over lexical environments

0 comments on commit b60b386

Please sign in to comment.