Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-11 Thread Chen Liang
On Tue, 11 Jul 2023 17:07:00 GMT, Mandy Chung wrote: > Just to be clear, the test should pass even if it keeps Lookup as the > referent, right? No. The test will not because there's no reference to the `Lookup` except in `asInterfaceInstance` itself; the `Lookup`s thus are always eligible for

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-11 Thread Mandy Chung
On Tue, 11 Jul 2023 15:13:49 GMT, Chen Liang wrote: > The WeakReference should point to the impl class. The Lookup is a cheap > wrapper, so I changed it to be created each time instead. I won't object to keep the impl class. Just to be clear, the test should pass even if it keeps Lookup as

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-11 Thread Chen Liang
On Tue, 11 Jul 2023 13:40:27 GMT, Jorn Vernee wrote: >> @mlchung Thank you for the new round of review. >> I have split the large test into 3 parts, testing general contracts, against >> different types of interfaces, and implementation-related tests. The old >> MethodHandleProxies test, which

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-11 Thread Jorn Vernee
On Tue, 11 Jul 2023 13:16:21 GMT, Chen Liang wrote: > 1. I think the type profile pollution only happens with the instance-field > approach, as I recall different instance fields' MHs pollute profiling. The > comment need to be corrected if I'm right. What happens is not really 'profile pollut

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-11 Thread Chen Liang
On Fri, 7 Jul 2023 16:31:47 GMT, Mandy Chung wrote: >> Chen Liang has refreshed the contents of this pull request, and previous >> commits have been removed. The incremental views will show differences >> compared to the previous content of the PR. The pull request contains one >> new commit s

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-11 Thread ExE Boss
On Fri, 7 Jul 2023 17:15:38 GMT, Mandy Chung wrote: >> Chen Liang has refreshed the contents of this pull request, and previous >> commits have been removed. The incremental views will show differences >> compared to the previous content of the PR. The pull request contains one >> new commit s

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-11 Thread Chen Liang
On Mon, 10 Jul 2023 18:14:16 GMT, Mandy Chung wrote: > If more than one target method handles are used, the extra classes will > pollute the same type profiles. Is this the case? I thought the profile pollution happens with the impl class holding MH in instance field approach, while JIT handle

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-10 Thread Mandy Chung
On Fri, 7 Jul 2023 06:45:46 GMT, Chen Liang wrote: >> As John Rose has pointed out in this issue, the current j.l.r.Proxy based >> implementation of MethodHandleProxies.asInterface has a few issues: >> 1. Exposes too much information via Proxy supertype (and WrapperInstance >> interface) >> 2.

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-07 Thread Mandy Chung
On Fri, 7 Jul 2023 06:45:46 GMT, Chen Liang wrote: >> As John Rose has pointed out in this issue, the current j.l.r.Proxy based >> implementation of MethodHandleProxies.asInterface has a few issues: >> 1. Exposes too much information via Proxy supertype (and WrapperInstance >> interface) >> 2.

Re: RFR: 6983726: Reimplement MethodHandleProxies.asInterfaceInstance [v22]

2023-07-06 Thread Chen Liang
> As John Rose has pointed out in this issue, the current j.l.r.Proxy based > implementation of MethodHandleProxies.asInterface has a few issues: > 1. Exposes too much information via Proxy supertype (and WrapperInstance > interface) > 2. Does not allow future expansion to support SAM[^1] abstrac