RFR: 8309463: IGV: Dynamic graph layout algorithm [v7]
Christian Hagedorn
chagedorn at openjdk.org
Thu Aug 24 10:55:34 UTC 2023
On Thu, 24 Aug 2023 08:28:44 GMT, emmyyin <duke at openjdk.org> wrote:
>> src/utils/IdealGraphVisualizer/HierarchicalLayout/src/main/java/com/sun/hotspot/igv/hierarchicallayout/HierarchicalStableLayoutManager.java line 807:
>>
>>> 805: n.preds.add(result);
>>> 806: result.to = n;
>>> 807: result.relativeTo = n.width / 2;
>>
>> `n.width` equals `DUMMY_WIDTH` here which is 1. `n.width / 2` is therefore always zero. Is it intended to set `result.relativeTo` and `e.relativeFrom` to zero? Same further down in `expandNewLayerBeneath()`.
>
> Yes since `relativeTo` and `relativeFrom` refers to the ports on the node, which is irrelevant for the dummy nodes. Could definitely be done differently, but this is how it is in `HierarchicalLayoutManager` and I thought it would be better to be consistent across the layout managers
Okay, thanks for the explanation. The code in `HierarchicalLayoutManager` looks very similar. So, you could also change `relativeTo` and `relativeFrom` to zero there. Or even better share the code somehow (if I see that correctly, the only difference is how to insert the node - `nodes.add(n)` vs. `insertNode(n, layer)`).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14349#discussion_r1304147633
More information about the hotspot-compiler-dev
mailing list