Skip to content

Fold calls to Invokers.checkVarHandleGenericType into its result #21998

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

Merged
merged 2 commits into from
Jul 7, 2025

Conversation

nbhuiyan
Copy link
Member

When the VarHandle object and the AccessDescriptor objects are known, we can perform a compile-time lookup of the corresponding entry in the VarHandle's MethodHandle table. This commit enables such a
transformation through the following:

  • Add recognized fields from which the MethodHandle table gets loaded, accounting for the differences different JDK versions
  • Add checkVarHandleGenericType to the list of non-inlinable methods
  • Add new function in MethodHandleTransformer to be triggered when visiting checkVarHandleGenericType call node that generates the trees and transforms the call node.

Furthermore, visitStoreToLocalVariable can now be triggered for cases of direct stores of nodes anchored by PassThrough nodes, which would result from calls that have been transformed into PassThrough. PassThrough nodes do not have type info, and therefore this has to be accounted for. Once inside visitStoreToLocalVariable, it would have to recognize cases of stores of child nodes of PassThrough, and set the actual node to use as the RHS of the store.

@nbhuiyan nbhuiyan force-pushed the chk-vhgentype-fold branch from e5a3d9c to b9542a8 Compare May 30, 2025 22:09
@nbhuiyan
Copy link
Member Author

nbhuiyan commented May 30, 2025

@jdmpapin I'd appreciate your review of this.

@vijaysun-omr FYI, this will improve performance in VarHandle and MemorySegment-heavy workloads.

@nbhuiyan nbhuiyan force-pushed the chk-vhgentype-fold branch from b9542a8 to c14dd0f Compare June 5, 2025 16:33
@nbhuiyan nbhuiyan requested a review from dsouzai as a code owner June 5, 2025 16:33
@nbhuiyan nbhuiyan force-pushed the chk-vhgentype-fold branch from c14dd0f to 23b1508 Compare June 5, 2025 16:37
@nbhuiyan
Copy link
Member Author

nbhuiyan commented Jun 5, 2025

@jdmpapin I have addressed your review comments. Requesting another review.

@nbhuiyan nbhuiyan force-pushed the chk-vhgentype-fold branch from 23b1508 to 440fa51 Compare June 5, 2025 16:48
@nbhuiyan nbhuiyan force-pushed the chk-vhgentype-fold branch from 440fa51 to 099bd46 Compare June 5, 2025 19:00
@jdmpapin
Copy link
Contributor

jdmpapin commented Jun 5, 2025

Jenkins build sanity all jdk17,jdk21

@jdmpapin
Copy link
Contributor

jdmpapin commented Jun 5, 2025

Jenkins test sanity all jdk17,jdk21

@jdmpapin
Copy link
Contributor

jdmpapin commented Jun 6, 2025

Jenkins test sanity.openjdk zlinux jdk21

@jdmpapin
Copy link
Contributor

jdmpapin commented Jun 6, 2025

Jenkins test sanity xlinuxjit,plinuxjit,zlinuxjit jdk17,jdk21

@jdmpapin
Copy link
Contributor

The JITServer sanity.openjdk failures are #20995 (and timeouts in the same vector tests, which I'm guessing are probably caused by the same underlying problem)

The other failure is #17270

So the checks are OK, but now there is a merge conflict

nbhuiyan added 2 commits July 7, 2025 10:51
The value is used to access MethodHandles in a VarHandle's MethodHandle
table. This capability was separated out of getMethodHandleTableEntryIndex
as it is required outside of that function to generate trees to load
from the MethodHandle table. Also implemented JITServer support.

Signed-off-by: Nazim Bhuiyan <[email protected]>
When the VarHandle object and the AccessDescriptor objects are known,
we can perform a compile-time lookup of the corresponding entry in
the VarHandle's MethodHandle table. This commit enables such a
transformation through the following:
* Add recognized fields from which the MethodHandle table gets
  loaded, accounting for the differences different JDK versions
* Add checkVarHandleGenericType to the list of non-inlinable
  methods
* Add new function in MethodHandleTransformer to be triggered
  when visiting checkVarHandleGenericType call node that generates
  the trees and transforms the call node.

Signed-off-by: Nazim Bhuiyan <[email protected]>
@nbhuiyan nbhuiyan force-pushed the chk-vhgentype-fold branch from 099bd46 to a27d80d Compare July 7, 2025 14:52
@nbhuiyan
Copy link
Member Author

nbhuiyan commented Jul 7, 2025

@jdmpapin The merge conflict is now resolved.

@jdmpapin
Copy link
Contributor

jdmpapin commented Jul 7, 2025

Running some minimal additional testing since the previous checks were done a month ago

Jenkins test sanity xlinux jdk17

@jdmpapin jdmpapin merged commit 0e97c96 into eclipse-openj9:master Jul 7, 2025
6 checks passed
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.

2 participants