8338406: BytecodeHelpers using wrong bootstrap method descriptor for condy

Reviewed-by: asotona
This commit is contained in:
Chen Liang 2024-08-15 17:50:34 +00:00
parent 965508270e
commit ace496515f
2 changed files with 41 additions and 23 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -275,15 +275,7 @@ public class BytecodeHelpers {
List<LoadableConstantEntry> staticArgs = new ArrayList<>(bootstrapArgs.length);
for (ConstantDesc bootstrapArg : bootstrapArgs)
staticArgs.add(constantPool.loadableConstantEntry(bootstrapArg));
var bootstrapDesc = desc.bootstrapMethod();
ClassEntry bsOwner = constantPool.classEntry(bootstrapDesc.owner());
NameAndTypeEntry bsNameAndType = constantPool.nameAndTypeEntry(bootstrapDesc.methodName(),
bootstrapDesc.invocationType());
int bsRefKind = bootstrapDesc.refKind();
MemberRefEntry memberRefEntry = toBootstrapMemberRef(constantPool, bsRefKind, bsOwner, bsNameAndType, bootstrapDesc.isOwnerInterface());
MethodHandleEntry methodHandleEntry = constantPool.methodHandleEntry(bsRefKind, memberRefEntry);
MethodHandleEntry methodHandleEntry = handleDescToHandleInfo(constantPool, desc.bootstrapMethod());
BootstrapMethodEntry bme = constantPool.bsmEntry(methodHandleEntry, staticArgs);
return constantPool.constantDynamicEntry(bme,
constantPool.nameAndTypeEntry(desc.constantName(),