Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple adjustments to the Exception and raise logic. #5607

Merged
merged 5 commits into from
Feb 12, 2019

Conversation

headius
Copy link
Member

@headius headius commented Feb 12, 2019

  • Request backtrace from exception object before raise, so that
    pre-set backtrace or overridden #backtrace skip native trace
    gathering.
  • Eliminate some redundant or unused backtrace-gathering methods.
  • Fix Kernel#warn uplevel logic to use partial traces (Java 9).

The fixes here allow two additional ways of blunting the cost of
raising an exception (by eliminating the native stack trace):

  • Call Exception#set_backtrace before raising
  • Use an Exception subtype that overrides Exception#backtrace

This improves the performance of these scenarios to be roughly
equivalent to the three-arg form of Kernel#raise.

Fixes #5605.

@headius headius added this to the JRuby 9.2.7.0 milestone Feb 12, 2019
* Request backtrace from exception object before raise, so that
  pre-set backtrace or overridden #backtrace skip native trace
  gathering.
* Eliminate some redundant or unused backtrace-gathering methods.
* Fix Kernel#warn uplevel logic to use partial traces (Java 9).

The fixes here allow two additional ways of blunting the cost of
raising an exception (by eliminating the native stack trace):

* Call Exception#set_backtrace before raising
* Use an Exception subtype that overrides Exception#backtrace

This improves the performance of these scenarios to be roughly
equivalent to the three-arg form of Kernel#raise.

Fixes jruby#5605.
@headius headius requested review from kares and enebo February 12, 2019 21:37
@headius
Copy link
Member Author

headius commented Feb 12, 2019

The three failures are the same three from master's -ea hang in MRI suite. I'm investigating that on master.

@headius headius merged commit 0b60847 into jruby:master Feb 12, 2019
@headius headius deleted the improve_raise_logic branch February 12, 2019 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set_backtrace should disable backtrace generation on raise
2 participants