OLD | NEW |
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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/control-reducer.h" | 6 #include "src/compiler/control-reducer.h" |
7 #include "src/compiler/graph.h" | 7 #include "src/compiler/graph.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/node-matchers.h" | 9 #include "src/compiler/node-matchers.h" |
10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 | 299 |
300 Node* dead() { | 300 Node* dead() { |
301 if (dead_ == NULL) dead_ = graph()->NewNode(common_->Dead()); | 301 if (dead_ == NULL) dead_ = graph()->NewNode(common_->Dead()); |
302 return dead_; | 302 return dead_; |
303 } | 303 } |
304 | 304 |
305 //=========================================================================== | 305 //=========================================================================== |
306 // Reducer implementation: perform reductions on a node. | 306 // Reducer implementation: perform reductions on a node. |
307 //=========================================================================== | 307 //=========================================================================== |
308 Node* ReduceNode(Node* node) { | 308 Node* ReduceNode(Node* node) { |
309 if (OperatorProperties::GetControlInputCount(node->op()) == 1) { | 309 if (node->op()->ControlInputCount() == 1) { |
310 // If a node has only one control input and it is dead, replace with dead. | 310 // If a node has only one control input and it is dead, replace with dead. |
311 Node* control = NodeProperties::GetControlInput(node); | 311 Node* control = NodeProperties::GetControlInput(node); |
312 if (control->opcode() == IrOpcode::kDead) { | 312 if (control->opcode() == IrOpcode::kDead) { |
313 TRACE(("ControlDead: #%d:%s\n", node->id(), node->op()->mnemonic())); | 313 TRACE(("ControlDead: #%d:%s\n", node->id(), node->op()->mnemonic())); |
314 return control; | 314 return control; |
315 } | 315 } |
316 } | 316 } |
317 | 317 |
318 // Reduce branches, phis, and merges. | 318 // Reduce branches, phis, and merges. |
319 switch (node->opcode()) { | 319 switch (node->opcode()) { |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 Node* ControlReducer::ReduceBranchForTesting(JSGraph* jsgraph, | 557 Node* ControlReducer::ReduceBranchForTesting(JSGraph* jsgraph, |
558 CommonOperatorBuilder* common, | 558 CommonOperatorBuilder* common, |
559 Node* node) { | 559 Node* node) { |
560 Zone zone(jsgraph->graph()->zone()->isolate()); | 560 Zone zone(jsgraph->graph()->zone()->isolate()); |
561 ControlReducerImpl impl(&zone, jsgraph, common); | 561 ControlReducerImpl impl(&zone, jsgraph, common); |
562 return impl.ReduceBranch(node); | 562 return impl.ReduceBranch(node); |
563 } | 563 } |
564 } | 564 } |
565 } | 565 } |
566 } // namespace v8::internal::compiler | 566 } // namespace v8::internal::compiler |
OLD | NEW |