RFR: 8306075: Micro-optimize Enum.hashCode [v3]

Aleksey Shipilev shade at openjdk.org
Mon Apr 17 13:57:35 UTC 2023


On Mon, 17 Apr 2023 13:45:16 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

>> It would not break the code functionally if that invariant ever breaks: we would "just" call the (intrinsic) method on zero hash code. That `implNote` only shows that it would not happen with current implementation at all.
>
> From that impl note it seemed like it was a big deal for hash code to never return 0 for an object. Could you maybe de-emphasize the importance of that HotSpot behavior in the note?

All right, we can change "This allows to treat zero as the marker..." to "This makes zero a convenient marker...", I think?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13491#discussion_r1168731359


More information about the core-libs-dev mailing list