[lworld] Integrated: 8261037: [lworld] Assert during C2 compilation due to inconsistent JVMState at safepoint
Tobias Hartmann
thartmann at openjdk.java.net
Fri Feb 5 09:14:55 UTC 2021
On Fri, 5 Feb 2021 08:33:19 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> We assert when scalarizing an inline type in a safepoint because `debug_end()` (-> `_endoff`) of the attached `JVMState` is larger than `SafePointNode::_max`. I don't think JVMStates should be shared between safepoint nodes and I intend to fix this in mainline with [JDK-8261158](https://bugs.openjdk.java.net/browse/JDK-8261158).
>
> Gory details:
> In `PhaseIdealLoop::is_counted_loop`, we `// Check for immediately preceding SafePoint and remove` by cloning _SafePointNode1_ to _SafePointNode2_ without cloning the attached _JVMState_. Loop unswitching then clones the loop and therefore also clones _SafePointNode2_ to _SafePointNode3_, again without cloning the _JVMState_. All three safepoint nodes now share the same _JVMState_. An inline type is scalarized in _SafePointNode2_, increasing _JVMState_`::_endoff` to account for the fields. Once another inline type is scalarized in _SafePointNode3_, _JVMState_`::_endoff ` is out of bounds of _SafePointNode3_`::_max`.
>
> This fix refactors the code (which also serves as workaround because we now access `debug_end()` only after we updated it to the correct value for the current safepoint) and adds a regression test.
>
> Best regards,
> Tobias
This pull request has now been integrated.
Changeset: ce486c32
Author: Tobias Hartmann <thartmann at openjdk.org>
URL: https://git.openjdk.java.net/valhalla/commit/ce486c32
Stats: 35 lines in 3 files changed: 30 ins; 3 del; 2 mod
8261037: [lworld] Assert during C2 compilation due to inconsistent JVMState at safepoint
-------------
PR: https://git.openjdk.java.net/valhalla/pull/322
More information about the valhalla-dev
mailing list