RFR 8158736: Adapter class loaders can avoid creating named dynamic modules

Attila Szegedi szegedia at gmail.com
Tue Jun 7 05:29:20 UTC 2016


+1. Echoing Hannes’ sentiment, it’s nice to see that extra code gone.

> On 06 Jun 2016, at 02:38, Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com> wrote:
> 
> Please review: http://cr.openjdk.java.net/~sundar/8158736/webrev.00/ for
> https://bugs.openjdk.java.net/browse/JDK-8158736
> 
> Nashorn creates named, dynamic modules for java adapter classes. This
> can be avoided and we can use the default, unnamed module created for
> the adapter class loader. Nashorn allows only subtyping of public,
> exported supertypes be implemented in scripts.  The only package used in
> adapter module is exported and the adapter type is public as well.
> 
> There is no need for named dynamic module - as there is nothing to
> encapsulate.  Nashorn module can still selectively export packages to
> adapter module [ so that generated adapter class can access nashorn
> internals as needed].
> 
> This avoids having to generate read-links to the modules of the
> reference types used by the adapter class - because unnamed adapter
> module has read edges to all the modules.
> 
> Thanks,
> 
> -Sundar
> 



More information about the nashorn-dev mailing list