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

Unified Diff: src/compiler/graph-visualizer.cc

Issue 940403002: [turbofan] Don't compute unneeded gray set in AllNodes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « src/compiler/all-nodes.cc ('k') | src/compiler/node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-visualizer.cc
diff --git a/src/compiler/graph-visualizer.cc b/src/compiler/graph-visualizer.cc
index 42d355fb1dba50a18943b4da4621f43039771a45..9947be2999859141e1373c4feea15aaf8e48f0e1 100644
--- a/src/compiler/graph-visualizer.cc
+++ b/src/compiler/graph-visualizer.cc
@@ -361,9 +361,17 @@ void GraphVisualizer::Print() {
<< " concentrate=\"true\"\n"
<< " \n";
+ // Find all nodes that are not reachable from end that use live nodes.
+ std::set<Node*> gray;
+ for (Node* const node : all_.live) {
+ for (Node* const use : node->uses()) {
+ if (!all_.IsLive(use)) gray.insert(use);
+ }
+ }
+
// Make sure all nodes have been output before writing out the edges.
for (Node* const node : all_.live) PrintNode(node, false);
- for (Node* const node : all_.gray) PrintNode(node, true);
+ for (Node* const node : gray) PrintNode(node, true);
// With all the nodes written, add the edges.
for (Node* const node : all_.live) {
« no previous file with comments | « src/compiler/all-nodes.cc ('k') | src/compiler/node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698