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

Side by Side Diff: src/compiler/graph-replay.cc

Issue 701473002: Make generic algorithm less generic. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Jaro. Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « src/compiler/graph-replay.h ('k') | src/compiler/graph-visualizer.cc » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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-replay.h" 5 #include "src/compiler/graph-replay.h"
6 6
7 #include "src/compiler/common-operator.h" 7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 #include "src/compiler/graph-inl.h" 9 #include "src/compiler/graph-inl.h"
10 #include "src/compiler/node.h" 10 #include "src/compiler/node.h"
11 #include "src/compiler/operator.h" 11 #include "src/compiler/operator.h"
12 #include "src/compiler/operator-properties-inl.h" 12 #include "src/compiler/operator-properties-inl.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 namespace compiler { 16 namespace compiler {
17 17
18 #ifdef DEBUG 18 #ifdef DEBUG
19 19
20 void GraphReplayPrinter::PrintReplay(Graph* graph) { 20 void GraphReplayPrinter::PrintReplay(Graph* graph) {
21 GraphReplayPrinter replay; 21 GraphReplayPrinter replay;
22 PrintF(" Node* nil = graph.NewNode(common_builder.Dead());\n"); 22 PrintF(" Node* nil = graph.NewNode(common_builder.Dead());\n");
23 graph->VisitNodeInputsFromEnd(&replay); 23 graph->VisitNodeInputsFromEnd(&replay);
24 } 24 }
25 25
26 26
27 GenericGraphVisit::Control GraphReplayPrinter::Pre(Node* node) { 27 void GraphReplayPrinter::Pre(Node* node) {
28 PrintReplayOpCreator(node->op()); 28 PrintReplayOpCreator(node->op());
29 PrintF(" Node* n%d = graph.NewNode(op", node->id()); 29 PrintF(" Node* n%d = graph.NewNode(op", node->id());
30 for (int i = 0; i < node->InputCount(); ++i) { 30 for (int i = 0; i < node->InputCount(); ++i) {
31 PrintF(", nil"); 31 PrintF(", nil");
32 } 32 }
33 PrintF("); USE(n%d);\n", node->id()); 33 PrintF("); USE(n%d);\n", node->id());
34 return GenericGraphVisit::CONTINUE;
35 } 34 }
36 35
37 36
38 void GraphReplayPrinter::PostEdge(Node* from, int index, Node* to) { 37 void GraphReplayPrinter::PostEdge(Node* from, int index, Node* to) {
39 PrintF(" n%d->ReplaceInput(%d, n%d);\n", from->id(), index, to->id()); 38 PrintF(" n%d->ReplaceInput(%d, n%d);\n", from->id(), index, to->id());
40 } 39 }
41 40
42 41
43 void GraphReplayPrinter::PrintReplayOpCreator(const Operator* op) { 42 void GraphReplayPrinter::PrintReplayOpCreator(const Operator* op) {
44 IrOpcode::Value opcode = static_cast<IrOpcode::Value>(op->opcode()); 43 IrOpcode::Value opcode = static_cast<IrOpcode::Value>(op->opcode());
(...skipping 27 matching lines...) Expand all
72 default: 71 default:
73 break; 72 break;
74 } 73 }
75 PrintF(");\n"); 74 PrintF(");\n");
76 } 75 }
77 76
78 #endif // DEBUG 77 #endif // DEBUG
79 } 78 }
80 } 79 }
81 } // namespace v8::internal::compiler 80 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « src/compiler/graph-replay.h ('k') | src/compiler/graph-visualizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698