@Override public Instr cloneForInlinedScope(InlinerInfo ii) { if (ii.canMapArgsStatically()) { // Since we know arity at a callsite, arity check passes or we have an ArgumentError int numArgs = ii.getArgsCount(); if ((numArgs < required) || ((rest == -1) && (numArgs > (required + opt)))) { return new RaiseArgumentErrorInstr(required, opt, rest, rest); } return null; } else { return new CheckArgsArrayArityInstr(ii.getArgs(), required, opt, rest); } }
@Override public Instr cloneForInlinedScope(InlinerInfo ii) { if (ii.canMapArgsStatically()) { // Since we know arity at a callsite, arity check passes or we have an ArgumentError int numArgs = ii.getArgsCount(); if ((numArgs < required) || ((rest == -1) && (numArgs > (required + opt)))) { return new RaiseArgumentErrorInstr(required, opt, rest, rest); } return null; } else { return new CheckArgsArrayArityInstr(ii.getArgs(), required, opt, rest); } }
@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); } }
@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); } }
@Override public Instr cloneForInlinedScope(InlinerInfo ii) { if (ii.canMapArgsStatically()) { return new CopyInstr(ii.getRenamedVariable(result), ii.getArg(argIndex)); } else { return new ReqdArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), -1, -1, argIndex); } }
@Override public Instr cloneForInlinedScope(InlinerInfo ii) { if (ii.canMapArgsStatically()) { return new CopyInstr(ii.getRenamedVariable(result), ii.getArg(argIndex)); } else { return new ReqdArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), -1, -1, argIndex); } }
@Override public Instr cloneForInlining(InlinerInfo ii) { // 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 optArgIndex = this.argIndex; int minReqdArgs = optArgIndex + numUsedArgs; if (ii.canMapArgsStatically()) { int n = ii.getArgsCount(); return new CopyInstr(ii.getRenamedVariable(result), minReqdArgs < n ? ii.getArg(argOffset + optArgIndex) : UndefinedValue.UNDEFINED); } else { return new OptArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), argOffset + optArgIndex, minReqdArgs); } }
@Override public Instr cloneForInlining(InlinerInfo ii) { // 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 optArgIndex = this.argIndex; int minReqdArgs = optArgIndex + numUsedArgs; if (ii.canMapArgsStatically()) { int n = ii.getArgsCount(); return new CopyInstr(ii.getRenamedVariable(result), minReqdArgs < n ? ii.getArg(argOffset + optArgIndex) : UndefinedValue.UNDEFINED); } else { return new OptArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), argOffset + optArgIndex, minReqdArgs); } }
@Override public Instr cloneForInlinedScope(InlinerInfo ii) { if (ii.canMapArgsStatically()) { int n = ii.getArgsCount(); int remaining = n - preReqdArgsCount; Operand argVal; if (remaining <= argIndex) { // SSS: FIXME: Argh! argVal = ii.getInlineHostScope().getManager().getNil(); } else { argVal = (remaining > postReqdArgsCount) ? ii.getArg(n - postReqdArgsCount + argIndex) : ii.getArg(preReqdArgsCount + argIndex); } return new CopyInstr(ii.getRenamedVariable(result), argVal); } else { return new ReqdArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), preReqdArgsCount, postReqdArgsCount, argIndex); } }
@Override public Instr cloneForInlinedScope(InlinerInfo ii) { if (ii.canMapArgsStatically()) { int n = ii.getArgsCount(); int remaining = n - preReqdArgsCount; Operand argVal; if (remaining <= argIndex) { // SSS: FIXME: Argh! argVal = ii.getInlineHostScope().getManager().getNil(); } else { argVal = (remaining > postReqdArgsCount) ? ii.getArg(n - postReqdArgsCount + argIndex) : ii.getArg(preReqdArgsCount + argIndex); } return new CopyInstr(ii.getRenamedVariable(result), argVal); } else { return new ReqdArgMultipleAsgnInstr(ii.getRenamedVariable(result), ii.getArgs(), preReqdArgsCount, postReqdArgsCount, argIndex); } }
if (destination != mExit) { BasicBlock dstBB = ii.getRenamedBB(destination); if (!ii.canMapArgsStatically()) { dstBB.addInstr(new ToAryInstr((Variable)ii.getArgs(), new Array(call.getCallArgs()), cfg.getScope().getManager().getTrue()));
if (destination != mExit) { BasicBlock dstBB = ii.getRenamedBB(destination); if (!ii.canMapArgsStatically()) { dstBB.addInstr(new ToAryInstr((Variable)ii.getArgs(), new Array(call.getCallArgs()), cfg.getScope().getManager().getTrue()));