Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More indy call optz #7720

Merged
merged 10 commits into from Mar 20, 2023
Merged

More indy call optz #7720

merged 10 commits into from Mar 20, 2023

Conversation

headius
Copy link
Member

@headius headius commented Mar 14, 2023

Various improvements to invokedynamic call binding.

@headius headius added this to the JRuby 9.4.3.0 milestone Mar 14, 2023
@headius headius force-pushed the more_indy_call_optz branch 2 times, most recently from ba28f28 to 690a24e Compare March 15, 2023 17:26
For non-indy mode, replace setCallInfo(0) with clearCallInfo().

For indy mode, embed flags in an indy call site so the bytecode is
always just ALOAD context, INVOKEDYNAMIC.
This moves the update of call info state into the indy call site
for all normal and super invocations. The call info update happens
in a method handle "fold" combiner just prior to calling the
target method body.
@headius headius force-pushed the more_indy_call_optz branch 2 times, most recently from 5406f9a to 255a958 Compare March 15, 2023 21:46
Also remove Java 8 from indy runs of test:jruby and spec:compiler.
@headius
Copy link
Member Author

headius commented Mar 16, 2023

Adding an indy test:jruby:jit job to CI uncovered #7726 which will have a fix from headius/invokebinder#15 soon.

The checkpoint logic was hooked up to a SwitchPoint, but two other
things were missing:

* The SwitchPoint was never invalidated, so the indy checkpoint
  would never run.
* The indy checkpoint itself did not call into the thread event
  logic.

Fixing this will mean that any thread event now invalidates all
code with an indy checkpoint, so we'll need to evaluate how big
an impact that has. The code should reoptimize back to solid, but
if these events are being used heavily they will continue to
invalidate optimized code.
The specialized method_missing methods already pass the symbol
for us, so we should just invoke it generically and not pass an
additional symbol along.

This logic needs to be simplified.
@headius headius force-pushed the more_indy_call_optz branch 3 times, most recently from 2125b6c to ffc25cb Compare March 20, 2023 19:17
* Cache a call site entry in the same way that indy logic does.
* Avoid acquiring the same method name symbol repeatedly.
* Reduce duplication in method_missing handling in call sites.
* Pass all five arities through Helpers.MethodMissingMethod to
  reduce argument boxing and copying.
@headius headius merged commit f1ce425 into jruby:master Mar 20, 2023
55 checks passed
@headius headius deleted the more_indy_call_optz branch March 20, 2023 21:52
@headius headius mentioned this pull request Mar 21, 2023
16 tasks
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.

None yet

1 participant