@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { if (getException() instanceof IRException) { throw ((IRException) getException()).getException(context.runtime); } Object excObj = getException().retrieve(context, self, currScope, currDynScope, temp); if (excObj instanceof IRubyObject) { RubyKernel.raise(context, context.runtime.getKernel(), new IRubyObject[] {(IRubyObject)excObj}, Block.NULL_BLOCK); } else if (excObj instanceof Throwable) { // java exception -- avoid having to add 'throws' clause everywhere! Helpers.throwException((Throwable)excObj); } // should never get here throw new RuntimeException("Control shouldn't have reached here in ThrowExceptionInstr. excObj is: " + excObj); }
@Override public Object interpret(ThreadContext context, StaticScope currScope, DynamicScope currDynScope, IRubyObject self, Object[] temp) { if (getException() instanceof IRException) { throw ((IRException) getException()).getException(context.runtime); } Object excObj = getException().retrieve(context, self, currScope, currDynScope, temp); if (excObj instanceof IRubyObject) { RubyKernel.raise(context, context.runtime.getKernel(), new IRubyObject[] {(IRubyObject)excObj}, Block.NULL_BLOCK); } else if (excObj instanceof Throwable) { // java exception -- avoid having to add 'throws' clause everywhere! Helpers.throwException((Throwable)excObj); } // should never get here throw new RuntimeException("Control shouldn't have reached here in ThrowExceptionInstr. excObj is: " + excObj); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getException()); }
@Override public Instr clone(CloneInfo ii) { return new ThrowExceptionInstr(getException().cloneForInlining(ii)); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getException()); }
@Override public Instr clone(CloneInfo ii) { return new ThrowExceptionInstr(getException().cloneForInlining(ii)); }
@Override public void ThrowExceptionInstr(ThrowExceptionInstr throwexceptioninstr) { visit(throwexceptioninstr.getException()); jvmAdapter().athrow(); }
@Override public void ThrowExceptionInstr(ThrowExceptionInstr throwexceptioninstr) { visit(throwexceptioninstr.getException()); jvmAdapter().athrow(); }