RFR 8207814: (proxy) upgrade the proxy class generator

Remi Forax forax at univ-mlv.fr
Mon Aug 19 21:19:23 UTC 2019


A follow up should to use constant dynamic (introduce in Java 11) to get the j.l.r.Method object instead of pre-calculating all of them in the static init block.
The idea is that a ldc on a constant dynamic with bootstrap method that takes a MethodHandle as parameter (as boostrap argument) can return the corresponding Method by using Lookup.revealDirect + reflectAs.
The bootstrap method can be added to j.l.i.ConstantBootstraps

This should consume less bytecode (the MethodHandle is directly encodable as a constant pool constant) and only creates the j.l.r.Method if the interface method is actually called.

Rémi

----- Mail original -----
> De: "Roger Riggs" <Roger.Riggs at oracle.com>
> À: "core-libs-dev" <core-libs-dev at openjdk.java.net>
> Envoyé: Vendredi 16 Août 2019 21:15:30
> Objet: RFR 8207814: (proxy) upgrade the proxy class generator

> Please review an enhancement to replace the java.lang.reflect.Proxy
> class file generation.
> The new generator uses ASM and generates stackmaps. The implementation
> follows
> the same structure as before but has many differences as it leverages
> ASM for generating the bytecode.
> A Combo test is included and two JMH based benchmarks.
> 
> The ancient ProxyGenerator_15 implementation is temporarily retained
> to allow comparisons of generated class files and performance.
> 
> Issue:
>   https://bugs.openjdk.java.net/browse/JDK-8207814
> 
> Webrev:
> http://cr.openjdk.java.net/~rriggs/webrev-upgrade-proxy-gen-8207814/
> 
> (Upgrading bytecode generation is necessary for Valhalla but makes sense
> for the main line.)
> 
> Thanks, Roger


More information about the core-libs-dev mailing list