Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Unified Diff: tools/turbolizer/graph-view.js

Issue 2230083004: [turbolizer] Use locations rather than ranges everywhere (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove stray change Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/turbolizer/disassembly-view.js ('k') | tools/turbolizer/schedule-view.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/turbolizer/graph-view.js
diff --git a/tools/turbolizer/graph-view.js b/tools/turbolizer/graph-view.js
index 1863e1a7014cb8adfdf15e822e36ff369ff8a8c7..7d1ab06e0c348c4eeff2cc26ac9d802a8e4d04f6 100644
--- a/tools/turbolizer/graph-view.js
+++ b/tools/turbolizer/graph-view.js
@@ -34,7 +34,7 @@ class GraphView extends View {
broker.clear(selectionHandler);
},
select: function(items, selected) {
- var ranges = [];
+ var locations = [];
for (var d of items) {
if (selected) {
d.classList.add("selected");
@@ -42,22 +42,22 @@ class GraphView extends View {
d.classList.remove("selected");
}
var data = d.__data__;
- ranges.push([data.pos, data.pos + 1, data.id]);
+ locations.push({ pos_start: data.pos, pos_end: data.pos + 1, node_id: data.id});
}
- broker.select(selectionHandler, ranges, selected);
+ broker.select(selectionHandler, locations, selected);
},
selectionDifference: function(span1, inclusive1, span2, inclusive2) {
// Should not be called
},
- brokeredSelect: function(ranges, selected) {
+ brokeredSelect: function(locations, selected) {
var test = [].entries().next();
var selection = graph.nodes
.filter(function(n) {
var pos = n.pos;
- for (var range of ranges) {
- var start = range[0];
- var end = range[1];
- var id = range[2];
+ for (var location of locations) {
+ var start = location.pos_start;
+ var end = location.pos_end;
+ var id = location.node_id;
if (end != undefined) {
if (pos >= start && pos < end) {
return true;
@@ -240,6 +240,7 @@ class GraphView extends View {
if (rememberedSelection != null) {
this.attachSelection(rememberedSelection);
this.connectVisibleSelectedNodes();
+ this.viewSelection();
}
this.updateGraphVisibility();
}
« no previous file with comments | « tools/turbolizer/disassembly-view.js ('k') | tools/turbolizer/schedule-view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698