Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jruby.ir.instructions;
 
 
 public class ReceiveExceptionInstr extends Instr implements ResultInstr {
    private Variable result;

    
If true, the implementation (compiler/interpreter) may have to check the type of the received value and unwrap it to yield a Ruby-level exception. RaiseException values would have to be unwrapped, but other Throwables are passed right through. This flag is just an optimization to let the compiler not emit type-check and unwrapping code where it wont be necessary.
    private boolean  checkType;
    
    public ReceiveExceptionInstr(Variable resultboolean checkType) {
        super(.);
        
        assert result != null : "ResultExceptionInstr result is null";
        this. = result;
        this. = checkType;
    }
    public ReceiveExceptionInstr(Variable result) {
        this(resulttrue);
    }
    public Operand[] getOperands() {
        return ;
    }
    public Variable getResult() {
        return ;
    }
    public void updateResult(Variable v) {
        this. = v;
    }
    @Override
    public String toString() {
        return (isDead() ? "[DEAD]" : "") + (hasUnusedResult() ? "[DEAD-RESULT]" : "") + getResult() + " = " + getOperation() + (! ? " [no-typecheck]" : "");
    }
    @Override
    public Instr cloneForInlining(InlinerInfo ii) {
        return new ReceiveExceptionInstr(ii.getRenamedVariable());
    }
    @Override
    public void visit(IRVisitor visitor) {
        visitor.ReceiveExceptionInstr(this);
    }
New to GrepCode? Check out our FAQ X