-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDK-8293480: IGV: Update Bytecode and ControlFlow Component immediately when opening a new graph #10196
Conversation
👋 Welcome back tholenstein! A progress list of the required criteria for merging this PR into |
@tobiasholenstein The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this UI improvement, Tobias, looks good to me! There is one more case where the Bytecode and Control Flow windows get out of sync: after removing all graphs and groups in the Outline, they still show the content of the graph that was last active:
This problem existed before the changeset, so it might be addressed here or in a separate issue, whatever you think makes more sense.
...sualizer/Bytecodes/src/main/java/com/sun/hotspot/igv/bytecodes/BytecodeViewTopComponent.java
Outdated
Show resolved
Hide resolved
...lizer/ControlFlow/src/main/java/com/sun/hotspot/igv/controlflow/ControlFlowTopComponent.java
Outdated
Show resolved
Hide resolved
...isualizer/Coordinator/src/main/java/com/sun/hotspot/igv/coordinator/OutlineTopComponent.java
Outdated
Show resolved
Hide resolved
@tobiasholenstein This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 277 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
Thanks for spotting that @robcasloz! I fixed it now. As a by-product of my fix, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the additional case, Tobias. I found an issue in the new revision, though: the graph selected in the Outline is not updated when clicking on the "Show previous / next graph of the current group" buttons. Furthermore, after clicking a few times forward and backwards (~20 times or more), IGV becomes very unresponsive (tens of seconds to update the graph view).
You are right, @robcasloz, my last fix didn't solve the problem. There was a fundamental problem with using Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried out the latest changes and it works as expected, thanks! However, I found one more case where the Control Flow window get out of sync with the active graph: if you open a graph and then go to the Outline and click on "Remove selected graphs and groups" (where only the opened graph is selected), the active graph changes to another graph in the same group but the Control Flow window still shows the CFG of the removed graph. Even though this problem is not introduced by this changeset, I suggest addressing it here.
Also, please make sure that the NetBeans-generated code moved by this changeset is still editable in its new context.
Thanks for trying it out! You are right. It also happens when deleting a graph with a smaller index number in the same group. The reason is that the If you don't mind I prefer filing a Bug for this and solve it separately |
Sure, makes sense given that the bug seems to have a different root cause. |
I filed the bug: https://bugs.openjdk.org/browse/JDK-8294066 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, looks good!
...isualizer/Coordinator/src/main/java/com/sun/hotspot/igv/coordinator/OutlineTopComponent.java
Outdated
Show resolved
Hide resolved
src/utils/IdealGraphVisualizer/Util/src/main/java/com/sun/hotspot/igv/util/LookupHistory.java
Outdated
Show resolved
Hide resolved
...ealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/EditorInputGraphProvider.java
Show resolved
Hide resolved
...ils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/EditorTopComponent.java
Outdated
Show resolved
Hide resolved
...ils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/EditorTopComponent.java
Outdated
Show resolved
Hide resolved
...utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/DiagramViewModel.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
…pot/igv/util/LookupHistory.java remove this Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
Co-authored-by: Christian Hagedorn <christian.hagedorn@oracle.com>
@robcasloz I checked that NetBeans-generated is still editable. @chhagedorn I have applied the code style changes you suggested. |
@robcasloz and @chhagedorn thanks for the reviews! /integrate |
Going to push as commit 4e7cb15.
Your commit was automatically rebased without conflicts. |
@tobiasholenstein Pushed as commit 4e7cb15. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
The
BytecodeViewTopComponent
andControlFlowTopComponent
represent information depending on which graph is opened inEditorTopComponent
. PreviouslyBytecodeViewTopComponent
andControlFlowTopComponent
did not update their contents immediately when a new graph from another group was opened inEditorTopComponent
. They were also not updated when switching between two tabs of an open graph.OutlineTopComponent
had the same problem to update the selected graphs according to theEditorTopComponent
Analysis
BytecodeViewTopComponent
,ControlFlowTopComponent
andOutlineTopComponent
each represent information that depends on theInputGraph
of the currently or last activeEditorTopComponent
. This information is made available globally by adding a newInputGraphProvider
to theLookup
ofEditorTopComponent
each time theInputGraph
changes.BytecodeViewTopComponent
,ControlFlowTopComponent
andOutlineTopComponent
implement aLookupListener
that callsresultChanged(LookupEvent lookupEvent)
whenever aInputGraphProvider
changes in in the lookup ofUtilities.actionsGlobalContext()
. When such a change happens the last activeInputGraphProvider
is retrieved from theLookupHistory
by the listening components.Problem
First, we missed to
fire()
adiagramChangedEvent
in the constructor ofEditorTopComponent
which trigger to add theInputGraphProvider
to theLookup
Second,
Utilities.actionsGlobalContext()
returns aLookup
of the active (focused)TopComponent's
Lookup
. Unfortunately, when the lastEditorTopComponent
theLookupListener
does not get called and there is no way to call is manually.New Approach
We extends the
LookupHistory
class such that we can add aChangedListener
that gets called whenever the last activeInputGraphProvider
is cached. So instead of listening to changes inUtilities.actionsGlobalContext()
and then consulting theLookupHistory
, nowBytecodeViewTopComponent
,ControlFlowTopComponent
andOutlineTopComponent
listen to changes in theLookupHistory
directly. This way we can now callterminate
in theLookupHistory
whenever we close aEditorTopComponent
, which directly notifies the listeners.Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10196/head:pull/10196
$ git checkout pull/10196
Update a local copy of the PR:
$ git checkout pull/10196
$ git pull https://git.openjdk.org/jdk pull/10196/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 10196
View PR using the GUI difftool:
$ git pr show -t 10196
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10196.diff