private InterpreterContext buildLambdaInner(LambdaNode node) { prepareImplicitState(); // recv_self, add frame block, etc) addCurrentScopeAndModule(); // %current_scope/%current_module receiveBlockArgs(node); Operand closureRetVal = node.getBody() == null ? manager.getNil() : build(node.getBody()); // can be U_NIL if the node is an if node with returns in both branches. if (closureRetVal != U_NIL) addInstr(new ReturnInstr(closureRetVal)); handleBreakAndReturnsInLambdas(); return scope.allocateInterpreterContext(instructions); }
private InterpreterContext buildLambdaInner(LambdaNode node) { prepareImplicitState(); // recv_self, add frame block, etc) addCurrentScopeAndModule(); // %current_scope/%current_module receiveBlockArgs(node); Operand closureRetVal = node.getBody() == null ? manager.getNil() : build(node.getBody()); // can be U_NIL if the node is an if node with returns in both branches. if (closureRetVal != U_NIL) addInstr(new ReturnInstr(closureRetVal)); handleBreakAndReturnsInLambdas(); return scope.allocateInterpreterContext(instructions); }
private InterpreterContext buildIterInner(IterNode iterNode) { prepareImplicitState(); // recv_self, add frame block, etc) addCurrentScopeAndModule(); // %current_scope/%current_module if (iterNode.getVarNode().getNodeType() != null) receiveBlockArgs(iterNode); addInstr(new LabelInstr(((IRClosure) scope).startLabel)); // start label -- used by redo! // Build closure body and return the result of the closure Operand closureRetVal = iterNode.getBodyNode() == null ? manager.getNil() : build(iterNode.getBodyNode()); if (closureRetVal != U_NIL) { // can be U_NIL if the node is an if node with returns in both branches. addInstr(new ReturnInstr(closureRetVal)); } // Always add break/return handling even though this // is only required for lambdas, but we don't know at this time, // if this is a lambda or not. // // SSS FIXME: At a later time, see if we can optimize this and // do this on demand. handleBreakAndReturnsInLambdas(); return scope.allocateInterpreterContext(instructions); } public Operand buildIter(final IterNode iterNode) {
private InterpreterContext buildIterInner(IterNode iterNode) { prepareImplicitState(); // recv_self, add frame block, etc) addCurrentScopeAndModule(); // %current_scope/%current_module if (iterNode.getVarNode().getNodeType() != null) receiveBlockArgs(iterNode); addInstr(new LabelInstr(((IRClosure) scope).startLabel)); // start label -- used by redo! // Build closure body and return the result of the closure Operand closureRetVal = iterNode.getBodyNode() == null ? manager.getNil() : build(iterNode.getBodyNode()); if (closureRetVal != U_NIL) { // can be U_NIL if the node is an if node with returns in both branches. addInstr(new ReturnInstr(closureRetVal)); } // Always add break/return handling even though this // is only required for lambdas, but we don't know at this time, // if this is a lambda or not. // // SSS FIXME: At a later time, see if we can optimize this and // do this on demand. handleBreakAndReturnsInLambdas(); return scope.allocateInterpreterContext(instructions); } public Operand buildIter(final IterNode iterNode) {