Skip to content

Fix pattern JIT Hash match and SyntaxError#8284

Merged
headius merged 2 commits intojruby:masterfrom
headius:bad_hash_pattern_in_jit
Jun 5, 2024
Merged

Fix pattern JIT Hash match and SyntaxError#8284
headius merged 2 commits intojruby:masterfrom
headius:bad_hash_pattern_in_jit

Conversation

@headius
Copy link
Member

@headius headius commented Jun 5, 2024

This fixes two issues:

  • Pattern matching not working #8283
  • SyntaxError raised lazily by IR building can happen during JIT at threshold=0 and the wrapping of it in NotCompileableException broke an expectation in the ruby specs.

headius added 2 commits June 5, 2024 13:31
The JIT tries to optimize "eqq" operations ("===" call) to avoid
storing the return value only to immediately load it and check for
truthiness. That works fine in case/when where the eqq is always
followed by exactly one truth test, but for patterns the result of
the eqq is used in other tests later in the code (I think for
delayed determination of error conditions).

This patch adds a flag to EQQInstr to indicate if this was an eqq
used for pattern matching, which has more complicated load/store
requirements than a simple when.

Fixes jruby#8283
Normal Ruby exceptions raised during JIT should be propagated
rather than wrapped.

Fixes an issue in pattern matching specs where a syntax error gets
raised lazily, during JIT, and the wrapping in
NotCompileableException breaks the expectation.
@headius headius added this to the JRuby 9.4.8.0 milestone Jun 5, 2024
@headius headius linked an issue Jun 5, 2024 that may be closed by this pull request
@headius headius merged commit 98577fb into jruby:master Jun 5, 2024
@headius headius deleted the bad_hash_pattern_in_jit branch June 5, 2024 22:06
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.

Pattern matching not working

1 participant