case ATTRASSIGNNODE: v = s.getNewTemporaryVariable(); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); buildAttrAssignAssignment(node, s, v); break; DAsgnNode dynamicAsgn = (DAsgnNode) node; v = getBlockArgVariable((IRClosure)s, dynamicAsgn.getName(), dynamicAsgn.getDepth()); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); break; receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); s.addInstr(new PutClassVariableInstr(classVarDefinitionContainer(s), ((ClassVarAsgnNode)node).getName(), v)); break; case CLASSVARDECLNODE: v = s.getNewTemporaryVariable(); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); s.addInstr(new PutClassVariableInstr(classVarDeclarationContainer(s), ((ClassVarDeclNode)node).getName(), v)); break; case CONSTDECLNODE: v = s.getNewTemporaryVariable(); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); buildConstDeclAssignment((ConstDeclNode) node, s, v); break; case GLOBALASGNNODE: v = s.getNewTemporaryVariable(); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); s.addInstr(new PutGlobalVarInstr(((GlobalAsgnNode)node).getName(), v)); break;
case ATTRASSIGNNODE: v = createTemporaryVariable(); receiveBlockArg(v, argsArray, argIndex, isSplat); buildAttrAssignAssignment(node, v); break; DAsgnNode dynamicAsgn = (DAsgnNode) node; v = getBlockArgVariable(dynamicAsgn.getName(), dynamicAsgn.getDepth()); receiveBlockArg(v, argsArray, argIndex, isSplat); break; receiveBlockArg(v, argsArray, argIndex, isSplat); addInstr(new PutClassVariableInstr(classVarDefinitionContainer(), ((ClassVarAsgnNode)node).getName(), v)); break; case CONSTDECLNODE: v = createTemporaryVariable(); receiveBlockArg(v, argsArray, argIndex, isSplat); buildConstDeclAssignment((ConstDeclNode) node, v); break; case GLOBALASGNNODE: v = createTemporaryVariable(); receiveBlockArg(v, argsArray, argIndex, isSplat); addInstr(new PutGlobalVarInstr(((GlobalAsgnNode)node).getName(), v)); break; case INSTASGNNODE: v = createTemporaryVariable(); receiveBlockArg(v, argsArray, argIndex, isSplat); LocalAsgnNode localVariable = (LocalAsgnNode) node;
case ATTRASSIGNNODE: v = createTemporaryVariable(); receiveBlockArg(v, argsArray, argIndex, isSplat); buildAttrAssignAssignment(node, v); break; DAsgnNode dynamicAsgn = (DAsgnNode) node; v = getBlockArgVariable(dynamicAsgn.getName(), dynamicAsgn.getDepth()); receiveBlockArg(v, argsArray, argIndex, isSplat); break; receiveBlockArg(v, argsArray, argIndex, isSplat); addInstr(new PutClassVariableInstr(classVarDefinitionContainer(), ((ClassVarAsgnNode)node).getName(), v)); break; case CONSTDECLNODE: v = createTemporaryVariable(); receiveBlockArg(v, argsArray, argIndex, isSplat); buildConstDeclAssignment((ConstDeclNode) node, v); break; case GLOBALASGNNODE: v = createTemporaryVariable(); receiveBlockArg(v, argsArray, argIndex, isSplat); addInstr(new PutGlobalVarInstr(((GlobalAsgnNode)node).getName(), v)); break; case INSTASGNNODE: v = createTemporaryVariable(); receiveBlockArg(v, argsArray, argIndex, isSplat); LocalAsgnNode localVariable = (LocalAsgnNode) node;
case ATTRASSIGNNODE: v = s.getNewTemporaryVariable(); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); buildAttrAssignAssignment(node, s, v); break; DAsgnNode dynamicAsgn = (DAsgnNode) node; v = getBlockArgVariable((IRClosure)s, dynamicAsgn.getName(), dynamicAsgn.getDepth()); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); break; receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); s.addInstr(new PutClassVariableInstr(classVarDefinitionContainer(s), ((ClassVarAsgnNode)node).getName(), v)); break; case CLASSVARDECLNODE: v = s.getNewTemporaryVariable(); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); s.addInstr(new PutClassVariableInstr(classVarDeclarationContainer(s), ((ClassVarDeclNode)node).getName(), v)); break; case CONSTDECLNODE: v = s.getNewTemporaryVariable(); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); buildConstDeclAssignment((ConstDeclNode) node, s, v); break; case GLOBALASGNNODE: v = s.getNewTemporaryVariable(); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); s.addInstr(new PutGlobalVarInstr(((GlobalAsgnNode)node).getName(), v)); break;
public void buildVersionSpecificBlockArgsAssignment(Node node, IRScope s, Operand argsArray, int argIndex, boolean isMasgnRoot, boolean isClosureArg, boolean isSplat) { switch (node.getNodeType()) { case MULTIPLEASGNNODE: { Variable oldArgs = null; MultipleAsgnNode childNode = (MultipleAsgnNode) node; if (!isMasgnRoot) { // Vars used to receive args should always be local-variables because // these arg values may need to be accessed by some zsuper instruction. // During interpretation, only local-vars are accessible (at least right now) // outside the scope they are defined in. Variable v = s.getLocalVariable("%_masgn_arg_" + argIndex, 0); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); boolean runToAry = childNode.getHeadNode() != null && (((ListNode)childNode.getHeadNode()).childNodes().size() > 0); if (runToAry) { s.addInstr(new ToAryInstr(v, v, manager.getFalse())); } else { s.addInstr(new EnsureRubyArrayInstr(v, v)); } argsArray = v; // SSS FIXME: Are we guaranteed that splats dont head to multiple-assignment nodes! i.e. |*(a,b)|? } // Build buildMultipleAsgnAssignment(childNode, s, argsArray, null); break; } default: throw new NotCompilableException("Can't build assignment node: " + node); } }
public void buildVersionSpecificBlockArgsAssignment(Node node, IRScope s, Operand argsArray, int argIndex, boolean isMasgnRoot, boolean isClosureArg, boolean isSplat) { switch (node.getNodeType()) { case MULTIPLEASGNNODE: { Variable oldArgs = null; MultipleAsgnNode childNode = (MultipleAsgnNode) node; if (!isMasgnRoot) { // Vars used to receive args should always be local-variables because // these arg values may need to be accessed by some zsuper instruction. // During interpretation, only local-vars are accessible (at least right now) // outside the scope they are defined in. Variable v = s.getLocalVariable("%_masgn_arg_" + argIndex, 0); receiveBlockArg(s, v, argsArray, argIndex, isClosureArg, isSplat); boolean runToAry = childNode.getHeadNode() != null && (((ListNode)childNode.getHeadNode()).childNodes().size() > 0); if (runToAry) { s.addInstr(new ToAryInstr(v, v, manager.getFalse())); } else { s.addInstr(new EnsureRubyArrayInstr(v, v)); } argsArray = v; // SSS FIXME: Are we guaranteed that splats dont head to multiple-assignment nodes! i.e. |*(a,b)|? } // Build buildMultipleAsgnAssignment(childNode, s, argsArray, null); break; } default: throw new NotCompilableException("Can't build assignment node: " + node); } }
receiveBlockArg(argsNode);