RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v5]

Chen Liang liach at openjdk.org
Sun Dec 24 04:09:51 UTC 2023


On Sat, 23 Dec 2023 15:24:55 GMT, ExE Boss <duke at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java line 49:
>> 
>>> 47:                 dcb,
>>> 48:                 dcb.methodInfo.methodName(),
>>> 49:                 dcb.methodInfo.methodType(),
>> 
>> Can you enlighten me on why this actually leads to a performance improvement? Don't we already generate the methods with MethodTypeDesc symbols in ProxyGenerator so that they should be cached?
>
> This code is part of the **ClassFile API**’s internals, and so it doesn’t have access to `ProxyGenerator`’s cached `MethodTypeDesc`s, only the underlying `Utf8Entry`, so it’d need to be parsed.

I see that now Class return type and Class array parameter types are directly converted to Strings instead of MTDs. I think that we should really run ProxyGenerator with JFR to profile and see the results (for instance, old ASM has a stackmap generation penalty due to parsing method descriptors on the fly compared to CF API, despite CF's slower overall performance due to allocations like Optional)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17121#discussion_r1435760771


More information about the core-libs-dev mailing list