@Override public Instr clone(CloneInfo ii) { return new OneArgOperandAttrAssignInstr(ii.getScope(), getCallType(), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
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 Object interpret(ThreadContext context, StaticScope currScope, DynamicScope dynamicScope, IRubyObject self, Object[] temp) { IRubyObject object = (IRubyObject) getReceiver().retrieve(context, self, currScope, dynamicScope, temp); IRubyObject value = (IRubyObject) getArg1().retrieve(context, self, currScope, dynamicScope, temp); callSite.call(context, self, object, value); return null; } }
@Override public Object interpret(ThreadContext context, DynamicScope dynamicScope, IRubyObject self, Object[] temp, Block block) { Operand[] args = getCallArgs(); IRubyObject object = (IRubyObject) receiver.retrieve(context, self, dynamicScope, temp); IRubyObject value = (IRubyObject) args[0].retrieve(context, self, dynamicScope, temp); CallType callType = self == object ? CallType.FUNCTIONAL : CallType.NORMAL; Helpers.invoke(context, object, getMethodAddr().getName(), value, callType, Block.NULL_BLOCK); return null; } }
@Override public CallBase specializeForInterpretation() { Operand[] callArgs = getCallArgs(); if (containsSplat(callArgs)) return this; switch (callArgs.length) { case 1: return new OneArgOperandAttrAssignInstr(this); } return this; }
@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 value = (IRubyObject) getArg1().retrieve(context, self, currScope, dynamicScope, temp); callSite.call(context, self, object, value); return null; } }
@Override public Object interpret(ThreadContext context, DynamicScope dynamicScope, IRubyObject self, Object[] temp, Block block) { Operand[] args = getCallArgs(); IRubyObject object = (IRubyObject) receiver.retrieve(context, self, dynamicScope, temp); IRubyObject value = (IRubyObject) args[0].retrieve(context, self, dynamicScope, temp); CallType callType = self == object ? CallType.FUNCTIONAL : CallType.NORMAL; Helpers.invoke(context, object, getMethodAddr().getName(), value, callType, Block.NULL_BLOCK); return null; } }
@Override public Instr clone(CloneInfo ii) { return new OneArgOperandAttrAssignInstr(ii.getScope(), getCallType(), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
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 (containsSplat(callArgs)) return this; switch (callArgs.length) { case 1: return new OneArgOperandAttrAssignInstr(this); } return this; }