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

Side by Side Diff: test/cctest/compiler/test-graph-visualizer.cc

Issue 1347353003: [turbofan] Checking of input counts on node creation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Split the CL (no node editor yet) Created 5 years, 3 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
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/v8.h" 5 #include "src/v8.h"
6 #include "test/cctest/cctest.h" 6 #include "test/cctest/cctest.h"
7 7
8 #include "src/compiler/common-operator.h" 8 #include "src/compiler/common-operator.h"
9 #include "src/compiler/graph.h" 9 #include "src/compiler/graph.h"
10 #include "src/compiler/graph-visualizer.h" 10 #include "src/compiler/graph-visualizer.h"
11 #include "src/compiler/js-operator.h" 11 #include "src/compiler/js-operator.h"
12 #include "src/compiler/machine-operator.h" 12 #include "src/compiler/machine-operator.h"
13 #include "src/compiler/node.h" 13 #include "src/compiler/node.h"
14 #include "src/compiler/operator.h" 14 #include "src/compiler/operator.h"
15 #include "src/compiler/schedule.h" 15 #include "src/compiler/schedule.h"
16 #include "src/compiler/scheduler.h" 16 #include "src/compiler/scheduler.h"
17 #include "src/compiler/source-position.h" 17 #include "src/compiler/source-position.h"
18 #include "src/compiler/verifier.h" 18 #include "src/compiler/verifier.h"
19 19
20 using namespace v8::internal; 20 using namespace v8::internal;
21 using namespace v8::internal::compiler; 21 using namespace v8::internal::compiler;
22 22
23 static Operator dummy_operator(IrOpcode::kParameter, Operator::kNoWrite, 23 static Operator dummy_operator1(IrOpcode::kParameter, Operator::kNoWrite,
24 "dummy", 0, 0, 0, 1, 0, 0); 24 "dummy", 1, 0, 0, 1, 0, 0);
25 static Operator dummy_operator6(IrOpcode::kParameter, Operator::kNoWrite,
26 "dummy", 6, 0, 0, 1, 0, 0);
25 27
26 28
27 TEST(NodeWithNullInputReachableFromEnd) { 29 TEST(NodeWithNullInputReachableFromEnd) {
28 HandleAndZoneScope scope; 30 HandleAndZoneScope scope;
29 Graph graph(scope.main_zone()); 31 Graph graph(scope.main_zone());
30 CommonOperatorBuilder common(scope.main_zone()); 32 CommonOperatorBuilder common(scope.main_zone());
31 33
32 Node* start = graph.NewNode(common.Start(0)); 34 Node* start = graph.NewNode(common.Start(0));
33 graph.SetStart(start); 35 graph.SetStart(start);
34 Node* k = graph.NewNode(common.Int32Constant(0)); 36 Node* k = graph.NewNode(common.Int32Constant(0));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 } 101 }
100 102
101 103
102 TEST(NodeNetworkOfDummiesReachableFromEnd) { 104 TEST(NodeNetworkOfDummiesReachableFromEnd) {
103 HandleAndZoneScope scope; 105 HandleAndZoneScope scope;
104 Graph graph(scope.main_zone()); 106 Graph graph(scope.main_zone());
105 CommonOperatorBuilder common(scope.main_zone()); 107 CommonOperatorBuilder common(scope.main_zone());
106 108
107 Node* start = graph.NewNode(common.Start(0)); 109 Node* start = graph.NewNode(common.Start(0));
108 graph.SetStart(start); 110 graph.SetStart(start);
109 Node* n2 = graph.NewNode(&dummy_operator, graph.start()); 111 Node* n2 = graph.NewNode(&dummy_operator1, graph.start());
110 Node* n3 = graph.NewNode(&dummy_operator, graph.start()); 112 Node* n3 = graph.NewNode(&dummy_operator1, graph.start());
111 Node* n4 = graph.NewNode(&dummy_operator, n2); 113 Node* n4 = graph.NewNode(&dummy_operator1, n2);
112 Node* n5 = graph.NewNode(&dummy_operator, n2); 114 Node* n5 = graph.NewNode(&dummy_operator1, n2);
113 Node* n6 = graph.NewNode(&dummy_operator, n3); 115 Node* n6 = graph.NewNode(&dummy_operator1, n3);
114 Node* n7 = graph.NewNode(&dummy_operator, n3); 116 Node* n7 = graph.NewNode(&dummy_operator1, n3);
115 Node* n8 = graph.NewNode(&dummy_operator, n5); 117 Node* n8 = graph.NewNode(&dummy_operator1, n5);
116 Node* n9 = graph.NewNode(&dummy_operator, n5); 118 Node* n9 = graph.NewNode(&dummy_operator1, n5);
117 Node* n10 = graph.NewNode(&dummy_operator, n9); 119 Node* n10 = graph.NewNode(&dummy_operator1, n9);
118 Node* n11 = graph.NewNode(&dummy_operator, n9); 120 Node* n11 = graph.NewNode(&dummy_operator1, n9);
119 Node* end_dependencies[6] = {n4, n8, n10, n11, n6, n7}; 121 Node* end_dependencies[6] = {n4, n8, n10, n11, n6, n7};
120 Node* end = graph.NewNode(&dummy_operator, 6, end_dependencies); 122 Node* end = graph.NewNode(&dummy_operator6, 6, end_dependencies);
121 graph.SetEnd(end); 123 graph.SetEnd(end);
122 124
123 OFStream os(stdout); 125 OFStream os(stdout);
124 os << AsDOT(graph); 126 os << AsDOT(graph);
125 SourcePositionTable table(&graph); 127 SourcePositionTable table(&graph);
126 os << AsJSON(graph, &table); 128 os << AsJSON(graph, &table);
127 } 129 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698