RFR: 8264649: runtime/InternalApi/ThreadCpuTimesDeadlock.java crash in fastdebug C2 with -XX:-UseTLAB [v2]
Vladimir Kozlov
kvn at openjdk.java.net
Fri Apr 9 20:07:16 UTC 2021
On Wed, 7 Apr 2021 12:00:10 GMT, Hui Shi <hshi at openjdk.org> wrote:
>> src/hotspot/share/opto/phaseX.cpp line 1481:
>>
>>> 1479: // Smash all inputs to 'old', isolating him completely
>>> 1480: Node *temp = new Node(1);
>>> 1481: temp->init_req(0,nn); // Add a use to nn to prevent him from dying
>>
>> Just wondering, why do we even need this? Without that code, `remove_dead_node(old)` would kill `nn` as well if it becomes dead.
>
> Thanks for your review!
>
> Checking code history, this code is quite old. From comments around, it doesn't want nn removed directly in PhaseIterGVN::subsume_node and leaves optimization to next GVN iteration.
>
> In my understanding, it might save callers to insert codes checking if "nn" is removed/dead at every subsume_node/replace_node callsite, simplifies implementation.
>
> 8153779a hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1479) // Smash all inputs to 'old', isolating him completely
> 2a0815a5 hotspot/src/share/vm/opto/phaseX.cpp (Tobias Hartmann 2014-06-02 08:07:29 +0200 1480) Node *temp = new Node(1);
> 8153779a hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1481) temp->init_req(0,nn); // Add a use to nn to prevent him from dying
> 8153779a hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1482) remove_dead_node( old );
> 8153779a hotspot/src/share/vm/opto/phaseX.cpp (J. Duke 2007-12-01 00:00:00 +0000 1483) temp->del_req(0); // Yank bogus edge
Note `nn` could be new node created during parsing which does not have users yet. that is why we need to keep it
-------------
PR: https://git.openjdk.java.net/jdk/pull/3336
More information about the hotspot-dev
mailing list