Integrated: 8261158: JVMState should not be shared between SafePointNodes
Tobias Hartmann
thartmann at openjdk.java.net
Wed May 12 07:25:22 UTC 2021
On Mon, 10 May 2021 14:09:17 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
> We often, for example with loop strip mining, clone `SafePointNodes` without cloning their `JVMState`, leading to the same state being shared by different nodes. With Valhalla, we then hit asserts when aggressively scalarizing inline types in safepoints during IGVN because `debug_end()` (`_endoff`) of the attached `JVMState` is larger than `SafePointNode::_max`. That happens because the same `JVMState` has been modified during scalarizing in another `SafePointNode`, the details are described in https://github.com/openjdk/valhalla/pull/322. I don't think `JVMStates` should be shared between safepoint nodes and added an assert to catch this.
>
> The fix is to always shallow clone the `JVMState` when cloning a `SafepointNode`. Sometimes, a deep clone is required already by current code for `CallNodes` (see `CallNode::needs_clone_jvms`), I left that code as is.
>
> Thanks,
> Tobias
This pull request has now been integrated.
Changeset: 06d76028
Author: Tobias Hartmann <thartmann at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/06d760283344a1d0fd510aed306e0efb76b51617
Stats: 47 lines in 8 files changed: 16 ins; 8 del; 23 mod
8261158: JVMState should not be shared between SafePointNodes
Reviewed-by: vlivanov, kvn
-------------
PR: https://git.openjdk.java.net/jdk/pull/3951
More information about the hotspot-compiler-dev
mailing list