OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/node-properties.h" | 7 #include "src/compiler/node-properties.h" |
8 #include "src/compiler/operator-properties.h" | 8 #include "src/compiler/operator-properties.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 edge.UpdateTo(effect); | 189 edge.UpdateTo(effect); |
190 } else { | 190 } else { |
191 DCHECK_NOT_NULL(value); | 191 DCHECK_NOT_NULL(value); |
192 edge.UpdateTo(value); | 192 edge.UpdateTo(value); |
193 } | 193 } |
194 } | 194 } |
195 } | 195 } |
196 | 196 |
197 | 197 |
198 // static | 198 // static |
| 199 void NodeProperties::ChangeOp(Node* node, const Operator* new_op) { |
| 200 DCHECK_EQ(OperatorProperties::GetTotalInputCount(new_op), node->InputCount()); |
| 201 node->set_op(new_op); |
| 202 } |
| 203 |
| 204 |
| 205 // static |
199 Node* NodeProperties::FindProjection(Node* node, size_t projection_index) { | 206 Node* NodeProperties::FindProjection(Node* node, size_t projection_index) { |
200 for (auto use : node->uses()) { | 207 for (auto use : node->uses()) { |
201 if (use->opcode() == IrOpcode::kProjection && | 208 if (use->opcode() == IrOpcode::kProjection && |
202 ProjectionIndexOf(use->op()) == projection_index) { | 209 ProjectionIndexOf(use->op()) == projection_index) { |
203 return use; | 210 return use; |
204 } | 211 } |
205 } | 212 } |
206 return nullptr; | 213 return nullptr; |
207 } | 214 } |
208 | 215 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 // static | 280 // static |
274 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { | 281 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { |
275 if (num == 0) return false; | 282 if (num == 0) return false; |
276 int const index = edge.index(); | 283 int const index = edge.index(); |
277 return first <= index && index < first + num; | 284 return first <= index && index < first + num; |
278 } | 285 } |
279 | 286 |
280 } // namespace compiler | 287 } // namespace compiler |
281 } // namespace internal | 288 } // namespace internal |
282 } // namespace v8 | 289 } // namespace v8 |
OLD | NEW |