RFR: 8286179: Node::find(int) should not traverse from new to old nodes [v2]
Emanuel Peter
duke at openjdk.java.net
Mon May 9 14:01:50 UTC 2022
On Mon, 9 May 2022 13:54:46 GMT, Emanuel Peter <duke at openjdk.java.net> wrote:
>> src/hotspot/share/opto/node.cpp line 1617:
>>
>>> 1615: Node* find_old_node(const int idx) {
>>> 1616: Node* root = old_root();
>>> 1617: assert(root != nullptr, "must have old_root() to find old nodes");
>>
>> I think it's better to avoid assertions here and below and do nothing instead (you already print a warning in `old_root()` which is fine I think) since it would crash and stop the current debugging session.
>
> @chhagedorn I added this `nullptr` because @vnkozlov asked for one. https://github.com/openjdk/jdk/pull/8567#discussion_r866966586
> Is there an alternative to an assert?
> I realize, that in `rr` the debuggin session is not stopped for me - it just unwinds - and I can continue debugging as if nothing happened. However in `gdb` this does crash the debugging session - at least by default. You can change that behavior with `set unwindonsignal on`.
>
> There are other asserts that can be triggered. For example if we call `find_node(1)` from a non-compiler thread, we get an assert when internally `Compile::current()` comes across this
>
> https://github.com/openjdk/jdk/blob/b849efdf154552903faaddd69cac1fe5f1ddf18a/src/hotspot/share/compiler/compilerThread.hpp#L63-L64
Aha. A possible alternative would be to simply return `nullptr`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8567
More information about the hotspot-compiler-dev
mailing list