RFR: 8370220: C2: rename methods and improve documentation around get_ctrl and idom lazy updating/forwarding of ctrl and idom via dead ctrl nodes [v5]

Emanuel Peter epeter at openjdk.org
Tue Oct 21 07:42:13 UTC 2025


On Mon, 20 Oct 2025 13:25:58 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Apply suggestions from code review
>>   
>>   Co-authored-by: Christian Hagedorn <christian.hagedorn at oracle.com>
>
> src/hotspot/share/opto/loopnode.hpp line 1154:
> 
>> 1152:   //   forwarding in the future.
>> 1153:   // - When querying "idom": from some node get its old idom, which
>> 1154:   //   may be dead but has a ctrl forwarding to the new and live
> 
> Maybe add this:
> Suggestion:
> 
>   //   may be dead but has an idom forwarding (piggy-backing on '_loop_or_ctrl') to the new and live

Thanks for the suggestion. I applied something that is inspired by your suggestion instead :)

> src/hotspot/share/opto/loopnode.hpp line 1160:
> 
>> 1158:   // the entry for the old dead node now, and we do not have to update all
>> 1159:   // the nodes that had the old_node as their "get_ctrl" or "idom". We
>> 1160:   // clean up the forwarding links when we query "get_ctrl" or "idom".
> 
> Suggestion:
> 
>   // clean up the forwarding links when we query "get_ctrl" or "idom" for these nodes the next time.

Applied it but with a line break ;)

> src/hotspot/share/opto/loopnode.hpp line 1161:
> 
>> 1159:   // the nodes that had the old_node as their "get_ctrl" or "idom". We
>> 1160:   // clean up the forwarding links when we query "get_ctrl" or "idom".
>> 1161:   void install_lazy_ctrl_and_idom_forwarding(Node* old_node, Node* new_node) {
> 
> Maybe we don't need lazy sice "install forwarding" is already expressive enough:
> 
> Suggestion:
> 
>   void install_ctrl_and_idom_forwarding(Node* old_node, Node* new_node) {

Applied systematically :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447051099
PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447056113
PR Review Comment: https://git.openjdk.org/jdk/pull/27892#discussion_r2447060094


More information about the shenandoah-dev mailing list