[8u40] RFR (M): 8059877: GWT branch frequencies pollution due to LF sharing
vladimir.x.ivanov at oracle.com
Wed Oct 15 15:21:04 UTC 2014
>> Updated version:
> This is a good example to add to our "stomping on a final field" discussion, i think here it is definitely a very special case with a careful dance between updating and inlining (updateForm is also called by a direct method handle to a static method or field, such a handle initially holds a form with a check to initialize the class and after that occurs the handle is updated with a new form without the check).
Yes, MethodHandle.updateForm is an inherently unsafe mechanism. It
doesn't allow to arbitrarily change method handle behavior at will.
It is used to evolve a method handle to a more performant version when
>>> Perhaps isUnblocked is a better name than isActivated since there is no need to set the initial value and it tracks the same value as that returned from unblock?
> 765 isUnblocked = false;
> Should be "isUnblocked = true".
> 756 MethodHandle newTarget = target.asType(newType);
> 757 return asTypeCache = isUnblocked ? make(newTarget)
> 758 : newTarget; // no need for a wrapper anymore
> Should be "return asTypeCache = !isUnblocked ? ? make(newTarget)"
Gosh. Thanks for catching that!
More information about the core-libs-dev