RFR: 8242888: Convert dynamic proxy to hidden classes

Chen Liang liach at openjdk.org
Wed Sep 25 17:03:18 UTC 2024


On Thu, 23 May 2024 03:28:30 GMT, Chen Liang <liach at openjdk.org> wrote:

> Please review this change that adds a new dynamic proxies implementation as hidden classes.
> 
> Summary:
> 1. Adds new implementation which can be `-Djdk.reflect.useHiddenProxy=true` for early adoption.
> 2. ClassLoader.defineClass0 takes a ClassLoader instance but discards it in native code; I updated native code to reuse that ClassLoader for Proxy support.
> 3. ProxyGenerator changes mainly involve using Class data to pass Method list (accessed in a single condy) and removal of obsolete setup code generation.
> 
> Comment: Since #8278, Proxy has been converted to ClassFile API, and infrastructure has changed; now, the migration to hidden classes is much cleaner and has less impact, such as preserving ProtectionDomain and dynamic module without "anchor classes", and avoiding java.lang.invoke package.

Will have to rework since this is in conflict with #19410. Converting into draft for now.

This patch has been reworked. Now the new implementation is opt-in, which should allow for early adoption to ease the transition. Please review the associated CSR and release note as well.

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

PR Comment: https://git.openjdk.org/jdk/pull/19356#issuecomment-2133466043
PR Comment: https://git.openjdk.org/jdk/pull/19356#issuecomment-2374651015


More information about the core-libs-dev mailing list