RFR 8207814: (proxy) upgrade the proxy class generator

Mandy Chung mandy.chung at oracle.com
Sat Aug 17 00:59:13 UTC 2019

Hi Roger,

Thanks for doing this.  Replacing ancient bytecode generators makes
it much easier to support new features like value types.

The diff of ProxyGenerator is not quite right (might be due to
the rename?) as some code are unchanged but shown as modified.

"jdk.proxy.ProxyGenerator.saveGeneratedFiles" is an existing property.
Perhaps a better name for "jdk.proxy.proxy_15" would be
"jdk.proxy.ProxyGenerator.useASM" with default true.

Perhaps renaming ProxyGenerator_15 to LegacyProxyGenerator?

The combo test is great that exercises different combinations.
It validates the interfaces that the proxy class implements and
the exception types in the methods of the proxy class.

I checked the existing test/jdk/java/lang/reflect/Proxy tests.
It looks like there is no proxy test with an invocation handler
that throws checked exceptions and also undeclared exceptions.
It'd be good if you can add that as a sanity test.


On 8/16/19 12:15 PM, Roger Riggs wrote:
> 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