@Override public Instr clone(CloneInfo ii) { return new AttrAssignInstr(ii.getScope(), getCallType(), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
public AttrAssignInstr(AttrAssignInstr instr) { this(instr.getReceiver(), instr.getMethodAddr(), instr.getCallArgs()); }
@Override public Object interpret(ThreadContext context, DynamicScope dynamicScope, IRubyObject self, Object[] temp, Block block) { IRubyObject object = (IRubyObject) receiver.retrieve(context, self, dynamicScope, temp); IRubyObject[] values = prepareArguments(context, self, getCallArgs(), dynamicScope, temp); CallType callType = self == object ? CallType.FUNCTIONAL : CallType.NORMAL; Helpers.invoke(context, object, getMethodAddr().getName(), values, callType, Block.NULL_BLOCK); return null; }
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 void encode(IRWriterEncoder e) { if (RubyInstanceConfig.IR_WRITING_DEBUG) System.out.println("Instr(" + getOperation() + "): " + this); e.encode(getOperation()); e.encode(getReceiver()); e.encode(getName()); e.encode(getCallArgs()); }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new AttrAssignInstr(receiver.cloneForInlining(ii), (MethAddr)getMethodAddr().cloneForInlining(ii), cloneCallArgs(ii)); }
@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[] values = prepareArguments(context, self, currScope, dynamicScope, temp); callSite.call(context, self, object, values); 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; }
public Operand buildAttrAssignAssignment(Node node, IRScope s, Operand value) { final AttrAssignNode attrAssignNode = (AttrAssignNode) node; Operand obj = build(attrAssignNode.getReceiverNode(), s); List<Operand> args = setupCallArgs(attrAssignNode.getArgsNode(), s); args.add(value); s.addInstr(new AttrAssignInstr(obj, new MethAddr(attrAssignNode.getName()), args.toArray(new Operand[args.size()]))); return value; }
public static AttrAssignInstr decode(IRReaderDecoder d) { return create(d.getCurrentScope(), d.decodeOperand(), d.decodeSymbol(), d.decodeOperandArray(), d.getCurrentScope().maybeUsingRefinements()); }
case ARG_SCOPE_DEPTH: return ArgScopeDepthInstr.decode(this); case ARRAY_DEREF: return ArrayDerefInstr.decode(this); case ATTR_ASSIGN: return AttrAssignInstr.decode(this); case B_FALSE: return BFalseInstr.decode(this); case B_NIL: return BNilInstr.decode(this);
@Override public void encode(IRWriterEncoder e) { if (RubyInstanceConfig.IR_WRITING_DEBUG) System.out.println("Instr(" + getOperation() + "): " + this); e.encode(getOperation()); e.encode(getReceiver()); e.encode(getName()); e.encode(getCallArgs()); }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new AttrAssignInstr(receiver.cloneForInlining(ii), (MethAddr)getMethodAddr().cloneForInlining(ii), cloneCallArgs(ii)); }
@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[] values = prepareArguments(context, self, currScope, dynamicScope, temp); callSite.call(context, self, object, values); return null; }
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; }
public Operand buildAttrAssignAssignment(Node node, IRScope s, Operand value) { final AttrAssignNode attrAssignNode = (AttrAssignNode) node; Operand obj = build(attrAssignNode.getReceiverNode(), s); List<Operand> args = setupCallArgs(attrAssignNode.getArgsNode(), s); args.add(value); s.addInstr(new AttrAssignInstr(obj, new MethAddr(attrAssignNode.getName()), args.toArray(new Operand[args.size()]))); return value; }
public static AttrAssignInstr decode(IRReaderDecoder d) { return create(d.getCurrentScope(), d.decodeOperand(), d.decodeSymbol(), d.decodeOperandArray(), d.getCurrentScope().maybeUsingRefinements()); }
case ARG_SCOPE_DEPTH: return ArgScopeDepthInstr.decode(this); case ARRAY_DEREF: return ArrayDerefInstr.decode(this); case ATTR_ASSIGN: return AttrAssignInstr.decode(this); case B_FALSE: return BFalseInstr.decode(this); case B_NIL: return BNilInstr.decode(this);
@Override public Instr clone(CloneInfo ii) { return new AttrAssignInstr(ii.getScope(), getCallType(), getName(), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }