Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * To change this template, choose Tools | Templates
  * and open the template in the editor.
  */
 package org.jruby.ir.instructions.defined;
 

Author(s):
enebo
public class HasInstanceVarInstr extends DefinedObjectNameInstr {
    public HasInstanceVarInstr(Variable resultOperand objectStringLiteral name) {
        super(.resultnew Operand[] { objectname });
    }
    @Override
    public Instr cloneForInlining(InlinerInfo inlinerInfo) {
        return new HasInstanceVarInstr((VariablegetResult().cloneForInlining(inlinerInfo),
                getObject().cloneForInlining(inlinerInfo),
                (StringLiteralgetName().cloneForInlining(inlinerInfo));
    }
    @Override
    public Object interpret(ThreadContext contextDynamicScope currDynScopeIRubyObject selfObject[] tempBlock block) {
        IRubyObject receiver = (IRubyObjectgetObject().retrieve(contextselfcurrDynScopetemp);
        return context.runtime.newBoolean(receiver.getInstanceVariables().hasInstanceVariable(getName().));
    }
    @Override
    public void visit(IRVisitor visitor) {
        visitor.HasInstanceVarInstr(this);
    }
New to GrepCode? Check out our FAQ X