@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 Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) { IRubyObject object = (IRubyObject) getReceiver().retrieve(context, self, currScope, dynamicScope, temp); return getCallSite().call(context, self, object, fixNum); } }
public OneFixnumArgNoBlockCallInstr(CallInstr call) { super(Operation.CALL_1F, call); assert getCallArgs().length == 1; this.fixNum = ((Fixnum) getCallArgs()[0]).value; }
IRubyObject r = (IRubyObject)retrieveOp(call.getReceiver(), context, self, currDynScope, temp); result = call.getCallSite().call(context, self, r, call.getFixnumArg()); setResult(temp, currDynScope, call.getResult(), result); break;
public void oneFixnumArgNoBlockCallInstr(OneFixnumArgNoBlockCallInstr oneFixnumArgNoBlockCallInstr) { IRBytecodeAdapter m = jvmMethod(); long fixnum = oneFixnumArgNoBlockCallInstr.getFixnumArg(); Operand receiver = oneFixnumArgNoBlockCallInstr.getReceiver(); Variable result = oneFixnumArgNoBlockCallInstr.getResult(); m.loadContext(); // for visibility checking without requiring frame self // TODO: don't bother passing when fcall or vcall, and adjust callsite appropriately m.loadSelf(); // caller visit(receiver); m.invokeOtherOneFixnum(file, lastLine, oneFixnumArgNoBlockCallInstr, fixnum); if (result != null) { jvmStoreLocal(result); } else { // still need to drop, since all dyncalls return something (FIXME) m.adapter.pop(); } }
@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 Object interpret(ThreadContext context, DynamicScope dynamicScope, IRubyObject self, Object[] temp, Block block) { IRubyObject object = (IRubyObject) receiver.retrieve(context, self, dynamicScope, temp); return getCallSite().call(context, self, object, fixNum); } }
IRubyObject r = (IRubyObject)retrieveOp(call.getReceiver(), context, self, currDynScope, temp); result = call.getCallSite().call(context, self, r, call.getFixnumArg()); setResult(temp, currDynScope, call.getResult(), result); break;
public void oneFixnumArgNoBlockCallInstr(OneFixnumArgNoBlockCallInstr oneFixnumArgNoBlockCallInstr) { IRBytecodeAdapter m = jvmMethod(); long fixnum = oneFixnumArgNoBlockCallInstr.getFixnumArg(); Operand receiver = oneFixnumArgNoBlockCallInstr.getReceiver(); Variable result = oneFixnumArgNoBlockCallInstr.getResult(); m.loadContext(); // for visibility checking without requiring frame self // TODO: don't bother passing when fcall or vcall, and adjust callsite appropriately m.loadSelf(); // caller visit(receiver); m.invokeOtherOneFixnum(file, lastLine, oneFixnumArgNoBlockCallInstr, fixnum); if (result != null) { jvmStoreLocal(result); } else { // still need to drop, since all dyncalls return something (FIXME) m.adapter.pop(); } }
@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 Object interpret(ThreadContext context, DynamicScope dynamicScope, IRubyObject self, Object[] temp, Block block) { IRubyObject object = (IRubyObject) receiver.retrieve(context, self, dynamicScope, temp); return getCallSite().call(context, self, object, fixNum); } }
case CALL_1F: { OneFixnumArgNoBlockCallInstr call = (OneFixnumArgNoBlockCallInstr)instr; IRubyObject r = (IRubyObject)retrieveOp(call.getReceiver(), context, self, currDynScope, currScope, temp); result = call.getCallSite().call(context, self, r, call.getFixnumArg()); setResult(temp, currDynScope, call.getResult(), result); break;
@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 Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) { IRubyObject object = (IRubyObject) getReceiver().retrieve(context, self, currScope, dynamicScope, temp); return getCallSite().call(context, self, object, fixNum); } }
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 OneFixnumArgNoBlockCallInstr(CallInstr call) { super(Operation.CALL_1F, call); assert getCallArgs().length == 1; this.fixNum = ((Fixnum) getCallArgs()[0]).value; }
case CALL_1F: { OneFixnumArgNoBlockCallInstr call = (OneFixnumArgNoBlockCallInstr)instr; IRubyObject r = (IRubyObject)retrieveOp(call.getReceiver(), context, self, currDynScope, currScope, temp); result = call.getCallSite().call(context, self, r, call.getFixnumArg()); 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); }