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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/compiler/all-nodes.cc ('k') | src/compiler/node.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/graph-visualizer.h" 5 #include "src/compiler/graph-visualizer.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 #include <string> 8 #include <string>
9 9
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 void GraphVisualizer::Print() { 354 void GraphVisualizer::Print() {
355 os_ << "digraph D {\n" 355 os_ << "digraph D {\n"
356 << " node [fontsize=8,height=0.25]\n" 356 << " node [fontsize=8,height=0.25]\n"
357 << " rankdir=\"BT\"\n" 357 << " rankdir=\"BT\"\n"
358 << " ranksep=\"1.2 equally\"\n" 358 << " ranksep=\"1.2 equally\"\n"
359 << " overlap=\"false\"\n" 359 << " overlap=\"false\"\n"
360 << " splines=\"true\"\n" 360 << " splines=\"true\"\n"
361 << " concentrate=\"true\"\n" 361 << " concentrate=\"true\"\n"
362 << " \n"; 362 << " \n";
363 363
364 // Find all nodes that are not reachable from end that use live nodes.
365 std::set<Node*> gray;
366 for (Node* const node : all_.live) {
367 for (Node* const use : node->uses()) {
368 if (!all_.IsLive(use)) gray.insert(use);
369 }
370 }
371
364 // Make sure all nodes have been output before writing out the edges. 372 // Make sure all nodes have been output before writing out the edges.
365 for (Node* const node : all_.live) PrintNode(node, false); 373 for (Node* const node : all_.live) PrintNode(node, false);
366 for (Node* const node : all_.gray) PrintNode(node, true); 374 for (Node* const node : gray) PrintNode(node, true);
367 375
368 // With all the nodes written, add the edges. 376 // With all the nodes written, add the edges.
369 for (Node* const node : all_.live) { 377 for (Node* const node : all_.live) {
370 for (Edge edge : node->use_edges()) { 378 for (Edge edge : node->use_edges()) {
371 PrintEdge(edge); 379 PrintEdge(edge);
372 } 380 }
373 } 381 }
374 os_ << "}\n"; 382 os_ << "}\n";
375 } 383 }
376 384
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 os << "#" << SafeId(i) << ":" << SafeMnemonic(i); 815 os << "#" << SafeId(i) << ":" << SafeMnemonic(i);
808 } 816 }
809 os << ")" << std::endl; 817 os << ")" << std::endl;
810 } 818 }
811 } 819 }
812 return os; 820 return os;
813 } 821 }
814 } 822 }
815 } 823 }
816 } // namespace v8::internal::compiler 824 } // namespace v8::internal::compiler
OLDNEW
« 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