| 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/effect-control-linearizer.h" | 5 #include "src/compiler/effect-control-linearizer.h" |
| 6 | 6 |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/compiler/access-builder.h" | 8 #include "src/compiler/access-builder.h" |
| 9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
| 10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 void UpdateBlockControl(BasicBlock* block, | 89 void UpdateBlockControl(BasicBlock* block, |
| 90 BlockEffectControlMap* block_effects) { | 90 BlockEffectControlMap* block_effects) { |
| 91 Node* control = block->NodeAt(0); | 91 Node* control = block->NodeAt(0); |
| 92 DCHECK(NodeProperties::IsControl(control)); | 92 DCHECK(NodeProperties::IsControl(control)); |
| 93 | 93 |
| 94 // Do not rewire the end node. | 94 // Do not rewire the end node. |
| 95 if (control->opcode() == IrOpcode::kEnd) return; | 95 if (control->opcode() == IrOpcode::kEnd) return; |
| 96 | 96 |
| 97 // Update all inputs to the given control node with the correct control. | 97 // Update all inputs to the given control node with the correct control. |
| 98 DCHECK(control->opcode() == IrOpcode::kMerge || | 98 DCHECK(control->opcode() == IrOpcode::kMerge || |
| 99 control->op()->ControlInputCount() == block->PredecessorCount()); | 99 static_cast<size_t>(control->op()->ControlInputCount()) == |
| 100 if (control->op()->ControlInputCount() != block->PredecessorCount()) { | 100 block->PredecessorCount()); |
| 101 if (static_cast<size_t>(control->op()->ControlInputCount()) != |
| 102 block->PredecessorCount()) { |
| 101 return; // We already re-wired the control inputs of this node. | 103 return; // We already re-wired the control inputs of this node. |
| 102 } | 104 } |
| 103 for (int i = 0; i < control->op()->ControlInputCount(); i++) { | 105 for (int i = 0; i < control->op()->ControlInputCount(); i++) { |
| 104 Node* input = NodeProperties::GetControlInput(control, i); | 106 Node* input = NodeProperties::GetControlInput(control, i); |
| 105 BasicBlock* predecessor = block->PredecessorAt(static_cast<size_t>(i)); | 107 BasicBlock* predecessor = block->PredecessorAt(static_cast<size_t>(i)); |
| 106 const BlockEffectControlData& block_effect = | 108 const BlockEffectControlData& block_effect = |
| 107 block_effects->For(predecessor, block); | 109 block_effects->For(predecessor, block); |
| 108 if (input != block_effect.current_control) { | 110 if (input != block_effect.current_control) { |
| 109 NodeProperties::ReplaceControlInput(control, block_effect.current_control, | 111 NodeProperties::ReplaceControlInput(control, block_effect.current_control, |
| 110 i); | 112 i); |
| (...skipping 3536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3647 isolate(), graph()->zone(), callable.descriptor(), 0, flags, | 3649 isolate(), graph()->zone(), callable.descriptor(), 0, flags, |
| 3648 Operator::kEliminatable); | 3650 Operator::kEliminatable); |
| 3649 to_number_operator_.set(common()->Call(desc)); | 3651 to_number_operator_.set(common()->Call(desc)); |
| 3650 } | 3652 } |
| 3651 return to_number_operator_.get(); | 3653 return to_number_operator_.get(); |
| 3652 } | 3654 } |
| 3653 | 3655 |
| 3654 } // namespace compiler | 3656 } // namespace compiler |
| 3655 } // namespace internal | 3657 } // namespace internal |
| 3656 } // namespace v8 | 3658 } // namespace v8 |
| OLD | NEW |