Re: RFR: 8300237: Minor improvements in MethodHandles [v5]

2023-01-18 Thread Claes Redestad
On Wed, 18 Jan 2023 07:32:58 GMT, Sergey Tsypanov wrote: >> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` >> when we don't need a copy >> - comparison of two lists can be done without `Stream.reduce()` > > Sergey Tsypanov has updated the pull request incrementally w

Re: RFR: 8300237: Minor improvements in MethodHandles [v5]

2023-01-18 Thread Rémi Forax
On Wed, 18 Jan 2023 07:32:58 GMT, Sergey Tsypanov wrote: >> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` >> when we don't need a copy >> - comparison of two lists can be done without `Stream.reduce()` > > Sergey Tsypanov has updated the pull request incrementally w

Re: RFR: 8300237: Minor improvements in MethodHandles [v5]

2023-01-18 Thread Sergey Tsypanov
> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` > when we don't need a copy > - comparison of two lists can be done without `Stream.reduce()` Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision: Use compar

Re: RFR: 8300237: Minor improvements in MethodHandles [v4]

2023-01-17 Thread Sergey Tsypanov
On Tue, 17 Jan 2023 22:28:50 GMT, Claes Redestad wrote: >> Sergey Tsypanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Merge map() calls > > src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 6752: > >> 6750:

Re: RFR: 8300237: Minor improvements in MethodHandles [v4]

2023-01-17 Thread Claes Redestad
On Tue, 17 Jan 2023 21:24:34 GMT, Sergey Tsypanov wrote: >> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` >> when we don't need a copy >> - comparison of two lists can be done without `Stream.reduce()` > > Sergey Tsypanov has updated the pull request incrementally w

Re: RFR: 8300237: Minor improvements in MethodHandles [v4]

2023-01-17 Thread Sergey Tsypanov
> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` > when we don't need a copy > - comparison of two lists can be done without `Stream.reduce()` Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision: Merge map(

Re: RFR: 8300237: Minor improvements in MethodHandles [v3]

2023-01-17 Thread Sergey Tsypanov
On Tue, 17 Jan 2023 20:51:06 GMT, Rémi Forax wrote: >> Sergey Tsypanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Polishing > > src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 59: > >> 57: import java.nio.ByteO

Re: RFR: 8300237: Minor improvements in MethodHandles [v3]

2023-01-17 Thread Rémi Forax
On Tue, 17 Jan 2023 18:07:37 GMT, Sergey Tsypanov wrote: >> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` >> when we don't need a copy >> - comparison of two lists can be done without `Stream.reduce()` > > Sergey Tsypanov has updated the pull request incrementally w

Re: RFR: 8300237: Minor improvements in MethodHandles [v3]

2023-01-17 Thread Sergey Tsypanov
On Tue, 17 Jan 2023 15:30:12 GMT, Rémi Forax wrote: >> Precious little method handle use in lambda bootstrap since JDK 11. Though I >> agree with the sentiment - having fixed a number of bootstrap issues in the >> past - `MethodHandles` is a small step up the abstraction ladder and the >> code

Re: RFR: 8300237: Minor improvements in MethodHandles [v3]

2023-01-17 Thread Sergey Tsypanov
> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` > when we don't need a copy > - comparison of two lists can be done without `Stream.reduce()` Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision: Polishing

Re: RFR: 8300237: Minor improvements in MethodHandles [v2]

2023-01-17 Thread Rémi Forax
On Tue, 17 Jan 2023 10:18:42 GMT, Claes Redestad wrote: >> Using lambdas inside MethodHandles is quite dangerous given that lambdas are >> initialized using method handles. It may work now because >> longuestParameterList() is not called when initializing a lambda but it may >> make any change

Re: RFR: 8300237: Minor improvements in MethodHandles [v2]

2023-01-17 Thread Sergey Tsypanov
> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` > when we don't need a copy > - comparison of two lists can be done without `Stream.reduce()` Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision: Simplify

Re: RFR: 8300237: Minor improvements in MethodHandles

2023-01-17 Thread Claes Redestad
On Tue, 17 Jan 2023 10:11:49 GMT, Rémi Forax wrote: >> src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 6754: >> >>> 6752: filter(t -> t.parameterCount() > skipSize). >>> 6753: map(MethodType::ptypes). >>> 6754:

Re: RFR: 8300237: Minor improvements in MethodHandles

2023-01-17 Thread Rémi Forax
On Tue, 17 Jan 2023 09:51:31 GMT, Claes Redestad wrote: >> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` >> when we don't need a copy >> - comparison of two lists can be done without `Stream.reduce()` > > src/java.base/share/classes/java/lang/invoke/MethodHandles.ja

Re: RFR: 8300237: Minor improvements in MethodHandles

2023-01-17 Thread Claes Redestad
On Tue, 17 Jan 2023 08:22:28 GMT, Sergey Tsypanov wrote: > - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` > when we don't need a copy > - comparison of two lists can be done without `Stream.reduce()` Remove `EMPTY` (using my earlier suggestion or by simply inlining

Re: RFR: 8300237: Minor improvements in MethodHandles

2023-01-17 Thread Claes Redestad
On Tue, 17 Jan 2023 08:22:28 GMT, Sergey Tsypanov wrote: > - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` > when we don't need a copy > - comparison of two lists can be done without `Stream.reduce()` src/java.base/share/classes/java/lang/invoke/MethodHandles.java li

RFR: 8300237: Minor improvements in MethodHandles

2023-01-17 Thread Sergey Tsypanov
- `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` when we don't need a copy - comparison of two lists can be done without `Stream.reduce()` - Commit messages: - Fix test - Improve MH Changes: https://git.openjdk.org/jdk/pull/12025/files Webrev: https://w