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

Projects
None yet
2 participants
@headius
Member

headius commented Oct 10, 2017

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

headius added some commits Jun 27, 2017

Mark blocks as escaped and raise LJE for break when appropriate.
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.
Final tweaks to LJE break fixes.
* 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
Simplify case/when eqq logic and enlist in normal invocation.
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

This comment has been minimized.

Show comment
Hide comment
@enebo

enebo Oct 10, 2017

Member

+1

Member

enebo commented Oct 10, 2017

+1

@headius headius merged commit 210e637 into jruby-9.1 Oct 10, 2017

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details

@headius headius deleted the jruby-9.1-with-lje-and-eqq branch Oct 10, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment