@Override public Instr cloneForBlockCloning(InlinerInfo ii) { return new ReceivePreReqdArgInstr(ii.getRenamedVariable(result), argIndex); }
@Override public Instr cloneForBlockCloning(InlinerInfo ii) { return new ReceivePreReqdArgInstr(ii.getRenamedVariable(result), argIndex); }
public static ReceivePreReqdArgInstr decode(IRReaderDecoder d) { return new ReceivePreReqdArgInstr(d.decodeVariable(), d.decodeInt()); }
public static ReceivePreReqdArgInstr decode(IRReaderDecoder d) { return new ReceivePreReqdArgInstr(d.decodeVariable(), d.decodeInt()); }
private void addArgReceiveInstr(IRScope s, Variable v, int argIndex, boolean post, int numPreReqd, int numPostRead) { if (post) s.addInstr(new ReceivePostReqdArgInstr(v, argIndex, numPreReqd, numPostRead)); else s.addInstr(new ReceivePreReqdArgInstr(v, argIndex)); }
private void addArgReceiveInstr(IRScope s, Variable v, int argIndex, boolean post, int numPreReqd, int numPostRead) { if (post) s.addInstr(new ReceivePostReqdArgInstr(v, argIndex, numPreReqd, numPostRead)); else s.addInstr(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(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)); } }
private void addArgReceiveInstr(Variable v, int argIndex, Signature signature) { boolean post = signature != null; if (post) { addInstr(new ReceivePostReqdArgInstr(v, argIndex, signature.pre(), signature.opt(), signature.hasRest(), signature.post())); } else { addInstr(new ReceivePreReqdArgInstr(v, argIndex)); } }
private void addArgReceiveInstr(Variable v, int argIndex, Signature signature) { boolean post = signature != null; if (post) { addInstr(new ReceivePostReqdArgInstr(v, argIndex, signature.pre(), signature.opt(), signature.hasRest(), signature.post())); } else { addInstr(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 ReceivePreReqdArgInstr(info.getRenamedVariable(result), argIndex); InlineCloneInfo ii = (InlineCloneInfo) info; if (ii.canMapArgsStatically()) return new CopyInstr(ii.getRenamedVariable(result), ii.getArg(argIndex)); return new ReqdArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), -1, -1, argIndex); }
@Override public Instr clone(CloneInfo info) { if (info instanceof SimpleCloneInfo) return new ReceivePreReqdArgInstr(info.getRenamedVariable(result), argIndex); InlineCloneInfo ii = (InlineCloneInfo) info; if (ii.canMapArgsStatically()) return new CopyInstr(ii.getRenamedVariable(result), ii.getArg(argIndex)); return new ReqdArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), -1, -1, argIndex); }
ArgumentNode a = (ArgumentNode)preArgs.get(i); String argName = a.getName(); s.addInstr(new ReceivePreReqdArgInstr(s.getLocalVariable(argName, 0), argIndex)); if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("req", argName);
ArgumentNode a = (ArgumentNode)preArgs.get(i); String argName = a.getName(); s.addInstr(new ReceivePreReqdArgInstr(s.getLocalVariable(argName, 0), argIndex)); if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("req", argName);