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

VarHandle MethodType lookup table not needed for OJDK MH #11580

Closed
babsingh opened this issue Jan 6, 2021 · 4 comments · Fixed by #13858
Closed

VarHandle MethodType lookup table not needed for OJDK MH #11580

babsingh opened this issue Jan 6, 2021 · 4 comments · Fixed by #13858
Assignees
Labels
comp:vm project:MH Used to track Method Handles related work

Comments

@babsingh
Copy link
Contributor

babsingh commented Jan 6, 2021

VarHandle MethodType lookup table is stored in the J9ROMClass.

The code related to the VarHandle MethodType lookup table should be wrapped with J9VM_OPT_METHOD_HANDLE or an identical flag so that it stays disabled for OJDK MH.

The code related to the VarHandle MethodType lookup table is mentioned in the following comments:

  1. Remove dead/unreferenced data in ROMClasses #11566 (review)
  2. Remove dead/unreferenced data in ROMClasses #11566 (comment)
@babsingh
Copy link
Contributor Author

babsingh commented Jan 6, 2021

fyi @DanHeidinga @fengxue-IS @tajila
This issue needs to be tagged with project:MH.

@EricYangIBM
Copy link
Contributor

EricYangIBM commented Nov 2, 2021

I am unsure what to do for https://github.com/eclipse-openj9/openj9/blob/master/runtime/compiler/optimizer/VarHandleTransformer.cpp#L295. That method is accessing the varhandlemethodtypelookuptable so I think some changes are necessary when ojdk method handles are enabled.

Same for lookupVarHandleMethodTypeCacheIndex: https://github.com/eclipse-openj9/openj9/blob/master/runtime/codert_vm/cnathelp.cpp#L2496

@fengxue-IS
Copy link
Contributor

The first link code should be never used with ojdk MH enabled, so you should be able to ifdef the code block with J9VM_OPT_METHOD_HANDLE.
@nbhuiyan can you confirm that VarHandleTransformer functions are not used with ojdk MH, and if it is possible to ifdef them out when ojdk mh is enabled

for second link, you don't need to do anything as the code is already ifdef with J9VM_OPT_OPENJDK_METHODHANDLE

@nbhuiyan
Copy link
Member

nbhuiyan commented Nov 3, 2021

Yes, this is not used with ojdk MHs. We can safely ifdef out the entire body of TR_VarHandleTransformer::perform() (except return 0) in ojdk MH builds.

EricYangIBM added a commit to EricYangIBM/openj9 that referenced this issue Nov 8, 2021
J9RomClass.varHandleMethodTypeLookupTable is not used in the OJDK method
handle implementation as varhandles are treated as method handles and
use the invoke cache instead.

Closes: eclipse-openj9#11580
Signed-off-by: Eric Yang <eric.yang@ibm.com>
Adopt OpenJDK MethodHandles automation moved this from To do to Done Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:vm project:MH Used to track Method Handles related work
Development

Successfully merging a pull request may close this issue.

5 participants