On Mon, 24 Feb 2025 23:45:37 GMT, Chen Liang <[email protected]> wrote:
>> LF editor spins classes, this avoids the spinning overhead and should speed
>> up non-capturing lambdas too.
>>
>> There may need to be additional intrinsic work for MH combinator lf bytecode
>> generation.
>
> Chen Liang has updated the pull request incrementally with one additional
> commit since the last revision:
>
> We no longer load DelegateMH as we no longer rebind
Just got back home. Some comments inline, will need to run some tests and mull
this over before approval.
src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java line 2241:
> 2239: var form = constantForm(basicType);
> 2240:
> 2241: if (type.isPrimitive()) {
I think you could simplify this using `Wrapper.forBasicType`; all variants
should be able to use `wrapper.convert`
src/java.base/share/classes/java/lang/invoke/MethodHandles.java line 4874:
> 4872: Objects.requireNonNull(type);
> 4873: return type.isPrimitive() ?
> primitiveZero(Wrapper.forPrimitiveType(type))
> 4874: : MethodHandleImpl.makeConstantReturning(type, null);
Not sure if it's important but the existing impl would cache
`zero(Object.class)` while this new impl won't. Behaviorally neutral for any
other reference type, though.
-------------
PR Review: https://git.openjdk.org/jdk/pull/23706#pullrequestreview-2642528847
PR Review Comment: https://git.openjdk.org/jdk/pull/23706#discussion_r1970580771
PR Review Comment: https://git.openjdk.org/jdk/pull/23706#discussion_r1970592504