Skip to content

Commit

Permalink
Remove one more piece of 1.8 support from IRBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
subbuss committed Feb 9, 2015
1 parent c8f306c commit 6c9db70
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions core/src/main/java/org/jruby/ir/IRBuilder.java
Expand Up @@ -386,7 +386,6 @@ private Operand buildOperand(Node node) throws NotCompilableException {
case MATCH3NODE: return buildMatch3((Match3Node) node);
case MATCHNODE: return buildMatch((MatchNode) node);
case MODULENODE: return buildModule((ModuleNode) node);
case MULTIPLEASGNNODE: return buildMultipleAsgn((MultipleAsgnNode) node); // Only for 1.8
case MULTIPLEASGN19NODE: return buildMultipleAsgn19((MultipleAsgn19Node) node);
case NEWLINENODE: return buildNewline((NewlineNode) node);
case NEXTNODE: return buildNext((NextNode) node);
Expand Down Expand Up @@ -2627,50 +2626,6 @@ public Operand buildModule(ModuleNode moduleNode) {
return processBodyResult;
}

public Operand buildMultipleAsgn(MultipleAsgnNode multipleAsgnNode) {
Operand values = build(multipleAsgnNode.getValueNode());
Variable ret = getValueInTemporaryVariable(values);
buildMultipleAsgnAssignment(multipleAsgnNode, null, ret);
return ret;
}

// This method is called both for regular multiple assignment as well as argument passing
//
// Ex: a,b,*c=v is a regular assignment and in this case, the "values" operand will be non-null
// Ex: { |a,b,*c| ..} is the argument passing case
public void buildMultipleAsgnAssignment(final MultipleAsgnNode multipleAsgnNode, Operand argsArray, Operand values) {
final ListNode sourceArray = multipleAsgnNode.getHeadNode();

// First, build assignments for specific named arguments
int i = 0;
if (sourceArray != null) {
for (Node an: sourceArray.childNodes()) {
if (values == null) {
buildBlockArgsAssignment(an, argsArray, i, false);
} else {
Variable rhsVal = addResultInstr(new ReqdArgMultipleAsgnInstr(createTemporaryVariable(), values, i));
buildAssignment(an, rhsVal);
}
i++;
}
}

// First, build an assignment for a splat, if any, with the rest of the args!
Node argsNode = multipleAsgnNode.getArgsNode();
if (argsNode == null) {
if (sourceArray == null) {
throw new NotCompilableException("Something's wrong, multiple assignment with no head or args at: " + multipleAsgnNode.getPosition());
}
} else if (!(argsNode instanceof StarNode)) {
if (values != null) {
buildAssignment(argsNode, // rest of the argument array!
addResultInstr(new RestArgMultipleAsgnInstr(createTemporaryVariable(), values, i)));
} else {
buildBlockArgsAssignment(argsNode, argsArray, i, true); // rest of the argument array!
}
}
}

public Operand buildNewline(NewlineNode node) {
return build(skipOverNewlines(node));
}
Expand Down

0 comments on commit 6c9db70

Please sign in to comment.