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 GetDefinedConstantOrMethodInstr(Variable resultOperand objectStringLiteral name) {
        super(.resultnew Operand[] { objectname });
    }
    @Override
    public Instr cloneForInlining(InlinerInfo inlinerInfo) {
        return new GetDefinedConstantOrMethodInstr((VariablegetResult().cloneForInlining(inlinerInfo), 
                getObject().cloneForInlining(inlinerInfo),
                (StringLiteralgetName().cloneForInlining(inlinerInfo));
    }
    @Override
    public Object interpret(ThreadContext contextDynamicScope currDynScopeIRubyObject selfObject[] tempBlock block) {
        IRubyObject value = (IRubyObjectgetObject().retrieve(contextselfcurrDynScopetemp);
        String name = getName().;
        RubyString definedType = RuntimeHelpers.getDefinedConstantOrBoundMethod(valuename);
        
        return definedType == null ? context.nil : new StringLiteral(definedType.getByteList()).retrieve(contextselfcurrDynScopetemp);
    }
    @Override
    public void visit(IRVisitor visitor) {
        visitor.GetDefinedConstantOrMethodInstr(this);
    }
New to GrepCode? Check out our FAQ X