RFR: 6983726: remove Proxy from MethodHandleProxies.asInterfaceInstance SAM conversion [v6]

Chen Liang liach at openjdk.org
Thu Apr 6 17:54:20 UTC 2023


On Thu, 6 Apr 2023 17:27:14 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> An other possibility to to add some key into the ClassData that can't be imitated - such as the `InterfaceInfo` itself.  
>> An `instanceof` check on the ClassData at a fixed position could then determine if is a MHP.
>
> It looks like Proxy forcibly adds reads and exports edges from the module of the target interface to the module that defines the proxy: https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/reflect/Proxy.java#L855-L868 I think we can do the same here

I would support the putting InterfaceInfo in class data approach. With IMPL_LOOKUP, we currently define the hidden class in the same module as the interface. It's currently hard to define a hidden class without an anchor host class for a new module.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13197#discussion_r1160094938


More information about the core-libs-dev mailing list