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

Recognize and transform redundant calls in MH.invokeExact MethodHandle chain #11118

Merged
merged 2 commits into from
Apr 23, 2021

Conversation

nbhuiyan
Copy link
Member

@nbhuiyan nbhuiyan commented Nov 5, 2020

This changeset includes the following:

  • recognize java/lang/invoke/Invokers methods that require handling in RecognizedCallTransformer
  • Transform Invokers.checkExactType to a ZEROCHK
  • Eliminate Invokers.checkCustomized calls when MethodHandle is a known object

Issue: #10618

@nbhuiyan
Copy link
Member Author

nbhuiyan commented Nov 5, 2020

@andrewcraik @liqunl Requesting review.

@andrewcraik
Copy link
Contributor

@liqunl can you make a first pass please?

@andrewcraik andrewcraik added comp:jit project:MH Used to track Method Handles related work labels Nov 12, 2020
@nbhuiyan nbhuiyan force-pushed the transform-invokeexact-checks branch from 69c3a73 to 0c513f2 Compare November 13, 2020 20:03
@nbhuiyan nbhuiyan force-pushed the transform-invokeexact-checks branch from 0c513f2 to 3eeca8a Compare December 9, 2020 17:55
@nbhuiyan
Copy link
Member Author

nbhuiyan commented Dec 9, 2020

@0xdaryl Requesting review

@0xdaryl 0xdaryl self-assigned this Dec 16, 2020
@0xdaryl
Copy link
Contributor

0xdaryl commented Dec 16, 2020

Jenkins test sanity all jdknext

@liqunl
Copy link
Contributor

liqunl commented Dec 16, 2020

I found that RecongnizedCallTransformer is not a good place for MH opts, as transforming these recognized MH methods usually requires known object info, and we need final field folding to discover more known objects, also a way to propagate known object from autos to the call sites. I'm adding a new opt to do this, and all the transformations should go there.

@nbhuiyan
Copy link
Member Author

Changing this PR to Draft state until we move these optimizations to a new opt.

@nbhuiyan nbhuiyan marked this pull request as draft December 16, 2020 16:31
@nbhuiyan nbhuiyan force-pushed the transform-invokeexact-checks branch from 3eeca8a to e2548f2 Compare April 7, 2021 22:16
@nbhuiyan nbhuiyan marked this pull request as ready for review April 7, 2021 22:17
@nbhuiyan
Copy link
Member Author

nbhuiyan commented Apr 7, 2021

@liqunl @0xdaryl requesting review.

Invokers contain some methods that are called to verify program correctness
from MethodHandle adapter methods and LamdaForm methods. Recognizing these
methods are required if we want to transform these calls when they are
not necessary.

Signed-off-by: Nazim Bhuiyan <[email protected]>
@nbhuiyan nbhuiyan force-pushed the transform-invokeexact-checks branch from e2548f2 to 7aff3ec Compare April 22, 2021 16:53
@0xdaryl
Copy link
Contributor

0xdaryl commented Apr 23, 2021

Jenkins test sanity all jdk11,jdknext

@0xdaryl
Copy link
Contributor

0xdaryl commented Apr 23, 2021

@liqunl : please approve if you are satisfied with the latest changes.

@liqunl
Copy link
Contributor

liqunl commented Apr 23, 2021

Other changes LGTM

The following calls will be recognized and transformed as part
of the MethodHandleTransformer opt:
* Invokers.checkExactType
* Invokers.checkCustomized

Signed-off-by: Nazim Bhuiyan <[email protected]>
@nbhuiyan nbhuiyan force-pushed the transform-invokeexact-checks branch from 7aff3ec to 48a447a Compare April 23, 2021 14:51
@0xdaryl
Copy link
Contributor

0xdaryl commented Apr 23, 2021

Jenkins test sanity xlinux,plinux,zlinux jdknext

Previous sanity testing passed. I am going to just launch a shortened sanity run for the minor edits.

@0xdaryl 0xdaryl merged commit d40ffe6 into eclipse-openj9:master Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jit project:MH Used to track Method Handles related work
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants