Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 36c9f5df1fca
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: a51620e29012
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Aug 19, 2015

  1. Copy the full SHA
    92129e9 View commit details
  2. [Truffle] Remove unused BehaveAsProcNode.

    * Blocks and procs behave identically now.
    eregon committed Aug 19, 2015
    Copy the full SHA
    a51620e View commit details
Original file line number Diff line number Diff line change
@@ -15,13 +15,15 @@
import com.oracle.truffle.api.nodes.ControlFlowException;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;

import org.jruby.truffle.nodes.RubyGuards;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.cast.SingleValueCastNode;
import org.jruby.truffle.nodes.cast.SingleValueCastNodeGen;
import org.jruby.truffle.nodes.core.FiberNodesFactory.FiberTransferNodeFactory;
import org.jruby.truffle.nodes.methods.UnsupportedOperationBehavior;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.control.BreakException;
import org.jruby.truffle.runtime.control.RaiseException;
import org.jruby.truffle.runtime.control.ReturnException;
import org.jruby.truffle.runtime.layouts.Layouts;
@@ -74,6 +76,8 @@ public void run() {
} catch (FiberExitException e) {
assert !Layouts.FIBER.getRootFiber(fiber);
// Naturally exit the Java thread on catching this
} catch (BreakException e) {
Layouts.FIBER.getMessageQueue(Layouts.FIBER.getLastResumedByFiber(fiber)).add(new FiberExceptionMessage(Layouts.MODULE.getFields(Layouts.BASIC_OBJECT.getLogicalClass(fiber)).getContext().getCoreLibrary().breakFromProcClosure(null)));
} catch (ReturnException e) {
Layouts.FIBER.getMessageQueue(Layouts.FIBER.getLastResumedByFiber(fiber)).add(new FiberExceptionMessage(Layouts.MODULE.getFields(Layouts.BASIC_OBJECT.getLogicalClass(fiber)).getContext().getCoreLibrary().unexpectedReturn(null)));
} catch (RaiseException e) {

This file was deleted.

Original file line number Diff line number Diff line change
@@ -889,6 +889,11 @@ public DynamicObject noBlockGiven(Node currentNode) {
return localJumpError("no block given", currentNode);
}

public DynamicObject breakFromProcClosure(Node currentNode) {
CompilerAsserts.neverPartOfCompilation();
return localJumpError("break from proc-closure", currentNode);
}

public DynamicObject unexpectedReturn(Node currentNode) {
CompilerAsserts.neverPartOfCompilation();
return localJumpError("unexpected return", currentNode);

This file was deleted.

Original file line number Diff line number Diff line change
@@ -132,10 +132,6 @@ public BlockDefinitionNode compileBlockNode(SourceSection sourceSection, String
body = new CatchNextNode(context, sourceSection, body);
body = new CatchReturnPlaceholderNode(context, sourceSection, body, environment.getReturnID());

body = new BehaveAsProcNode(context, sourceSection,
new CatchBreakAsProcErrorNode(context, sourceSection, body),
NodeUtil.cloneNode(body));

body = new CatchRetryAsErrorNode(context, sourceSection, body);

// Blocks
@@ -145,10 +141,6 @@ public BlockDefinitionNode compileBlockNode(SourceSection sourceSection, String
behaveAsBlockNode.replace(behaveAsBlockNode.getAsBlock());
}

for (BehaveAsProcNode behaveAsProcNode : NodeUtil.findAllNodeInstances(newNodeForBlocks, BehaveAsProcNode.class)) {
behaveAsProcNode.replace(behaveAsProcNode.getNotAsProc());
}

final RubyRootNode newRootNodeForBlocks = new RubyRootNode(context, sourceSection, environment.getFrameDescriptor(), environment.getSharedMethodInfo(),
newNodeForBlocks, environment.needsDeclarationFrame());

@@ -159,10 +151,6 @@ public BlockDefinitionNode compileBlockNode(SourceSection sourceSection, String
behaveAsBlockNode.replace(behaveAsBlockNode.getAsBlock());
}

for (BehaveAsProcNode behaveAsProcNode : NodeUtil.findAllNodeInstances(newNodeForProcs, BehaveAsProcNode.class)) {
behaveAsProcNode.replace(behaveAsProcNode.getAsProc());
}

final RubyRootNode newRootNodeForProcs = new RubyRootNode(context, sourceSection, environment.getFrameDescriptor(), environment.getSharedMethodInfo(),
newNodeForProcs, environment.needsDeclarationFrame());

@@ -173,10 +161,6 @@ public BlockDefinitionNode compileBlockNode(SourceSection sourceSection, String
behaveAsBlockNode.replace(behaveAsBlockNode.getNotAsBlock());
}

for (BehaveAsProcNode behaveAsProcNode : NodeUtil.findAllNodeInstances(newNodeForLambdas, BehaveAsProcNode.class)) {
behaveAsProcNode.replace(behaveAsProcNode.getNotAsProc());
}

final RubyRootNode newRootNodeForLambdas = new RubyRootNode(
context, sourceSection,
environment.getFrameDescriptor(), environment.getSharedMethodInfo(),