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

Commits on Aug 9, 2017

  1. allocating labels for lonely operator support even when the call was …

    …not part
    
    of a lonely operator (this fix reduces memory of an empty Rails app by 0.1%).
    enebo committed Aug 9, 2017
    Copy the full SHA
    299c306 View commit details
  2. Copy the full SHA
    8b35d30 View commit details
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/ast/CallNode.java
Original file line number Diff line number Diff line change
@@ -128,6 +128,11 @@ public Node getReceiverNode() {
return receiverNode;
}

/**
* Is this call lazily execute because it was on right hand side of the lonely (&.) operator?
*
* @return true if so.
*/
public boolean isLazy() {
return isLazy;
}
7 changes: 5 additions & 2 deletions core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -1061,9 +1061,12 @@ public Operand buildCall(Variable result, CallNode callNode) {
return result;
}

Label lazyLabel = getNewLabel();
Label endLabel = getNewLabel();
Label lazyLabel = null;
Label endLabel = null;

if (callNode.isLazy()) {
lazyLabel = getNewLabel();
endLabel = getNewLabel();
addInstr(new BNilInstr(lazyLabel, receiver));
}

2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/parser/ParserSupport.java
Original file line number Diff line number Diff line change
@@ -117,6 +117,8 @@ public Node arg_concat(ISourcePosition position, Node node1, Node node2) {
return node2 == null ? node1 : new ArgsCatNode(position, node1, node2);
}

// firstNode is ArgsCatNode, SplatNode, ArrayNode, HashNode
// secondNode is null or not
public Node arg_blk_pass(Node firstNode, BlockPassNode secondNode) {
if (secondNode != null) {
secondNode.setArgsNode(firstNode);
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/parser/RubyParser.y
Original file line number Diff line number Diff line change
@@ -1225,7 +1225,7 @@ opt_call_args : none
}


// [!null]
// [!null] - ArgsCatNode, SplatNode, ArrayNode, HashNode, BlockPassNode
call_args : command {
$$ = support.newArrayNode(support.getPosition($1), $1);
}
@@ -1243,6 +1243,7 @@ call_args : command {
| block_arg {
}

// [!null] - ArgsCatNode, SplatNode, ArrayNode, HashNode, BlockPassNode
command_args : /* none */ {
$$ = Long.valueOf(lexer.getCmdArgumentState().getStack());
lexer.getCmdArgumentState().begin();