Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jruby.ir.instructions;
 
public class StoreLocalVarInstr extends Instr {
    private IRScope scope;
    private Operand value;

    
This is the variable that is being stored into in this scope. This variable doesn't participate in the computation itself. We just use it as a proxy for its (a) name (b) offset (c) scope-depth.
    private LocalVariable lvar;
    public StoreLocalVarInstr(Operand valueIRScope scopeLocalVariable lvar) {
        super(.);
        this. = lvar;
        this. = value;
        this. = scope;
    }
    public Operand[] getOperands() {
        return new Operand[]{};
    }
    @Override
    public void simplifyOperands(Map<OperandOperandvalueMapboolean force) {
         = .getSimplifiedOperand(valueMapforce);
    }
    public LocalVariable getLocalVar() {
        return ;
    }
    @Override
    public String toString() {
        return "store_lvar(" +  + ", " + .getName() + ", " +  + ")";
    }
    @Override
    public Instr cloneForInlining(InlinerInfo ii) {
        // SSS FIXME: Do we need to rename lvar really?  It is just a name-proxy!
    }
    @Override
    public Object interpret(ThreadContext contextDynamicScope currDynScopeIRubyObject selfObject[] tempBlock block) {
        Object varValue = .retrieve(contextselfcurrDynScopetemp);
        currDynScope.setValue((IRubyObject)varValue.getLocation(), .getScopeDepth());
        return null;
    }
    @Override
    public void visit(IRVisitor visitor) {
        visitor.StoreLocalVarInstr(this);
    }
    public Operand getValue() {
        return ;
    }
New to GrepCode? Check out our FAQ X