On Mon, 5 Apr 2021 12:48:07 GMT, Vladimir Ivanov <vliva...@openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> - Revert back to injected constructor handle >> - Add lambda form sharing >> - Add test case for collecting a custom class > > src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java line 1883: > >> 1881: >> 1882: MethodHandle newArray = >> MethodHandles.arrayConstructor(arrayType); >> 1883: MethodHandle storeFunc = ArrayAccessor.getAccessor(arrayType, >> ArrayAccess.SET); > > I'd move `storeFunc` into `makeCollectorForm()` and use erased accessor there > (`ArrayAccessor.OBJECT_ARRAY_SETTER`). > > (It is interesting that `OBJECT_ARRAY_SETTER` is `ARRAY_STORE` intrinsic.) Done. I think it's also more obvious this way that the erased setter is being used. Good suggestion. ------------- PR: https://git.openjdk.java.net/jdk/pull/3306