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

Backport LocalJumpError and EQQ fixes from 9.2 #4812

Merged
merged 9 commits into from Oct 10, 2017

Conversation

headius
Copy link
Member

@headius headius commented Oct 10, 2017

This backports the fixes for #4694 and #4804 from 9.2 (master) to 9.1 (jruby-9.1).

Fixes #4686.
Fixes #4577.

The logic here adds finally wrappers around all call paths that
receive a block. When the call exits, the block is marked
"escaped" since it no longer has a method activation to go with
it. This indicates that non-local flow, like break, should
immediately trigger a LocalJumpError.

This passes specs but has not been tested extensively with other
types of call forms that receive blocks.
* Add literal closure method to IR closure-accepting interface
* Replace double boolean in JIT code with enum
* Check for null in non-local return logic
Most case/when will have neither an undefined case value (for bare
case statements) nor multiple values for a given when (splatted)
so in those cases we can simply do a plain eqq call + isTrue. The
unusual cases will still go to the old isEQQ logic, so there may
be value in optimizing that path later.

The main logic in isEQQ is the processing of a splatted array of
when values in sequence, and a small bit of logic that simply
checks truthiness of the when value for a bare case statement.

This change reduces the bytecode for all case/when, and by more
than half for the typical form. It also allows the === call to be
optimized with invokedynamic like a normal call.
@headius headius added this to the JRuby 9.1.14.0 milestone Oct 10, 2017
@enebo
Copy link
Member

enebo commented Oct 10, 2017

+1

@headius headius merged commit 210e637 into jruby-9.1 Oct 10, 2017
@headius headius deleted the jruby-9.1-with-lje-and-eqq branch October 10, 2017 19:55
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.

None yet

2 participants