Skip to content

Reduce deopt from print use of $_#8249

Merged
headius merged 4 commits intojruby:9.5-devfrom
headius:lastline_call_site
May 29, 2024
Merged

Reduce deopt from print use of $_#8249
headius merged 4 commits intojruby:9.5-devfrom
headius:lastline_call_site

Conversation

@headius
Copy link
Member

@headius headius commented May 21, 2024

This started out as a call site optimization to pass $_ directly yo Kernel#print or IO#print rather than provide it through a heap frame, but the simpler change is to reduce the deoptimization to only zero-arity. There are unlikely to be many non-core case for calling print without any arguments other than for the core version.

If there is such a case in the wild, we can revisit the call site optimization.

The patch as written here eliminates the frame requirement for all non-zero arity calls to print.

@headius headius added this to the JRuby 10.0.0.0 milestone May 21, 2024
headius added a commit to headius/jruby that referenced this pull request May 21, 2024
This tests the overhead of a method that calls print, given the
optimization in jruby#8249.
headius added 4 commits May 29, 2024 14:47
We can reduce this deoptimization to when print is called with no
arguments. Other forms do not need access to $_.
This tests the overhead of a method that calls print, given the
optimization in jruby#8249.
@headius headius force-pushed the lastline_call_site branch from ee3ac19 to 8489050 Compare May 29, 2024 19:47
@headius headius merged commit c2511b0 into jruby:9.5-dev May 29, 2024
@headius headius deleted the lastline_call_site branch May 29, 2024 21:18
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.

1 participant