@Override public Instr cloneForInlining(InlinerInfo ii) { return new RestArgMultipleAsgnInstr(ii.getRenamedVariable(result), array.cloneForInlining(ii), preArgsCount, postArgsCount, index); }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new RestArgMultipleAsgnInstr(ii.getRenamedVariable(result), array.cloneForInlining(ii), preArgsCount, postArgsCount, index); }
@Override public Instr clone(CloneInfo ii) { return new RestArgMultipleAsgnInstr(ii.getRenamedVariable(result), getArray().cloneForInlining(ii), preArgsCount, postArgsCount, index); }
@Override public Instr clone(CloneInfo ii) { return new RestArgMultipleAsgnInstr(ii.getRenamedVariable(result), getArray().cloneForInlining(ii), preArgsCount, postArgsCount, index); }
public static RestArgMultipleAsgnInstr decode(IRReaderDecoder d) { return new RestArgMultipleAsgnInstr(d.decodeVariable(), d.decodeOperand(), d.decodeInt(), d.decodeInt(), d.decodeInt()); }
public static RestArgMultipleAsgnInstr decode(IRReaderDecoder d) { return new RestArgMultipleAsgnInstr(d.decodeVariable(), d.decodeOperand(), d.decodeInt(), d.decodeInt(), d.decodeInt()); }
protected void receiveBlockArg(Variable v, Operand argsArray, int argIndex, boolean isSplat) { if (argsArray != null) { // We are in a nested receive situation -- when we are not at the root of a masgn tree // Ex: We are trying to receive (b,c) in this example: "|a, (b,c), d| = ..." if (isSplat) addInstr(new RestArgMultipleAsgnInstr(v, argsArray, argIndex)); else addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, argIndex)); } else { // argsArray can be null when the first node in the args-node-ast is a multiple-assignment // For example, for-nodes addInstr(isSplat ? new ReceiveRestArgInstr(v, argIndex, argIndex) : new ReceivePreReqdArgInstr(v, argIndex)); } }
@Override public Instr cloneForInlining(InlinerInfo ii) { if (ii.canMapArgsStatically()) { // FIXME: Check this return new CopyInstr(ii.getRenamedVariable(result), ii.getArg(argIndex, true)); } else { return new RestArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), argIndex, (numUsedArgs - argIndex), argIndex); } }
protected void receiveBlockArg(Variable v, Operand argsArray, int argIndex, boolean isSplat) { if (argsArray != null) { // We are in a nested receive situation -- when we are not at the root of a masgn tree // Ex: We are trying to receive (b,c) in this example: "|a, (b,c), d| = ..." if (isSplat) addInstr(new RestArgMultipleAsgnInstr(v, argsArray, argIndex)); else addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, argIndex)); } else { // argsArray can be null when the first node in the args-node-ast is a multiple-assignment // For example, for-nodes addInstr(isSplat ? new ReceiveRestArgInstr(v, argIndex, argIndex) : new ReceivePreReqdArgInstr(v, argIndex)); } }
@Override public Instr cloneForInlining(InlinerInfo ii) { if (ii.canMapArgsStatically()) { // FIXME: Check this return new CopyInstr(ii.getRenamedVariable(result), ii.getArg(argIndex, true)); } else { return new RestArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), argIndex, (numUsedArgs - argIndex), argIndex); } }
protected void receiveBlockArg(IRScope s, Variable v, Operand argsArray, int argIndex, boolean isClosureArg, boolean isSplat) { if (argsArray != null) { // We are in a nested receive situation -- when we are not at the root of a masgn tree // Ex: We are trying to receive (b,c) in this example: "|a, (b,c), d| = ..." if (isSplat) s.addInstr(new RestArgMultipleAsgnInstr(v, argsArray, argIndex)); else s.addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, argIndex)); } else { // argsArray can be null when the first node in the args-node-ast is a multiple-assignment // For example, for-nodes s.addInstr(isClosureArg ? new ReceiveClosureInstr(v) : (isSplat ? new ReceiveRestArgInstr(v, argIndex, argIndex) : new ReceivePreReqdArgInstr(v, argIndex))); } }
protected void receiveBlockArg(IRScope s, Variable v, Operand argsArray, int argIndex, boolean isClosureArg, boolean isSplat) { if (argsArray != null) { // We are in a nested receive situation -- when we are not at the root of a masgn tree // Ex: We are trying to receive (b,c) in this example: "|a, (b,c), d| = ..." if (isSplat) s.addInstr(new RestArgMultipleAsgnInstr(v, argsArray, argIndex)); else s.addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, argIndex)); } else { // argsArray can be null when the first node in the args-node-ast is a multiple-assignment // For example, for-nodes s.addInstr(isClosureArg ? new ReceiveClosureInstr(v) : (isSplat ? new ReceiveRestArgInstr(v, argIndex, argIndex) : new ReceivePreReqdArgInstr(v, argIndex))); } }
@Override public Instr clone(CloneInfo info) { if (info instanceof SimpleCloneInfo) return new ReceiveRestArgInstr(info.getRenamedVariable(result), required, argIndex); InlineCloneInfo ii = (InlineCloneInfo) info; // FIXME: Check this if (ii.canMapArgsStatically()) return new CopyInstr(ii.getRenamedVariable(result), ii.getArg(argIndex, true)); return new RestArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), argIndex, (required - argIndex), argIndex); }
@Override public Instr clone(CloneInfo info) { if (info instanceof SimpleCloneInfo) return new ReceiveRestArgInstr(info.getRenamedVariable(result), required, argIndex); InlineCloneInfo ii = (InlineCloneInfo) info; // FIXME: Check this if (ii.canMapArgsStatically()) return new CopyInstr(ii.getRenamedVariable(result), ii.getArg(argIndex, true)); return new RestArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), argIndex, (required - argIndex), argIndex); }
DAsgnNode dynamicAsgn = (DAsgnNode) node; v = getArgVariable(dynamicAsgn.getName(), dynamicAsgn.getDepth()); if (isSplat) addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); break; LocalAsgnNode localVariable = (LocalAsgnNode) node; v = getArgVariable(localVariable.getName(), localVariable.getDepth()); if (isSplat) addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); break; if (!isMasgnRoot) { v = createTemporaryVariable(); if (isSplat) addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); Variable tmp = createTemporaryVariable();
DAsgnNode dynamicAsgn = (DAsgnNode) node; v = getArgVariable(dynamicAsgn.getName(), dynamicAsgn.getDepth()); if (isSplat) addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); break; LocalAsgnNode localVariable = (LocalAsgnNode) node; v = getArgVariable(localVariable.getName(), localVariable.getDepth()); if (isSplat) addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); break; if (!isMasgnRoot) { v = createTemporaryVariable(); if (isSplat) addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); Variable tmp = createTemporaryVariable();
DAsgnNode dynamicAsgn = (DAsgnNode) node; v = getArgVariable(s, dynamicAsgn.getName(), dynamicAsgn.getDepth()); if (isSplat) s.addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else s.addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); break; LocalAsgnNode localVariable = (LocalAsgnNode) node; v = getArgVariable(s, localVariable.getName(), localVariable.getDepth()); if (isSplat) s.addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else s.addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); break; if (!isMasgnRoot) { v = s.getNewTemporaryVariable(); if (isSplat) s.addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else s.addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); s.addInstr(new ToAryInstr(v, v, manager.getFalse()));
DAsgnNode dynamicAsgn = (DAsgnNode) node; v = getArgVariable(s, dynamicAsgn.getName(), dynamicAsgn.getDepth()); if (isSplat) s.addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else s.addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); break; LocalAsgnNode localVariable = (LocalAsgnNode) node; v = getArgVariable(s, localVariable.getName(), localVariable.getDepth()); if (isSplat) s.addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else s.addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); break; if (!isMasgnRoot) { v = s.getNewTemporaryVariable(); if (isSplat) s.addInstr(new RestArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); else s.addInstr(new ReqdArgMultipleAsgnInstr(v, argsArray, preArgsCount, postArgsCount, index)); s.addInstr(new ToAryInstr(v, v, manager.getFalse()));
s.addInstr(new RestArgMultipleAsgnInstr(rhsVal, values, i));
s.addInstr(new RestArgMultipleAsgnInstr(rhsVal, values, i));