eclipse-openj9 / openj9

Eclipse OpenJ9: A Java Virtual Machine for OpenJDK that's optimized for small footprint, fast start-up, and high throughput. Builds on Eclipse OMR (https://github.com/eclipse/omr) and combines with the Extensions for OpenJDK for OpenJ9 repo.
Other
3.27k stars 721 forks source link

AOT Support for Method Handles (OpenJDK Implementation) #19993

Open dsouzai opened 4 weeks ago

dsouzai commented 4 weeks ago

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:

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 commented 4 weeks ago

fyi @mpirvu @vijaysun-omr