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

AOT Support for Method Handles (OpenJDK Implementation) #19993

Open
4 tasks done
dsouzai opened this issue Aug 12, 2024 · 1 comment
Open
4 tasks done

AOT Support for Method Handles (OpenJDK Implementation) #19993

dsouzai opened this issue Aug 12, 2024 · 1 comment
Assignees
Labels
comp:jit:aot comp:jit project:MH Used to track Method Handles related work

Comments

@dsouzai
Copy link
Contributor

dsouzai commented Aug 12, 2024

This issue describes a staged approach to enable AOT support for Method Handles (MH) for the OpenJDK Implementation (JDK17+); only AOT w/ SVM will/can be supported.

1. Unresolved Dispatch

Unresolved dispatch involves performing a resolved interpreter dispatch using a dummy linkToStatic method as the target method. For AOT, this requires only validating the polymorphic signature of the dummy linkToStatic method; the rest is handled by the resolved interpreter dispatch infrastructure which is already handled with the SVM.

2. Resolved Dispatch

Resolved dispatch is considerably more involved, and has a few more requirements:

  1. Add ability to store the generated LambdaForm class into the SCC
  2. Add validation record for invokeHandle/invokeDynamic
    • Store class chain of the class of the target method from member name
    • Remember method index (into the target method's class) of the target method
      • This is to to compare the method name indirectly; if the class chain validation succeeds, then the method index will refer to the same method name and bytecodes.
    • Remember whether the appendixObject is NULL or not

3. KOT enabled optimization

Resolved dispatch by itself isn't sufficient to generate optimal code; the compiler needs the Known Object Table (KOT) to "see through" a potential chain of method handles to be able to properly optimize. Thus, the AOT support will need to be added for the KOT. This can be implemented in a fairly straightforward approach using the SVM.

@dsouzai
Copy link
Contributor Author

dsouzai commented Aug 12, 2024

fyi @mpirvu @vijaysun-omr

@dsouzai dsouzai self-assigned this Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jit:aot comp:jit project:MH Used to track Method Handles related work
Projects
None yet
Development

No branches or pull requests

1 participant