RFR: 8173709: Fix VerifyLoopOptimizations - step 1

Christian Hagedorn chagedorn at openjdk.org
Wed Mar 29 10:36:06 UTC 2023


On Wed, 29 Mar 2023 07:45:24 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/loopnode.cpp line 4656:
>> 
>>> 4654:   // Verify ctrl and idom of every node.
>>> 4655:   int fail = 0;
>>> 4656:   verify_nodes(C->root(), &loop_verify, fail);
>> 
>> I think result should be returned using local variables instead of storing it in passed variable.
>
> The nice thing about a variable is that it has an address in memory. Then I can set a watchpoint in the debugger, and go back to it easily, stepping through all the `fail` incrementations. Before this patch, we just used a static variable `fail`. I could also revert to that. It is just not thread-safe.

You might just get rid of `fail` and move the `assert(fail == 0)` directly to `verify_nodes()`. Then you can also turn the parameter `fail` into a local variable inside `verify_nodes()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13207#discussion_r1151662386


More information about the hotspot-compiler-dev mailing list