-
Notifications
You must be signed in to change notification settings - Fork 722
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
Disable use of method handle for core reflection in JDK21 #20159
Conversation
FYI @TobiAjila / @joransiu |
3dc041d
to
42fb9ab
Compare
The commit message and the description here should remove "and above" from "JDK21 and above". |
42fb9ab
to
f30df47
Compare
@keithc-ca I have removed WIP from the title and also made changes as you suggested. This is ready for review. |
Jenkins test sanity,extended alinux jdk21 |
Please review and address the test failure. |
Looking at the failure in the build, I think it is because of the changes made in db9a1f6#diff-064f3efdb5a6bf22c75743e2449c189806f8e5a2efa292df7d5c3c0dd7f48eb6 to adapt That PR also switches the core reflection to direct method handle. |
@r30shah from the code commit history, the change in question was related to Lines 37 to 46 in 0985ff3
Does this PR change InjectedInvoker ?
|
It does not, it switches to old reflection instead of method handles. The change that I was asking about was specific to test |
The test was based on the |
I have made change to failing test to also check if the useDirectMethodHandle property is set to
@JasonFengJ9 Can you please review last fix I pushed into the PR? |
@@ -62,7 +62,8 @@ public static boolean test_getCallerClass_Helper_Reflection_fromBootExtWithAnnot | |||
cls = (Class<?>) method.invoke(null, new Object[0]); | |||
|
|||
boolean isClassNameExpected; | |||
if (VersionCheck.major() >= 18) { | |||
String useDMHStr = System.getProperties().getProperty("jdk.reflect.useDirectMethodHandle"); | |||
if (VersionCheck.major() >= 18 && (useDMHStr != null && useDMHStr.equals("true"))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (VersionCheck.major() >= 18 && (useDMHStr != null && useDMHStr.equals("true"))) { | |
if (VersionCheck.major() >= 18 && Boolean.getBoolean("jdk.reflect.useDirectMethodHandle")) { |
L65 can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, I have applied the recommendation in https://github.com/eclipse-openj9/openj9/compare/7f66c8ff8a083767606602b2700d5fb56ad462d9..b58d7f658a0a54755bde06d23247ae4e544796f5 and also have verified the failing test.
7f66c8f
to
b58d7f6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
...tional/cmdline_options_testresources/src_90/com/ibm/j9/getcallerclass/ReflectionMHTests.java
Outdated
Show resolved
Hide resolved
522e847
to
3ca1654
Compare
...tional/cmdline_options_testresources/src_90/com/ibm/j9/getcallerclass/ReflectionMHTests.java
Outdated
Show resolved
Hide resolved
3ca1654
to
57a5ddf
Compare
...tional/cmdline_options_testresources/src_90/com/ibm/j9/getcallerclass/ReflectionMHTests.java
Outdated
Show resolved
Hide resolved
57a5ddf
to
25c26bf
Compare
Please update the commit messages so no line in the body is longer than 72 characters. See https://github.com/eclipse/omr/blob/master/CONTRIBUTING.md#commit-guidelines for guidance. |
In JEP 416, core reflection was re-implemented with Method Handles with the purpose of simplifying adding new language features. While analyzing performance of workload based on large enterprise based application, I observed that this was causing visible performance degradation. Disabling the use of direct method handles for reflection calls while we are working on improving the performance with direct method handles. Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
Previously for JEP416, adjustments were made to ReflectionMHTests to adapt the frames for method handles. This test was failing when `-Djdk.reflect.useDirectMethodHandle=false` option is set. Adding an additional check in the test to see if the property is set to true to call for InjectedInvoker check. Signed-off-by: Rahil Shah <rahil@ca.ibm.com>
25c26bf
to
3fc532d
Compare
Jenkins test sanity,extended alinux jdk21,jdk23 |
Looking into the failure in sanity.functional -
I do not think the failure in the build has anything to do with changes in this PR. |
Yes, it's a mismatch between the tests and the JVM. |
In JEP 416, core reflection was re-implemented with Method Handles with the purpose of simplifying adding new language features. While analyzing performance of workload based on large enterprise based application, I observed that this was causing visible performance degradation. Disabling the use of direct method handles for reflection calls while we are working on improving the performance with direct method handles.