RFR: 8335536: Fix assertion failure in IdealGraphPrinter when append is true [v2]

Tobias Hartmann thartmann at openjdk.org
Wed Jul 3 07:08:20 UTC 2024


On Wed, 3 Jul 2024 06:31:24 GMT, Qizheng Xing <qxing at openjdk.org> wrote:

>> src/hotspot/share/opto/idealGraphPrinter.cpp line 920:
>> 
>>> 918:       end_method();
>>> 919:       begin_method();
>>> 920:     }
>> 
>> Could you explain this change and maybe add a comment?
>
> Reason for adding `if (_append)`: in append mode, the constructor of `IdealGraphPrinter` will not call `begin_method`, so we should not call `end_method` here to prevent the assertion failure, just update `_current_method`.
> 
> Reason for removing `_current_method = nullptr;`: `_current_method` is maintained and cleared in `end_method`, we do not need to handle it manually here.
> 
> Added more comments in the latest commit.

Thanks!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19986#discussion_r1663629522


More information about the hotspot-compiler-dev mailing list