mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8268192: LambdaMetafactory with invokespecial causes VerificationError
Reviewed-by: psandoz, mchung
This commit is contained in:
parent
b41f3f8ed5
commit
58ba48b7b8
3 changed files with 15 additions and 20 deletions
|
@ -154,14 +154,10 @@ import static sun.invoke.util.Wrapper.isWrapperType;
|
|||
this.implClass = implInfo.getDeclaringClass();
|
||||
this.implIsInstanceMethod = true;
|
||||
|
||||
// Classes compiled prior to dynamic nestmate support invokes a private instance
|
||||
// method with REF_invokeSpecial.
|
||||
//
|
||||
// invokespecial should only be used to invoke private nestmate constructors.
|
||||
// The lambda proxy class will be defined as a nestmate of targetClass.
|
||||
// If the method to be invoked is an instance method of targetClass, then
|
||||
// convert to use invokevirtual or invokeinterface.
|
||||
if (targetClass == implClass && !implInfo.getName().equals("<init>")) {
|
||||
// Classes compiled prior to dynamic nestmate support invoke a private instance
|
||||
// method with REF_invokeSpecial. Newer classes use REF_invokeVirtual or
|
||||
// REF_invokeInterface, and we can use that instruction in the lambda class.
|
||||
if (targetClass == implClass) {
|
||||
this.implKind = implClass.isInterface() ? REF_invokeInterface : REF_invokeVirtual;
|
||||
} else {
|
||||
this.implKind = REF_invokeSpecial;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue