RFR: 8309751: Duplicate constant pool entries added during default method processing [v2]
Coleen Phillimore
coleenp at openjdk.org
Mon Apr 8 15:39:02 UTC 2024
On Mon, 8 Apr 2024 14:20:32 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Thanks @kimbarrett . I didn't recognise this code as "the union trick" as such, but it is - we use the `value` member to access the bit pattern of the real (primitive) value for hashing purposes. Certainly should be safe/harmless for the types involved.
>
> It's used for hashing and for equals comparison. I wouldn't want to change one without the other.
Maybe renaming it from 'hash' to 'value' wasn't a good idea. The equals method makes sense in that it compares the 'hash' also.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18548#discussion_r1556052387
More information about the hotspot-runtime-dev
mailing list