@Override public Instr clone(CloneInfo ii) { return new OneOperandArgNoBlockCallInstr(ii.getScope(), Operation.CALL_1O, getCallType(), ii.getRenamedVariable(result), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) { IRubyObject object = (IRubyObject) getReceiver().retrieve(context, self, currScope, dynamicScope, temp); IRubyObject arg1 = (IRubyObject) getArg1().retrieve(context, self, currScope, dynamicScope, temp); return getCallSite().call(context, self, object, arg1); } }
@Override public Object interpret(ThreadContext context, DynamicScope dynamicScope, IRubyObject self, Object[] temp, Block block) { IRubyObject object = (IRubyObject) receiver.retrieve(context, self, dynamicScope, temp); IRubyObject arg1 = (IRubyObject) getCallArgs()[0].retrieve(context, self, dynamicScope, temp); return getCallSite().call(context, self, object, arg1); } }
IRubyObject r = (IRubyObject)retrieveOp(call.getReceiver(), context, self, currDynScope, temp); IRubyObject o = (IRubyObject)call.getArg1().retrieve(context, self, currDynScope, temp); result = call.getCallSite().call(context, self, r, o); setResult(temp, currDynScope, call.getResult(), result); break;
@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 Operand getArg1() { return getCallArgs()[0]; }
IRubyObject r = (IRubyObject)retrieveOp(call.getReceiver(), context, self, currDynScope, temp); IRubyObject o = (IRubyObject)call.getArg1().retrieve(context, self, currDynScope, temp); result = call.getCallSite().call(context, self, r, o); setResult(temp, currDynScope, call.getResult(), result); break;
@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 Operand getArg1() { return getCallArgs()[0]; }
IRubyObject r = (IRubyObject)retrieveOp(call.getReceiver(), context, self, currDynScope, currScope, temp); IRubyObject o = (IRubyObject)call.getArg1().retrieve(context, self, currScope, currDynScope, temp); result = call.getCallSite().call(context, self, r, o); setResult(temp, currDynScope, call.getResult(), result); break;
@Override public Instr clone(CloneInfo ii) { return new OneOperandArgNoBlockCallInstr(ii.getScope(), Operation.CALL_1O, getCallType(), ii.getRenamedVariable(result), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) { IRubyObject object = (IRubyObject) getReceiver().retrieve(context, self, currScope, dynamicScope, temp); IRubyObject arg1 = (IRubyObject) getArg1().retrieve(context, self, currScope, dynamicScope, temp); return getCallSite().call(context, self, object, arg1); } }
@Override public Object interpret(ThreadContext context, DynamicScope dynamicScope, IRubyObject self, Object[] temp, Block block) { IRubyObject object = (IRubyObject) receiver.retrieve(context, self, dynamicScope, temp); IRubyObject arg1 = (IRubyObject) getCallArgs()[0].retrieve(context, self, dynamicScope, temp); return getCallSite().call(context, self, object, arg1); } }
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); }
IRubyObject r = (IRubyObject)retrieveOp(call.getReceiver(), context, self, currDynScope, currScope, temp); IRubyObject o = (IRubyObject)call.getArg1().retrieve(context, self, currScope, currDynScope, temp); result = call.getCallSite().call(context, self, r, o); setResult(temp, currDynScope, call.getResult(), result); break;
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); }