Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jruby.ir.instructions;
 
public class PutFieldInstr extends PutInstr {
    public PutFieldInstr(Operand objString fieldNameOperand value) {
        super(.objfieldNamevalue);
    }
    @Override
    public Instr cloneForInlining(InlinerInfo ii) {
        return new PutFieldInstr([].cloneForInlining(ii), [].cloneForInlining(ii));
    }
    @Override
    public Object interpret(ThreadContext contextDynamicScope currDynScopeIRubyObject selfObject[] tempBlock block) {
        IRubyObject object = (IRubyObjectgetTarget().retrieve(contextselfcurrDynScopetemp);
        // FIXME: Why getRealClass? Document
        RubyClass clazz = object.getMetaClass().getRealClass();
        // FIXME: Should add this as a field for instruction
        clazz.getVariableAccessorForWrite(getRef()).set(object
                getValue().retrieve(contextselfcurrDynScopetemp));
        return null;
    }
    @Override
    public void visit(IRVisitor visitor) {
        visitor.PutFieldInstr(this);
    }
New to GrepCode? Check out our FAQ X