public OneFixnumArgNoBlockCallInstr(CallInstr call) { super(Operation.CALL_1F, call); assert getCallArgs().length == 1; this.fixNum = ((Fixnum) getCallArgs()[0]).value; }
public Operand getArg1() { return getCallArgs()[0]; }
public Operand getArg1() { return getCallArgs()[0]; }
@Override public Instr clone(CloneInfo ii) { return new OneOperandArgNoBlockNoResultCallInstr(ii.getScope(), getCallType(), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), getClosureArg() == null ? null : getClosureArg().cloneForInlining(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
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); }
@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 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; }
public static NoResultCallInstr create(IRScope scope, CallType callType, RubySymbol name, Operand receiver, Operand[] args, Operand closure, boolean isPotentiallyRefined) { if (closure == null && !containsArgSplat(args) && args.length == 1) { return new OneOperandArgNoBlockNoResultCallInstr(scope, callType, name, receiver, args, null, isPotentiallyRefined); } return new NoResultCallInstr(scope, Operation.NORESULT_CALL, callType, name, receiver, args, closure, isPotentiallyRefined); }
@Override public CallBase specializeForInterpretation() { Operand[] callArgs = getCallArgs(); if (containsSplat(callArgs)) return this; switch (callArgs.length) { case 1: return new OneArgOperandAttrAssignInstr(this); } return this; }
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); }
@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; }
public static NoResultCallInstr create(IRScope scope, CallType callType, RubySymbol name, Operand receiver, Operand[] args, Operand closure, boolean isPotentiallyRefined) { if (closure == null && !containsArgSplat(args) && args.length == 1) { return new OneOperandArgNoBlockNoResultCallInstr(scope, callType, name, receiver, args, null, isPotentiallyRefined); } return new NoResultCallInstr(scope, Operation.NORESULT_CALL, callType, name, receiver, args, closure, isPotentiallyRefined); }
public static AttrAssignInstr create(IRScope scope, Operand obj, RubySymbol attr, Operand[] args, boolean isPotentiallyRefined) { if (!containsArgSplat(args) && args.length == 1) { return new OneArgOperandAttrAssignInstr(scope, obj, attr, args, isPotentiallyRefined); } return new AttrAssignInstr(scope, obj, attr, args, isPotentiallyRefined); }
public OneFixnumArgNoBlockCallInstr(CallInstr call) { super(Operation.CALL_1F, call); assert getCallArgs().length == 1; this.fixNum = ((Fixnum) getCallArgs()[0]).value; }
public Operand getArg1() { return getCallArgs()[0]; }
public Operand getArg1() { return getCallArgs()[0]; }
@Override public CallBase specializeForInterpretation() { Operand[] callArgs = getCallArgs(); if (hasClosure() || containsSplat(callArgs)) return this; switch (callArgs.length) { // case 0: // return new ZeroOperandArgNoBlockNoResultCallInstr(this); case 1: // if (isAllFixnums()) return new OneFixnumArgNoBlockNoResultCallInstr(this); return new OneOperandArgNoBlockNoResultCallInstr(this); } return this; }
public static AttrAssignInstr create(IRScope scope, Operand obj, RubySymbol attr, Operand[] args, boolean isPotentiallyRefined) { if (!containsArgSplat(args) && args.length == 1) { return new OneArgOperandAttrAssignInstr(scope, obj, attr, args, isPotentiallyRefined); } return new AttrAssignInstr(scope, obj, attr, args, isPotentiallyRefined); }
@Override public CallBase specializeForInterpretation() { Operand[] callArgs = getCallArgs(); if (hasClosure() || containsSplat(callArgs)) return this; switch (callArgs.length) { // case 0: // return new ZeroOperandArgNoBlockNoResultCallInstr(this); case 1: // if (isAllFixnums()) return new OneFixnumArgNoBlockNoResultCallInstr(this); return new OneOperandArgNoBlockNoResultCallInstr(this); } return this; }
@Override public CallBase specializeForInterpretation() { Operand[] callArgs = getCallArgs(); if (containsSplat(callArgs)) return this; switch (callArgs.length) { case 1: return new OneArgOperandAttrAssignInstr(this); } return this; }