RFR: 8271276: C2: Wrong JVM state used for receiver null check
Vladimir Kozlov
kvn at openjdk.java.net
Tue Aug 17 22:13:23 UTC 2021
On Tue, 17 Aug 2021 17:21:11 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> JDK-8257211 enabled call devirtualization during post-parse phase. When a virtual call is replaced, there is a receiver null check inserted, but wrong JVM state is picked up (arguments vs locals). (`GraphKit::null_check_receiver_before_call()` should have been used instead).
>
> Instead of fixing the problematic null check, I decided to completely remove it because it is redundant: all relevant `CallGenerator`s already issue a receiver null check when one is required.
>
> Testing: hs-tier1 - hs-tier6
I thought `VirtualCallGenerator::generate()` will be call by following `inline_cg()->generate(jvms)` at line #740 (for virtual calls) and it will generate null check I pointed.
The lines you pointed are for other types of calls.
Anyway, changes are fine since all `*CallGenerator::generate()` methods do null check as we see.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5150
More information about the hotspot-compiler-dev
mailing list