RFR: 8142487: Cleanup sun.invoke.util.Wrapper zeroes to be both reliable and lazy

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Tue Nov 17 11:22:13 UTC 2015


src/java.base/share/classes/java/lang/invoke/LambdaForm.java:
+ private static void createFormsFor(BasicType type) {
+ synchronized (LF_identity) {

Looks a bit confusing since the method touches both LF_identity and 
LF_zero array now. Why not simply make the method synchronized? 
LambdaForm is package-private and shouldn't leak outside j.l.i.

test/sun/invoke/util/WrapperTest.java:
@run junit/othervm

Why do you specify /othervm mode?

Best regards,
Vladimir Ivanov

On 11/17/15 2:04 PM, Claes Redestad wrote:
>
> On 2015-11-14 01:05, Vladimir Ivanov wrote:
>>
>>> I think we have to add a storeFence or two to avoid publishing
>>> NamedFunctions whose resolvedHandle may otherwise be observed as only
>>> partially visible:
>>>
>>> http://cr.openjdk.java.net/~redestad/8142487/webrev.03/
>> Same here. No need in Unsafe.storeFence if proper constructor is used.
>
> Right, together with the added lazy initialization safety we added in
> 8142334[1] I think this is more than enough:
>
> http://cr.openjdk.java.net/~redestad/8142487/webrev.04/
>
> /Claes
>
> [1] https://bugs.openjdk.java.net/browse/JDK-8142334



More information about the core-libs-dev mailing list