@Override public CallBase specializeForInterpretation() { Operand[] callArgs = getCallArgs(); if (hasClosure() || containsSplat(callArgs)) return this; switch (callArgs.length) { case 0: return new ZeroOperandArgNoBlockCallInstr(this); case 1: if (isAllFixnums()) return new OneFixnumArgNoBlockCallInstr(this); return new OneOperandArgNoBlockCallInstr(this); } return this; }
@Override public CallBase specializeForInterpretation() { Operand[] callArgs = getCallArgs(); if (hasClosure() || containsSplat(callArgs)) return this; switch (callArgs.length) { case 0: return new ZeroOperandArgNoBlockCallInstr(this); case 1: if (isAllFixnums()) return new OneFixnumArgNoBlockCallInstr(this); return new OneOperandArgNoBlockCallInstr(this); } return this; }
@Override public Instr clone(CloneInfo ii) { return new OneFixnumArgNoBlockCallInstr(ii.getScope(), getCallType(), ii.getRenamedVariable(result), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), isPotentiallyRefined(), callSite, callSiteId); }
@Override public Instr clone(CloneInfo ii) { return new OneFixnumArgNoBlockCallInstr(ii.getScope(), getCallType(), ii.getRenamedVariable(result), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), isPotentiallyRefined(), callSite, callSiteId); }
public static CallInstr create(IRScope scope, CallType callType, Variable result, RubySymbol name, Operand receiver, Operand[] args, Operand closure) { boolean isPotentiallyRefined = scope.maybeUsingRefinements(); if (!containsArgSplat(args)) { boolean hasClosure = closure != null; if (args.length == 0 && !hasClosure) { return new ZeroOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } else if (args.length == 1) { if (hasClosure) return new OneOperandArgBlockCallInstr(scope, callType, result, name, receiver, args, closure, isPotentiallyRefined); if (isAllFixnums(args)) return new OneFixnumArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); if (isAllFloats(args)) return new OneFloatArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); return new OneOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } else if (args.length == 2 && !hasClosure) { return new TwoOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } } return new CallInstr(scope, callType, result, name, receiver, args, closure, isPotentiallyRefined); }
public static CallInstr create(IRScope scope, CallType callType, Variable result, RubySymbol name, Operand receiver, Operand[] args, Operand closure) { boolean isPotentiallyRefined = scope.maybeUsingRefinements(); if (!containsArgSplat(args)) { boolean hasClosure = closure != null; if (args.length == 0 && !hasClosure) { return new ZeroOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } else if (args.length == 1) { if (hasClosure) return new OneOperandArgBlockCallInstr(scope, callType, result, name, receiver, args, closure, isPotentiallyRefined); if (isAllFixnums(args)) return new OneFixnumArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); if (isAllFloats(args)) return new OneFloatArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); return new OneOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } else if (args.length == 2 && !hasClosure) { return new TwoOperandArgNoBlockCallInstr(scope, callType, result, name, receiver, args, isPotentiallyRefined); } } return new CallInstr(scope, callType, result, name, receiver, args, closure, isPotentiallyRefined); }