Skip to content

Clean up more divergent keyword logic#9470

Merged
headius merged 4 commits into
jruby:masterfrom
headius:cleanup_kwargs_handling
Jun 3, 2026
Merged

Clean up more divergent keyword logic#9470
headius merged 4 commits into
jruby:masterfrom
headius:cleanup_kwargs_handling

Conversation

@headius

@headius headius commented Jun 2, 2026

Copy link
Copy Markdown
Member

There's still enough divergent keyword argument logic to cause #9462 due to a JIT path failing to check for empty kwargs. That fix and others will be part of this PR to unify more of the two sides.

The interpreter logic here checked for CALL_KEYWORD_EMPTY where the
JIT did not, because they had divergent logic, This partially
unifies the two to ensure a non-kwargs trailing hash is not dup'ed
improperly during argument handling.

This appears to be the root cause of jruby#9462.
@headius headius added this to the JRuby 10.1.1.0 milestone Jun 2, 2026
@headius
headius marked this pull request as draft June 2, 2026 22:19
@headius

headius commented Jun 2, 2026

Copy link
Copy Markdown
Member Author

The first fix here is valid, but in the original investigation of #9462 I found that disabling JIT for the target method fixed the issue. I believe there's more happening here.

The example given in that issue fails, but this non-delegated version does not. It's possible that delegation is setting more keyword flags in callInfo than it should. Logically, it seems as though it should pass the flags through exactly as they came in, but that may not be exactly correct given how it captures and restructures the argument list into an IRubyObject[].

@headius

headius commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

I've filed #9472 to look into reworking how argument forwarding is done. I believe it was implemented to decompose and recompose the argument list as a convenience but this introduces a lot of overhead and potentially alters the structure of the arguments or their keyword metadata.

This will probably come along with work on #9219 to make all dispatch paths fully specified and adaptable.

@headius

headius commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

I did not find much else to clean up that wouldn't be better waiting until after a rework of how keyword arguments are passed.

@headius
headius marked this pull request as ready for review June 3, 2026 15:00
@headius headius linked an issue Jun 3, 2026 that may be closed by this pull request
@headius
headius merged commit 4c5c2de into jruby:master Jun 3, 2026
4 of 114 checks passed
@headius
headius deleted the cleanup_kwargs_handling branch June 3, 2026 15:02
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.

Regression in JRuby 10.1 with Prawn

1 participant