[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-hotspot-runtime-dev
Subject: Re: [10] RFR (XS): 8194963: SystemDictionary::link_method_handle_constant() can't link
From: Vladimir Ivanov <vladimir.x.ivanov () oracle ! com>
Date: 2018-01-17 19:11:33
Message-ID: d586461f-6ba1-f91c-b783-30365091775f () oracle ! com
[Download RAW message or body]
Vladimir, Paul, thanks for reviews!
> VarHandle sigpoly methods also leverage an appendix argument, see the upcall to \
> MethodHandleNatives.linkMethod. Might they be affected too?
> However, i believe there might be a limitation in HotSpot such that it's not \
> possible to resolve method references to VarHandle sigpoly methods (something that \
> was likely missed with the VarHandle integration).
Good point. I'll take a look at it separately. Seems like
MethodHandles.linkMethodHandleConstant() misses a special case for
VarHandle invokers.
Best regards,
Vladimir Ivanov
> > On 12 Jan 2018, at 07:39, Vladimir Ivanov <vladimir.x.ivanov@oracle.com> wrote:
> >
> > http://cr.openjdk.java.net/~vlivanov/8194963/webrev.00/
> > https://bugs.openjdk.java.net/browse/JDK-8194963
> >
> > It's a fix for a bug introduced by 8188145 [1].
> >
> > MethodHandle.invoke()/invokeExact() have an implicit appendix argument \
> > (MethodType isntance) which is used for type checking method handle against call \
> > site.
> > MemberName resolution doesn't support such methods (with appendix argument), \
> > because there's no way to attach an appendix to MemberName.
> > Before 8188145, it was handled in JDK code [2], but now JVM performs MemberName \
> > resolution first before doing the upcall into JDK.
> > The fix is to avoid resolving those methods in \
> > SystemDictionary::link_method_handle_constant() (they are well-known, public, \
> > signature polymorphic) and only resolve method descriptor before doing the \
> > upcall.
> > Testing:
> > * failing tests, jdk/java/lang/invoke
> > * hs-precheckin-comp, hs-tier1, hs-tier2, jdk-tier1, jdk-tier2 (in progress)
> >
> > Thanks!
> >
> > Best regards,
> > Vladimir Ivanov
> >
> > [1] https://bugs.openjdk.java.net/browse/JDK-8188145
> >
> > [2] http://hg.openjdk.java.net/jdk/hs/file/bade224cc81e/src/java.base/share/classes/java/lang/invoke/MethodHandles.java#l2446
> > MethodHandle linkMethodHandleConstant(byte refKind, Class<?> defc, String name, \
> > Object type) throws ReflectiveOperationException {
> > ...
> > // Treat MethodHandle.invoke and invokeExact specially.
> > if (defc == MethodHandle.class && refKind == REF_invokeVirtual) {
> > mh = findVirtualForMH(member.getName(), member.getMethodType());
> > if (mh != null) {
> > return mh;
> > }
> > }
>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic