RFR: 8350607: Consolidate MethodHandles::zero into MethodHandles::constant [v2]
Chen Liang
liach at openjdk.org
Wed Mar 5 17:48:05 UTC 2025
On Tue, 4 Mar 2025 20:36:02 GMT, John R Rose <jrose at openjdk.org> wrote:
>> 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
>
> src/java.base/share/classes/java/lang/invoke/SimpleMethodHandle.java line 36:
>
>> 34: * A method handle whose behavior is determined only by its LambdaForm.
>> 35: * Access to SimpleMethodHandle should ensure BoundMethodHandle is initialized
>> 36: * first.
>
> Did you try factoring UNSAFE.ensureInit(BMH) into a static block in SimpleMethodHandle.java?
> Sometimes that works.
To be exact, I did not encounter any initialization issue during my use of BMH/SimpleMH. We don't need ensureInit as SimpleMH already extends BMH. Maybe my concern is just red herring, as I saw a warning on BMH$Species_L that its access should go through BMH first.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23706#discussion_r1981887881
More information about the core-libs-dev
mailing list