RFR: 8209633: Avoid creating WeakEntry wrappers when looking up cached MethodType
Peter Levart
peter.levart at gmail.com
Fri Aug 17 14:38:51 UTC 2018
On 08/17/2018 04:32 PM, Claes Redestad wrote:
> Hi Peter,
>
> On 2018-08-17 16:04, Peter Levart wrote:
>> Hi Claes,
>>
>> Nice trick.
>
> thanks!
>
>> You made MethodType(s) and WeakEntry(s) holding them equal,
>> respecting the equals()/hashCode() contract. When WeakEntry looses
>> the referent it is left equal to itself only, which is enough for
>> expunging it from map.
>
> Good summary. Do you think we need a few comments to spell out these
> intricacies?
Yes, perhaps just pointers from the two equals() methods to each other,
explaining that they are actually one method which is split into two
unrelated classes.
Peter
More information about the core-libs-dev
mailing list