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

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

Issue 426233002: Land the Fan (disabled) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "src/compiler/graph-replay.h"
6
7 #include "src/compiler/common-operator.h"
8 #include "src/compiler/graph.h"
9 #include "src/compiler/graph-inl.h"
10 #include "src/compiler/node.h"
11 #include "src/compiler/operator.h"
12 #include "src/compiler/operator-properties-inl.h"
13
14 namespace v8 {
15 namespace internal {
16 namespace compiler {
17
18 #ifdef DEBUG
19
20 void GraphReplayPrinter::PrintReplay(Graph* graph) {
21 GraphReplayPrinter replay;
22 PrintF(" Node* nil = graph.NewNode(common_builder.Dead());\n");
23 graph->VisitNodeInputsFromEnd(&replay);
24 }
25
26
27 GenericGraphVisit::Control GraphReplayPrinter::Pre(Node* node) {
28 PrintReplayOpCreator(node->op());
29 PrintF(" Node* n%d = graph.NewNode(op", node->id());
30 for (int i = 0; i < node->InputCount(); ++i) {
31 PrintF(", nil");
32 }
33 PrintF("); USE(n%d);\n", node->id());
34 return GenericGraphVisit::CONTINUE;
35 }
36
37
38 void GraphReplayPrinter::PostEdge(Node* from, int index, Node* to) {
39 PrintF(" n%d->ReplaceInput(%d, n%d);\n", from->id(), index, to->id());
40 }
41
42
43 void GraphReplayPrinter::PrintReplayOpCreator(Operator* op) {
44 IrOpcode::Value opcode = static_cast<IrOpcode::Value>(op->opcode());
45 const char* builder = IrOpcode::IsCommonOpcode(opcode)
46 ? "common_builder" : "js_builder";
47 const char* mnemonic = IrOpcode::IsCommonOpcode(opcode)
48 ? IrOpcode::Mnemonic(opcode) : IrOpcode::Mnemonic(opcode) + 2;
49 PrintF(" op = %s.%s(", builder, mnemonic);
50 switch (opcode) {
51 case IrOpcode::kParameter:
52 case IrOpcode::kNumberConstant:
53 PrintF("0");
54 break;
55 case IrOpcode::kLoad:
56 PrintF("unique_name");
57 break;
58 case IrOpcode::kHeapConstant:
59 PrintF("unique_constant");
60 break;
61 case IrOpcode::kPhi:
62 PrintF("%d", op->InputCount());
63 break;
64 case IrOpcode::kEffectPhi:
65 PrintF("%d", OperatorProperties::GetEffectInputCount(op));
66 break;
67 case IrOpcode::kLoop:
68 case IrOpcode::kMerge:
69 PrintF("%d", OperatorProperties::GetControlInputCount(op));
70 break;
71 default:
72 break;
73 }
74 PrintF(");\n");
75 }
76
77 #endif // DEBUG
78
79 } } } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « src/compiler/graph-replay.h ('k') | src/compiler/graph-visualizer.h » ('j') | src/lithium-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698