@Override public Instr cloneForBlockCloning(InlinerInfo ii) { // Added this copy for code clarity // argIndex is relative to start of opt args and not the start of arg array int optArgIndex = this.argIndex; return new ReceiveOptArgInstr(ii.getRenamedVariable(result), numUsedArgs, argOffset, optArgIndex); }
@Override public Instr cloneForBlockCloning(InlinerInfo ii) { // Added this copy for code clarity // argIndex is relative to start of opt args and not the start of arg array int optArgIndex = this.argIndex; return new ReceiveOptArgInstr(ii.getRenamedVariable(result), numUsedArgs, argOffset, optArgIndex); }
public static ReceiveOptArgInstr decode(IRReaderDecoder d) { return new ReceiveOptArgInstr(d.decodeVariable(), d.decodeInt(), d.decodeInt(), d.decodeInt()); }
public static ReceiveOptArgInstr decode(IRReaderDecoder d) { return new ReceiveOptArgInstr(d.decodeVariable(), d.decodeInt(), d.decodeInt(), d.decodeInt()); }
@Override public Instr clone(CloneInfo info) { int optArgIndex = this.argIndex; if (info instanceof SimpleCloneInfo) return new ReceiveOptArgInstr(info.getRenamedVariable(result), requiredArgs, preArgs, optArgIndex); InlineCloneInfo ii = (InlineCloneInfo) info; // SSS FIXME: Need to add kwArgLoss information in InlinerInfo // Added this copy for code clarity // argIndex is relative to start of opt args and not the start of arg array int minReqdArgs = optArgIndex + requiredArgs; if (ii.canMapArgsStatically()) { int n = ii.getArgsCount(); return new CopyInstr(ii.getRenamedVariable(result), minReqdArgs < n ? ii.getArg(preArgs + optArgIndex) : UndefinedValue.UNDEFINED); } return new OptArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), preArgs + optArgIndex, minReqdArgs); }
@Override public Instr clone(CloneInfo info) { int optArgIndex = this.argIndex; if (info instanceof SimpleCloneInfo) return new ReceiveOptArgInstr(info.getRenamedVariable(result), requiredArgs, preArgs, optArgIndex); InlineCloneInfo ii = (InlineCloneInfo) info; // SSS FIXME: Need to add kwArgLoss information in InlinerInfo // Added this copy for code clarity // argIndex is relative to start of opt args and not the start of arg array int minReqdArgs = optArgIndex + requiredArgs; if (ii.canMapArgsStatically()) { int n = ii.getArgsCount(); return new CopyInstr(ii.getRenamedVariable(result), minReqdArgs < n ? ii.getArg(preArgs + optArgIndex) : UndefinedValue.UNDEFINED); } return new OptArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), preArgs + optArgIndex, minReqdArgs); }
protected int receiveOptArgs(final ArgsNode argsNode, IRScope s, int opt, int argIndex) { ListNode optArgs = argsNode.getOptArgs(); for (int j = 0; j < opt; j++, argIndex++) { // Jump to 'l' if this arg is not null. If null, fall through and build the default value! Label l = s.getNewLabel(); LocalAsgnNode n = (LocalAsgnNode)optArgs.get(j); String argName = n.getName(); Variable av = s.getLocalVariable(argName, 0); if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("opt", argName); s.addInstr(new ReceiveOptArgInstr(av, argIndex-j, argIndex-j, j)); s.addInstr(BNEInstr.create(av, UndefinedValue.UNDEFINED, l)); // if 'av' is not undefined, go to default build(n, s); s.addInstr(new LabelInstr(l)); } return argIndex; }
protected int receiveOptArgs(final ArgsNode argsNode, IRScope s, int opt, int argIndex) { ListNode optArgs = argsNode.getOptArgs(); for (int j = 0; j < opt; j++, argIndex++) { // Jump to 'l' if this arg is not null. If null, fall through and build the default value! Label l = s.getNewLabel(); LocalAsgnNode n = (LocalAsgnNode)optArgs.get(j); String argName = n.getName(); Variable av = s.getLocalVariable(argName, 0); if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("opt", argName); s.addInstr(new ReceiveOptArgInstr(av, argIndex-j, argIndex-j, j)); s.addInstr(BNEInstr.create(av, UndefinedValue.UNDEFINED, l)); // if 'av' is not undefined, go to default build(n, s); s.addInstr(new LabelInstr(l)); } return argIndex; }
if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("opt", argName); s.addInstr(new ReceiveOptArgInstr(av, required, numPreReqd, j));
if (s instanceof IRMethod) ((IRMethod)s).addArgDesc("opt", argName); s.addInstr(new ReceiveOptArgInstr(av, required, numPreReqd, j));
if (scope instanceof IRMethod) addArgumentDescription(ArgumentType.opt, argName); addInstr(new ReceiveOptArgInstr(argVar, signature.required(), signature.pre(), j)); addInstr(BNEInstr.create(variableAssigned, argVar, UndefinedValue.UNDEFINED));
if (scope instanceof IRMethod) addArgumentDescription(ArgumentType.opt, argName); addInstr(new ReceiveOptArgInstr(argVar, signature.required(), signature.pre(), j)); addInstr(BNEInstr.create(variableAssigned, argVar, UndefinedValue.UNDEFINED));