Skip to content

Pass keywords through call stack - #7733

Closed
headius wants to merge 2 commits into
jruby:masterfrom
headius:propagate_kwargs
Closed

headius wants to merge 2 commits into
jruby:masterfrom
headius:propagate_kwargs

Conversation

@headius

@headius headius commented Mar 23, 2023

Copy link
Copy Markdown
Member

This PR will attempt to pass enough information on the call stack that we can eliminate the thread-local callInfo state, which must be set before each call and cleared immediately upon entering the target body.

@headius
headius force-pushed the propagate_kwargs branch from 34deb2f to 86484e4 Compare May 23, 2023 14:50
@headius headius added this to the JRuby 9.4.4.0 milestone May 23, 2023
@headius headius modified the milestones: JRuby 9.4.4.0, JRuby 9.4.5.0 Oct 11, 2023
@enebo enebo modified the milestones: JRuby 9.4.5.0, JRuby 9.4.6.0 Oct 31, 2023
This is an attempt to start passing callInfo (flags for keyword
arguments calls) through the call stack to bring it closer to the
target method body. This will allow us to perform appropriate
keyword munging on the receiver side without having to store the
callInfo in ThreadContext and clear it when done. We can also
introduce new encodings for kwargs, such as directly in the args
array rather than pre-packaging in a Hash at the point of call.
Different types of methods will have different mechanisms for
passing the kwargs callInfo along.
* "Generic" handles just using DynamicMethod.call can use the forms
  that take int callInfo. All existing implementations of that set
  the thread-local anyway, but we have at least pushed the flags
  up to this point.
* Jitted Ruby methods do not yet accept callInfo as a paramter so
  all such calls should be wrapped by callInfo thread-local.
* Native core methods do not yet accept callInfo as a parameter so
  all such calls should be wrapped by callInfo thread-local.
* Construction with new/initialize does not yet accept callInfo as
  a parameter so all such calls should be wrapped by callInfo
  thread-local.

I do not believe any other cases being built for indy dispatch
right now end up in core that cares about keywords, so the flags
do not need to be set.
@headius headius modified the milestones: JRuby 9.4.6.0, JRuby 9.5.0.0 Feb 9, 2024
@headius
headius changed the base branch from master to 10-dev November 11, 2024 19:27
@headius
headius changed the base branch from 10-dev to master March 10, 2025 22:09
@headius

headius commented Jul 8, 2026

Copy link
Copy Markdown
Member Author

This is being closed in favor of the more comprehensive plans in #9219. Once that starts to land, there will be no point in propagating just callInfo since we'll have smart call sites that can wire up keyword arguments directly.

@headius headius closed this Jul 8, 2026
@headius
headius deleted the propagate_kwargs branch July 8, 2026 18:21
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.

2 participants