Backport LocalJumpError and EQQ fixes from 9.2#4812
Merged
Conversation
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.
Member
|
+1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This backports the fixes for #4694 and #4804 from 9.2 (master) to 9.1 (jruby-9.1).