RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]
Adam Sotona
asotona at openjdk.org
Mon Jan 8 13:22:23 UTC 2024
On Sun, 7 Jan 2024 18:18:32 GMT, Chen Liang <liach at openjdk.org> wrote:
>> Adam Sotona has updated the pull request incrementally with one additional commit since the last revision:
>>
>> StackCounter fix
>
> src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java line 306:
>
>> 304: var cpe = cp.entryByIndex(bcs.getIndexU2());
>> 305: var nameAndType = opcode == INVOKEDYNAMIC ? ((DynamicConstantPoolEntry)cpe).nameAndType() : ((MemberRefEntry)cpe).nameAndType();
>> 306: addStackSlot(-countMethodStack(nameAndType.type(), true));
>
> Can use something like:
>
> var mtd = Util.methodTypeSymbol(nameAndType);
> addStackSlot(Util.slotSize(mtd.returnType()) - Util.parameterSlots(mtd));
>
> if you stick with MTD.
Calculation of MTD for each method invocation is extremely ineffective way to just count the size.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17121#discussion_r1444624257
More information about the core-libs-dev
mailing list