Skip to content

Commit

Permalink
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@

import org.jruby.exceptions.Unrescuable;
import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.util.cli.Options;

// This class is just a thin wrapper around a return value
// from nonlocal-return and break instructions.
@@ -19,4 +20,13 @@ public class IRWrappedLambdaReturnValue extends RuntimeException implements Unre
public IRWrappedLambdaReturnValue(IRubyObject v) {
this.returnValue = v;
}

@Override
public Throwable fillInStackTrace() {
if (Options.JUMP_BACKTRACE.load()) {
return super.fillInStackTrace();
}

return this;
}
}

5 comments on commit 2066af4

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you have a common superclass that disables the fillInStackTrace for all control flow exceptions?

@headius
Copy link
Member Author

@headius headius commented on 2066af4 Mar 8, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We did for JRuby's old JumpException, but the IR exceptions followed a different path. Going to make that change shortly, though,.

@kares
Copy link
Member

@kares kares commented on 2066af4 Mar 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@headius was wondering if stack-trace is (at all) needed for JIT "not-compilable" exceptions ..

@enebo
Copy link
Member

@enebo enebo commented on 2066af4 Mar 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kares it has exposed problems in generating bytecode so I think it can have value in development. It also happens off-thread (compilation) so it is less critical and hopefully really uncommon.

@headius
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superclass introduced in 28082e3.

Please sign in to comment.