Fix failures in ruby/spec running with immediate jit mode#6757
Merged
headius merged 8 commits intojruby:masterfrom Jul 23, 2021
Merged
Fix failures in ruby/spec running with immediate jit mode#6757headius merged 8 commits intojruby:masterfrom
headius merged 8 commits intojruby:masterfrom
Conversation
Because blocks are more sensitive to the surrounding scope, our JIT will always interpret a block that has not yet been jit compiled so that it can exit and be re-activated properly. This caused an issue when using a //o regexp and jit threshold of zero, because the jit happens before that first interpret, causing both interpreted and jitted code to produce their own regexp object. The fix here moves the jit request after the interpret, better matching the expected behavior and guaranteeing the block will finish interpreting at least once before the jit fires. As a result, the jit sees the already-encountered //o regexp and can compile it as a static regexp. See discussion under jruby#6753.
Closed
Member
Author
|
Fix for the first failure from #6753 is already in this PR. The failure looked like this: The second failure looks like this: This one may not be fixable currently due to the interpreted code and jitted code not sharing a cache of objects. |
This only worked in interpreter accidentally. This behavior is difficult to support and only works reliably in JRuby for the literal code `Proc.new`. It is also deprecated in 2.7 so we don't care anymore.
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.
See #6753 for the PR that initiated this work, by @ahorek. That PR has been superseded by this one, which includes the added jit job and will eventually contain all fixes to get that job green.