On Sat, 16 Dec 2023 19:49:12 GMT, ExE Boss <d...@openjdk.org> wrote:

>> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy 
>> classes.
>> 
>> This patch converts it to use Classfile API.
>> 
>> It is continuation of https://github.com/openjdk/jdk/pull/10991
>> 
>> Any comments and suggestions are welcome.
>> 
>> Please review.
>> 
>> Thank you,
>> Adam
>
> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 748:
> 
>> 746:                 if (parameterTypes[i].isPrimitive()) {
>> 747:                     PrimitiveTypeInfo prim = 
>> PrimitiveTypeInfo.get(parameterTypes[i]);
>> 748:                     cob.getstatic(prim.wrapperClass, "TYPE", CD_Class);
> 
> These can use a condy via 
> [`ConstantBootstraps​::primitiveClass​(MethodHandles.Lookup, String, 
> Class<?>)`], although that’s probably gonna need [JDK‑8283739].
> 
> [`ConstantBootstraps​::primitiveClass​(MethodHandles.Lookup, String, 
> Class<?>)`]: 
> https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/invoke/ConstantBootstraps.html#primitiveClass(java.lang.invoke.MethodHandles.Lookup,java.lang.String,java.lang.Class)
> [JDK‑8283739]: https://bugs.openjdk.org/browse/JDK-8283739 "[JDK‑8283739] 
> Support compiling `<primitive>.class` to a CONSTANT_Dynamic"

I recommend optimizing in another patch, as this patch aims to preserve code 
parity.

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

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

Reply via email to