[10] RFR (S): 8188145: MethodHandle resolution should follow JVMS sequence of lookup by name & type before type descriptor resolution

Paul Sandoz paul.sandoz at oracle.com
Tue Dec 19 18:11:24 UTC 2017


The logic looks good to me: resolving the member name, before resolving it’s type.

Paul.

> On 19 Dec 2017, at 07:37, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
> 
> http://cr.openjdk.java.net/~vlivanov/8188145/webrev.00
> https://bugs.openjdk.java.net/browse/JDK-8188145
> 
> When resolving MethodHandle constants JVM eagerly resolves type descriptor before doing upcall into JDK which performs method/field resolution later (using MethodHandleNatives.resolve on symbolic MemberName).
> 
> The problem is that according to JVMS, member resolution (and all exceptions it throws) should precede type descriptor resolution.
> 
> Proposed fix does member & type descriptor resolution from JVM first and then passes symbolic info into JDK (MHN.linkMethodHandleConstant).
> 
> The fix is conservative, since JDK repeats method/field resolution on a freshly created MemberName from symbolic info. But considering there are additional security-sensitive checks on JDK side, I decided to leave all optimizations for future enhancements.
> 
> Testing: hs-precheckin-comp, hs-tier1, hs-tier2
> 
> Best regards,
> Vladimir Ivanov



More information about the hotspot-runtime-dev mailing list