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

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Tue Dec 19 15:37:45 UTC 2017


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