Navigation Menu

Skip to content

Commit

Permalink
[Truffle] Remove #callcc.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Nov 26, 2014
1 parent 48a12f5 commit b60b386
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 228 deletions.
Expand Up @@ -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());
Expand Down
4 changes: 0 additions & 4 deletions core/src/main/java/org/jruby/truffle/nodes/RubyNode.java
Expand Up @@ -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));
}
Expand Down
1 change: 0 additions & 1 deletion core/src/main/java/org/jruby/truffle/nodes/RubyTypes.java
Expand Up @@ -45,7 +45,6 @@
RubyBignum.class, //
RubyBinding.class, //
RubyClass.class, //
RubyContinuation.class, //
RubyException.class, //
RubyFiber.class, //
RubyFile.class, //
Expand Down
Expand Up @@ -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);
Expand Down

This file was deleted.

29 changes: 0 additions & 29 deletions core/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
Expand Up @@ -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 {

Expand Down
19 changes: 0 additions & 19 deletions core/src/main/java/org/jruby/truffle/nodes/debug/ProxyNode.java
Expand Up @@ -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);
Expand Down

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions spec/truffle/tags/core/continuation/call_tags.txt
Expand Up @@ -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
Expand Up @@ -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.