On Tue, 18 Apr 2023 08:34:41 GMT, Aleksey Shipilev <sh...@openjdk.org> wrote:

>> 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.

`invokespecial` is used to call instance methods in a non‑virtual manner.

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

Using `super.hashCode()` in `java.lang.Enum` produces the bytecode:

aload_0;
invokespecial java/lang/Object.hashCode:()I;

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

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

Reply via email to