-
Notifications
You must be signed in to change notification settings - Fork 737
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
Properly handle resolve-time invokeDynamic errors for OJDK MHs #18474
Conversation
As a side effect, this patch also addresses the second point here: #10913 meaning the interpreter no longer has to check whether it has a |
ping: @babsingh |
jcl/src/java.base/share/classes/java/lang/invoke/MethodHandleResolver.java
Outdated
Show resolved
Hide resolved
jcl/src/java.base/share/classes/java/lang/invoke/MethodHandleResolver.java
Outdated
Show resolved
Hide resolved
jcl/src/java.base/share/classes/java/lang/invoke/MethodHandleResolver.java
Outdated
Show resolved
Hide resolved
|
Last week I was having issues with jenkins aborting builds with and without my patch. I can launch them again today with JDK 8, 11, and 17 since these changes will affect all of them. |
I can launch them in the PR. Was planning to minimize PR testing if prior testing was already done. |
JDK 17 completed fine in Jenkins (https://hyc-runtimes-jenkins.swg-devops.com/job/Pipeline-Build-Test-Personal/19247/). But the grinder aborted, probably best to re-run anyways. |
test/functional/Jsr292/src/com/ibm/j9/jsr292/indyn/IndyTest.java
Outdated
Show resolved
Hide resolved
jcl/src/java.base/share/classes/java/lang/invoke/MethodHandleResolver.java
Outdated
Show resolved
Hide resolved
5fce658
to
8e440bf
Compare
This patch fixes eclipse-openj9#14990. For OJDK MHs invokeDynamic resolve-time errors need to be wrapped in BootstrapMethodErrors and thrown during invoke-time. However, prior to Java 11, if a CallSite initially binds to null the error needs to be thrown during resolution to ensure that resolution is reattempted by the interpreter. This patch also updates the IndyTest.java test case to conform to the spec for OJDK MHs. Issues: eclipse-openj9#14990 Signed-off-by: Nathan Henderson <[email protected]>
jenkins test sanity.functional,extended.functional,sanity.openjdk,extended.openjdk zlinuxojdk292 jdk8,jdk11 |
jenkins test sanity.functional,extended.functional,sanity.openjdk,extended.openjdk plinux jdk8,jdk17 |
JDK11 failures:
JDK8 failures:
|
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.
Only known failures, which are unrelated to these changes, are seen in the PR builds.
resultHandle = MethodHandles.foldArguments(thrower, combiner); | ||
/*[IF JAVA_SPEC_VERSION >= 11]*/ | ||
MemberName memberName = resultHandle.internalForm().vmentry; | ||
/*[ELSE] JAVA_SPEC_VERSION >= 11*/ | ||
MemberName memberName = resultHandle.internalForm().compileToBytecode(); | ||
/*[ENDIF] JAVA_SPEC_VERSION >= 11*/ | ||
result[0] = memberName; | ||
result[1] = resultHandle; |
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.
a potential improvement to remove local variables (resultHandle
and memberName
) and reduce code size for the future:
result[1] = MethodHandles.foldArguments(thrower, combiner);
/*[IF JAVA_SPEC_VERSION >= 11]*/
result[0] = result[1].internalForm().vmentry;
/*[ELSE] JAVA_SPEC_VERSION >= 11*/
result[0] = result[1].internalForm().compileToBytecode();
/*[ENDIF] JAVA_SPEC_VERSION >= 11*/
This patch fixes #14990.
For OJDK MHs
invokeDynamic
resolve-time errors need to be wrapped inBootstrapMethodError
s and thrown during invoke-time. However, prior to Java 11, if aCallSite
initially binds tonull
the error needs to be thrown during resolution to ensure that resolution is reattempted by the interpreter.This patch also updates the
IndyTest.java
test case to conform to the spec for OJDK MHs.Issues: #14990
Signed-off-by: Nathan Henderson [email protected]