| 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/graph-inl.h" | 5 #include "src/compiler/graph-inl.h" |
| 6 #include "src/compiler/js-typed-lowering.h" | 6 #include "src/compiler/js-typed-lowering.h" |
| 7 #include "src/compiler/node-aux-data-inl.h" | 7 #include "src/compiler/node-aux-data-inl.h" |
| 8 #include "src/compiler/node-properties-inl.h" | 8 #include "src/compiler/node-properties-inl.h" |
| 9 #include "src/types.h" | 9 #include "src/types.h" |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 Node* l = left(); | 93 Node* l = left(); |
| 94 Node* r = right(); | 94 Node* r = right(); |
| 95 node_->ReplaceInput(0, r); | 95 node_->ReplaceInput(0, r); |
| 96 node_->ReplaceInput(1, l); | 96 node_->ReplaceInput(1, l); |
| 97 std::swap(left_type_, right_type_); | 97 std::swap(left_type_, right_type_); |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Remove all effect and control inputs and outputs to this node and change | 100 // Remove all effect and control inputs and outputs to this node and change |
| 101 // to the pure operator {op}, possibly inserting a boolean inversion. | 101 // to the pure operator {op}, possibly inserting a boolean inversion. |
| 102 Reduction ChangeToPureOperator(Operator* op, bool invert = false) { | 102 Reduction ChangeToPureOperator(Operator* op, bool invert = false) { |
| 103 ASSERT_EQ(0, OperatorProperties::GetEffectInputCount(op)); | 103 DCHECK_EQ(0, OperatorProperties::GetEffectInputCount(op)); |
| 104 ASSERT_EQ(false, OperatorProperties::HasContextInput(op)); | 104 DCHECK_EQ(false, OperatorProperties::HasContextInput(op)); |
| 105 ASSERT_EQ(0, OperatorProperties::GetControlInputCount(op)); | 105 DCHECK_EQ(0, OperatorProperties::GetControlInputCount(op)); |
| 106 ASSERT_EQ(2, OperatorProperties::GetValueInputCount(op)); | 106 DCHECK_EQ(2, OperatorProperties::GetValueInputCount(op)); |
| 107 | 107 |
| 108 // Remove the effects from the node, if any, and update its effect usages. | 108 // Remove the effects from the node, if any, and update its effect usages. |
| 109 if (OperatorProperties::GetEffectInputCount(node_->op()) > 0) { | 109 if (OperatorProperties::GetEffectInputCount(node_->op()) > 0) { |
| 110 RelaxEffects(node_); | 110 RelaxEffects(node_); |
| 111 } | 111 } |
| 112 // Remove the inputs corresponding to context, effect, and control. | 112 // Remove the inputs corresponding to context, effect, and control. |
| 113 NodeProperties::RemoveNonValueInputs(node_); | 113 NodeProperties::RemoveNonValueInputs(node_); |
| 114 // Finally, update the operator to the new one. | 114 // Finally, update the operator to the new one. |
| 115 node_->set_op(op); | 115 node_->set_op(op); |
| 116 | 116 |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 return ReplaceWithReduction(node, | 595 return ReplaceWithReduction(node, |
| 596 ReduceJSToStringInput(node->InputAt(0))); | 596 ReduceJSToStringInput(node->InputAt(0))); |
| 597 default: | 597 default: |
| 598 break; | 598 break; |
| 599 } | 599 } |
| 600 return NoChange(); | 600 return NoChange(); |
| 601 } | 601 } |
| 602 } | 602 } |
| 603 } | 603 } |
| 604 } // namespace v8::internal::compiler | 604 } // namespace v8::internal::compiler |
| OLD | NEW |