@Override public Instr cloneForBlockCloning(InlinerInfo ii) { return new ReceiveRestArgInstr(ii.getRenamedVariable(result), numUsedArgs, argIndex); }
@Override public Instr cloneForBlockCloning(InlinerInfo ii) { return new ReceiveRestArgInstr(ii.getRenamedVariable(result), numUsedArgs, argIndex); }
public static ReceiveRestArgInstr decode(IRReaderDecoder d) { return new ReceiveRestArgInstr(d.decodeVariable(), d.decodeInt(), d.decodeInt()); }
public static ReceiveRestArgInstr decode(IRReaderDecoder d) { return new ReceiveRestArgInstr(d.decodeVariable(), 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)); } }
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)); } }
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); }
if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("rest", argName); argName = (argName.equals("")) ? "%_arg_array" : argName; s.addInstr(new ReceiveRestArgInstr(s.getLocalVariable(argName, 0), argIndex, argIndex));
if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("rest", argName); argName = (argName.equals("")) ? "%_arg_array" : argName; s.addInstr(new ReceiveRestArgInstr(s.getLocalVariable(argName, 0), argIndex, argIndex));
s.addInstr(new ReceiveRestArgInstr(s.getNewLocalVariable(argName, 0), required + opt, argIndex)); argIndex++;
s.addInstr(new ReceiveRestArgInstr(s.getNewLocalVariable(argName, 0), required + opt, argIndex)); argIndex++;
addInstr(new ReceiveRestArgInstr(argumentResult(argName), signature.required() + opt, argIndex));
addInstr(new ReceiveRestArgInstr(argumentResult(argName), signature.required() + opt, argIndex));