RFR: 8291654: AArch64: assert from JDK-8287393 causes crashes

Vladimir Kozlov kvn at openjdk.org
Mon Aug 1 23:56:58 UTC 2022


On Mon, 1 Aug 2022 22:13:53 GMT, Evgeny Astigeevich <duke at openjdk.org> wrote:

> https://github.com/openjdk/jdk/commit/6cbc234ad17c5a0c4b3d6ea76f807c27c1dc8330 adds an assert checking `in_scratch_emit_size` is set during the output phase of C2 compilation. The assert can fail if C1 uses `trampoline_call`.
> The assert is not needed as the calculation of `in_scratch_emit_size` is short-circuited to false if it is C1.

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp line 883:

> 881:       assert(StubRoutines::aarch64::complete() &&
> 882:              Thread::current()->is_Compiler_thread() &&
> 883:              Compile::current()->output() != NULL, "not in output phase of C2 compilation");

The code is under `#ifdef COMPILER2` which assumes that it is executed only for C2. Which make it confusing because it CAN be executed by C1.
There is check at line 885 `is_c2_compile()` which is true only for C2. May be we can rearrange code to make it less confusing.
On other hand if `check_emit_size` could be `true` for C1 why we should emit trampoline for it and not for C2?

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

PR: https://git.openjdk.org/jdk/pull/9709


More information about the hotspot-dev mailing list