RFR: 8300590: [JVMCI] BytecodeFrame.equals is broken [v2]
Doug Simon
dnsimon at openjdk.org
Fri Jan 20 10:10:43 UTC 2023
On Fri, 20 Jan 2023 03:59:05 GMT, Dean Long <dlong at openjdk.org> wrote:
>> Doug Simon has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fix compilation error and formatting
>
> src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java line 374:
>
>> 372: }
>> 373: if (getClass() != obj.getClass()) {
>> 374: return false;
>
> Is this comparison better/faster than instanceof, and allows the compiler to avoid repeating the same check on the checkcast below?
It's what Eclipse auto-generates for `equals`. I can confirm that Graal eliminates the check cast but don't think it's worth worrying about if not all compilers will.
-------------
PR: https://git.openjdk.org/jdk/pull/12084
More information about the hotspot-compiler-dev
mailing list