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

Aleksey Shipilev shade at openjdk.org
Tue Apr 18 08:39:49 UTC 2023


On Tue, 18 Apr 2023 04:49:46 GMT, ExE Boss <duke at openjdk.org> wrote:

>> Saves the virtual call, makes for a simpler intrinsic path (no need to handle NPE and fold away, for example), since we know the super-class is already `java.lang.Object`. Unless I miss something else here...
>
> Shouldn’t `invokespecial` produce a non‑virtual call as well?
> 
> And `this`/`super` can never be `null`.

`super.hashCode()` is a virtual call. `System.identityHashCode` is the static call. I don't understand where `invokespecial` enters the picture here.

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

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


More information about the core-libs-dev mailing list