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: 5844ccdac2be
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dcb15518f75c
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Apr 5, 2015

  1. Copy the full SHA
    5f6f59b View commit details
  2. Copy the full SHA
    dcb1551 View commit details
Original file line number Diff line number Diff line change
@@ -916,6 +916,10 @@ public RubyNode visitComplexNode(ComplexNode node) {

@Override
public RubyNode visitConstDeclNode(org.jruby.ast.ConstDeclNode node) {
return visitConstDeclNode(node, node.getValueNode().accept(this));
}

private RubyNode visitConstDeclNode(org.jruby.ast.ConstDeclNode node, RubyNode rhs) {
final SourceSection sourceSection = translate(node.getPosition());

RubyNode moduleNode;
@@ -931,7 +935,7 @@ public RubyNode visitConstDeclNode(org.jruby.ast.ConstDeclNode node) {
throw new UnsupportedOperationException();
}

return new WriteConstantNode(context, sourceSection, node.getName(), moduleNode, node.getValueNode().accept(this));
return new WriteConstantNode(context, sourceSection, node.getName(), moduleNode, rhs);
}

@Override
@@ -2111,6 +2115,8 @@ private RubyNode translateDummyAssignment(org.jruby.ast.Node dummyAssignment, Ru
}
} else if (dummyAssignment instanceof org.jruby.ast.GlobalAsgnNode) {
return translateGlobalAsgnNode((org.jruby.ast.GlobalAsgnNode) dummyAssignment, rhs);
} else if (dummyAssignment instanceof org.jruby.ast.ConstDeclNode) {
return visitConstDeclNode((org.jruby.ast.ConstDeclNode) dummyAssignment, rhs);
} else {
translated = ((ReadNode) environment.findLocalVarNode(environment.allocateLocalTemp("dummy"), sourceSection)).makeWriteNode(rhs);
}
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ public MethodTranslator(Node currentNode, RubyContext context, BodyTranslator pa

public RubyNode compileFunctionNode(SourceSection sourceSection, String methodName, ArgsNode argsNode, org.jruby.ast.Node bodyNode, SharedMethodInfo sharedMethodInfo) {
if (PRINT_PARSE_TREE_METHOD_NAMES.contains(methodName)) {
System.err.println(methodName);
System.err.println(sourceSection + " " + methodName);
System.err.println(sharedMethodInfo.getParseTree().toString(true, 0));
}

@@ -176,12 +176,12 @@ public RubyNode compileFunctionNode(SourceSection sourceSection, String methodNa
context, sourceSection, environment.getFrameDescriptor(), environment.getSharedMethodInfo(), body);

if (PRINT_AST_METHOD_NAMES.contains(methodName)) {
System.err.println(methodName);
System.err.println(sourceSection + " " + methodName);
NodeUtil.printCompactTree(System.err, rootNode);
}

if (PRINT_FULL_AST_METHOD_NAMES.contains(methodName)) {
System.err.println(methodName);
System.err.println(sourceSection + " " + methodName);
NodeUtil.printTree(System.err, rootNode);
}

Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeUtil;
import com.oracle.truffle.api.source.NullSourceSection;
import com.oracle.truffle.api.source.Source;
import com.oracle.truffle.api.source.SourceSection;
@@ -184,6 +185,21 @@ public RubyRootNode parse(Node currentNode, RubyContext context, Source source,

// Shell result

if (MethodTranslator.PRINT_PARSE_TREE_METHOD_NAMES.contains("main")) {
System.err.println(source.getShortName() + " main");
System.err.println(sharedMethodInfo.getParseTree().toString(true, 0));
}

if (MethodTranslator.PRINT_AST_METHOD_NAMES.contains("main")) {
System.err.println(source.getShortName() + " main");
NodeUtil.printCompactTree(System.err, truffleNode);
}

if (MethodTranslator.PRINT_FULL_AST_METHOD_NAMES.contains("main")) {
System.err.println(source.getShortName() + " main");
NodeUtil.printTree(System.err, truffleNode);
}

return new RubyRootNode(context, truffleNode.getSourceSection(), environment.getFrameDescriptor(), sharedMethodInfo, truffleNode);
}