-
Notifications
You must be signed in to change notification settings - Fork 706
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
OJDK MH Support for JDK8 #14937
OJDK MH Support for JDK8 #14937
Conversation
1ef750d
to
b58a6ed
Compare
b58a6ed
to
0ffb5dc
Compare
@fengxue-IS Can you please review this PR? |
All the pending JDK8 OJDK-MH failures, which will be seen after merging this PR, are linked to #14541. |
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.
changes lgtm
one minor format pick, plus maybe remove the Unsupported error as we will never be in that path (given that anything pre-Java 17 except 8&11 is out of support)
Based upon current support, VarHandle specifc code should only be enabled for JDK11 and onwards. Enabling it for JDK8 leads to the VarHandle class not-found errors. Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
f854c1c
to
43878d4
Compare
jcl/src/java.base/share/classes/java/lang/invoke/MethodHandleResolver.java
Outdated
Show resolved
Hide resolved
43878d4
to
98a97c3
Compare
In JDK8, ... 1. MethodHandleNatives.linkCallSite does not accept indexInCP as the second parameter. This should resolve a compilation error. 2. resolveInvokeDynamic should throw the original error wrapped in a BootstrapMethodError if method-type evaluation, from the descriptor string, fails. 3. Testing indicates that inaccessibleTypeCheck is not needed in JDK8, and it also leads to compilation errors. So, this check has been removed from resolveInvokeDynamic and sendResolveMethodHandle. Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
1. MethodHandleNatives.resolve has a different signature. Account for behaviour changes across JDK8, 11 and 17+. 2. Assume speculativeResolve to be false in MethodHandleNatives.resolve if it is not included in the parameter list. 3. MethodHandleNatives.getConstant only exists for JDK8. It returns false suggesting that OpenJ9 does not support the corresponding feature. 4. MethodHandleNatives.copyOutBootstrapArguments only exists in JDK11+. 5. MethodHandleNatives.clearCallSiteContext only exists in JDK11+. 6. Spread long single lines across multiple lines. Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
98a97c3
to
6fb316a
Compare
Jenkins test sanity win jdk8 |
Jenkins test sanity plinux jdk17 |
Disable VarHandle specific OJDK MH code in Java 8
Based upon current support, VarHandle specifc code should only be
enabled for JDK11 and onwards. Enabling it for JDK8 leads to the
VarHandle class not-found errors.
MethodHandleResolver changes to support OJDK MHs in JDK8
In JDK8, ...
parameter. This should resolve a compilation error.
BootstrapMethodError if method-type evaluation, from the descriptor string,
fails.
it also leads to compilation errors. So, this check has been removed from
resolveInvokeDynamic and sendResolveMethodHandle.
MHN changes to support OJDK MHs in JDK8
behaviour changes across JDK8, 11 and 17+.
if it is not included in the parameter list.
suggesting that OpenJ9 does not support the corresponding feature.
Closes: #14556
Signed-off-by: Babneet Singh sbabneet@ca.ibm.com