RFR: 8269986: Remove +3 from Symbol::identity_hash()
Coleen Phillimore
coleenp at openjdk.java.net
Tue Nov 9 20:04:37 UTC 2021
On Sun, 7 Nov 2021 21:10:35 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> Please review this change that removes the `+3` from here:
>
>
> unsigned Symbol::identity_hash() const {
> unsigned addr_bits = (unsigned)((uintptr_t)this >> (LogMinObjAlignmentInBytes + 3));
> ^^^
> return ((unsigned)extract_hash(_hash_and_refcount) & 0xffff) |
> ((addr_bits ^ (length() << 8) ^ (( _body[0] << 8) | _body[1])) << 16);
> }
>
>
> The `+3` was intended to avoid getting the same value for these bits:
>
>
> ((uintptr_t)this) >> LogMinObjAlignmentInBytes) & 0x07)
>
>
> However, as shown in the [bug report](https://bugs.openjdk.java.net/browse/JDK-8269986), the values for these bits are evenly distributed. So the `+3` is not necessary and may actually be counter-productive.
>
> Testing: Oracle CI tiers 1-4
Looks good! Thanks for doing the performance analysis.
-------------
Marked as reviewed by coleenp (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/6287
More information about the hotspot-dev
mailing list