RFR: JDK-8295461: IGV: Wrong src/dest nodes highlighted for edge

Tobias Holenstein tholenstein at openjdk.org
Fri Oct 21 15:07:16 UTC 2022


Outgoing edges in IGV are organized like trees. When hovering with the mouse over a segment of an edge, the edge is highlighted all the way up the the source node, as well as all the way down to the leave nodes. This works as expected. The nodes at the source and leaves of the highlighted segments are highlighted as well. There is a bug that instead of only highlighting the leave nodes in the subtree, IGV highlights all leave nodes:
![before](https://user-images.githubusercontent.com/71546117/197223077-962a5d97-c1c8-4720-9983-295e07468be9.png)

# Solution
The segments in the edge tree are `LineWidget` objects. Each `LineWidget` has a single `LineWidget` `predecessor` and list of `LineWidget` `successors`. When hovering over a line segment the `notifyStateChanged` function is called in the corresponding `LineWidget` : `predecessor` and `successors` `LineWidget` are recursively visited and highlighted here. The nodes (of super type `Vertex`) are new highlighted with a new `highlightVertices` function instead of using recursion. 
`highlightVertices(boolean enable)` uses the list of `connections` which already contains all the one-to-one connections between src/dest nodes that go through a single `LineWidget` segment. This gives as the `Vertex` nodes of the root as well as the leaves in the subtree of the hovered `LineWidget` segment.

Now the highlighting of the leave nodes works as expected: 
![ex1](https://user-images.githubusercontent.com/71546117/197225776-eb7cba50-6f6a-4f47-a91f-3b793021fdae.png)
![ex2](https://user-images.githubusercontent.com/71546117/197225789-d9510f36-d89a-44cd-ab69-1341edcafdfb.png)

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

Commit messages:
 - JDK-8295461: IGV: Wrong src/dest nodes highlighted for edge

Changes: https://git.openjdk.org/jdk/pull/10815/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10815&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8295461
  Stats: 58 lines in 1 file changed: 25 ins; 21 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/10815.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10815/head:pull/10815

PR: https://git.openjdk.org/jdk/pull/10815


More information about the hotspot-compiler-dev mailing list