OLD | NEW |
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/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/generic-node-inl.h" | 8 #include "src/compiler/generic-node-inl.h" |
9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 CHECK_EQ(0, static_cast<int>(schedule.end()->SuccessorCount())); | 156 CHECK_EQ(0, static_cast<int>(schedule.end()->SuccessorCount())); |
157 CHECK_EQ(merge, schedule.end()->PredecessorAt(0)); | 157 CHECK_EQ(merge, schedule.end()->PredecessorAt(0)); |
158 } | 158 } |
159 | 159 |
160 | 160 |
161 TEST(BuildMulNodeGraph) { | 161 TEST(BuildMulNodeGraph) { |
162 HandleAndZoneScope scope; | 162 HandleAndZoneScope scope; |
163 Schedule schedule(scope.main_zone()); | 163 Schedule schedule(scope.main_zone()); |
164 Graph graph(scope.main_zone()); | 164 Graph graph(scope.main_zone()); |
165 CommonOperatorBuilder common(scope.main_zone()); | 165 CommonOperatorBuilder common(scope.main_zone()); |
166 MachineOperatorBuilder machine; | 166 // TODO(titzer): use test operators. |
| 167 MachineOperatorBuilder machine(scope.main_zone()); |
167 | 168 |
168 Node* start = graph.NewNode(common.Start(0)); | 169 Node* start = graph.NewNode(common.Start(0)); |
169 graph.SetStart(start); | 170 graph.SetStart(start); |
170 Node* param0 = graph.NewNode(common.Parameter(0), graph.start()); | 171 Node* param0 = graph.NewNode(common.Parameter(0), graph.start()); |
171 Node* param1 = graph.NewNode(common.Parameter(1), graph.start()); | 172 Node* param1 = graph.NewNode(common.Parameter(1), graph.start()); |
172 | 173 |
173 Node* mul = graph.NewNode(machine.Int32Mul(), param0, param1); | 174 Node* mul = graph.NewNode(machine.Int32Mul(), param0, param1); |
174 Node* ret = graph.NewNode(common.Return(), mul, start); | 175 Node* ret = graph.NewNode(common.Return(), mul, start); |
175 | 176 |
176 USE(ret); | 177 USE(ret); |
177 } | 178 } |
OLD | NEW |