-
Notifications
You must be signed in to change notification settings - Fork 729
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
[JDK11] Fix AccessControlException in resolveInvokeDynamic #18264
Conversation
@JasonFengJ9 Requesting your review. I have just moved the code around ... didn't put much effort in getting consistent formatting. |
22d6898
to
5a66601
Compare
From a stacktrace captured when running
The code path is
Is this the same as OpenJ9 JDK11 default mode which was concerned at |
No.
|
MethodHandleResolver.resolveInvokeDynamic (linkage) relies upon MethodType.fromMethodDescriptorString to derive the MethodType from the method descriptor string. Enabling OJDK's MethodType.fromMethodDescriptorString in OpenJ9 JDK11 causes an AccessControlException, which makes it unsuitable for usage during linkage. resolveInvokeDynamic (linkage) can employ its own approach to derive the MethodType from the method descriptor string. To resolve the AccessControlException, a helper method is derived from OJ9's MethodType.fromMethodDescriptorString, and it is utilized in MethodHandleResolver. The helper also enables a Map based cache per ClassLoader in both implementations. Currently, the cache is only available in OJ9 MHs. Related: eclipse-openj9#14555 Signed-off-by: Babneet Singh <[email protected]>
5a66601
to
570b507
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
@tajila could you review/merge? |
jenkins test sanity alinux64 jdk11 |
MethodHandleResolver.resolveInvokeDynamic (linkage) relies upon
MethodType.fromMethodDescriptorString to derive the MethodType from
the method descriptor string.
Enabling OJDK's MethodType.fromMethodDescriptorString in OpenJ9 JDK11
causes an AccessControlException, which makes it unsuitable for usage
during linkage.
resolveInvokeDynamic (linkage) can employ its own approach to derive
the MethodType from the method descriptor string.
To resolve the AccessControlException, a helper method is derived from
OJ9's MethodType.fromMethodDescriptorString, and it is utilized in
MethodHandleResolver.
The helper also enables a Map based cache per ClassLoader in both
implementations. Currently, the cache is only available in OJ9 MHs.
Related: #14555