8195650: Method references to VarHandle accessors

Reviewed-by: jrose
This commit is contained in:
Paul Sandoz 2018-06-25 14:39:44 -07:00
parent f44956330d
commit 14651d9e02
6 changed files with 190 additions and 13 deletions

View file

@ -2452,12 +2452,18 @@ return mh1;
checkSymbolicClass(defc);
return mh;
}
// Treat MethodHandle.invoke and invokeExact specially.
if (defc == MethodHandle.class && refKind == REF_invokeVirtual) {
// Treat MethodHandle.invoke and invokeExact specially.
mh = findVirtualForMH(member.getName(), member.getMethodType());
if (mh != null) {
return mh;
}
} else if (defc == VarHandle.class && refKind == REF_invokeVirtual) {
// Treat signature-polymorphic methods on VarHandle specially.
mh = findVirtualForVH(member.getName(), member.getMethodType());
if (mh != null) {
return mh;
}
}
MemberName resolved = resolveOrFail(refKind, member);
mh = getDirectMethodForConstant(refKind, defc, resolved);