RFR: 8261158: JVMState should not be shared between SafePointNodes [v2]
Vladimir Kozlov
kvn at openjdk.java.net
Tue May 11 23:17:07 UTC 2021
On Tue, 11 May 2021 13:21:33 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
>
> Tobias Hartmann has updated the pull request incrementally with one additional commit since the last revision:
>
> Rename needs_clone_jvms -> needs_deep_clone_jvms
Good.
-------------
Marked as reviewed by kvn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/3951
More information about the hotspot-compiler-dev
mailing list