RFR: 8335708: C2: Compile::verify_graph_edges must start at root and safepoints, just like CCP traversal [v2]
Marc Chevalier
duke at openjdk.org
Tue Mar 18 14:02:14 UTC 2025
On Mon, 17 Mar 2025 06:47:30 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/opto/compile.cpp line 4206:
>>
>>> 4204: uint stack_size = live_nodes() >> 4;
>>> 4205: Node_List nstack(MAX2(stack_size, (uint) OptoNodeListSize));
>>> 4206: if (root_and_safepoints != nullptr) {
>>
>> Can you say in which cases we don't have `root_and_safepoints`? Why is it ok not to also start at SafePoint in those cases?
>
> I think you should also say that we start the traversal from Root and Safepoints, just like during CCP.
I've improved the comment on the declaration of `verify_graph_edges`: it is the only caller of `verify_bidirectional_edges`, which acts more like a helper, and `verify_graph_edges` is the one called a bit everywhere. Also, I think it's not an implementation detail, but a signature/contract thing: when writing a call to `verify_graph_edges`, I must know what I need to provide in `root_and_safepoints`, or when I can omit it. So now, I hope it's documented.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23977#discussion_r2001122257
More information about the hotspot-compiler-dev
mailing list