RFR: 8242888: Convert dynamic proxy to hidden classes [v3]

Chen Liang liach at openjdk.org
Fri Oct 11 18:10:14 UTC 2024


On Fri, 11 Oct 2024 18:02:40 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.
>
> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits:
> 
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/hidden-proxy
>  - Flip flags, hidden is enabled only by choice
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/hidden-proxy
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/hidden-proxy
>    
>    # Conflicts:
>    #	src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java
>  - Missing changes to commit
>  - Condense legacy and modern impl
>  - Clean up
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/hidden-proxy
>  - Cleanup...
>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/hidden-proxy
>    
>    # Conflicts:
>    #	src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java
>  - ... and 3 more: https://git.openjdk.org/jdk/compare/7276a1be...2cc88f2b

Updated to merge latest master. It seems the hidden class implementation passes existing serialization tests.

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

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


More information about the core-libs-dev mailing list