RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes
ExE Boss
duke at openjdk.org
Sat Dec 16 20:03:38 UTC 2023
On Fri, 15 Dec 2023 12:54:27 GMT, Adam Sotona <asotona at 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"
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17121#discussion_r1428898926
More information about the core-libs-dev
mailing list