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/linkage.h" | 7 #include "src/compiler/linkage.h" |
8 #include "src/compiler/node-properties.h" | 8 #include "src/compiler/node-properties.h" |
9 #include "src/compiler/operator-properties.h" | 9 #include "src/compiler/operator-properties.h" |
10 #include "src/compiler/verifier.h" | 10 #include "src/compiler/verifier.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 | 133 |
134 // static | 134 // static |
135 void NodeProperties::ReplaceValueInput(Node* node, Node* value, int index) { | 135 void NodeProperties::ReplaceValueInput(Node* node, Node* value, int index) { |
136 DCHECK(index < node->op()->ValueInputCount()); | 136 DCHECK(index < node->op()->ValueInputCount()); |
137 node->ReplaceInput(FirstValueIndex(node) + index, value); | 137 node->ReplaceInput(FirstValueIndex(node) + index, value); |
138 } | 138 } |
139 | 139 |
140 | 140 |
141 // static | 141 // static |
| 142 void NodeProperties::ReplaceValueInputs(Node* node, Node* value) { |
| 143 int value_input_count = node->op()->ValueInputCount(); |
| 144 DCHECK_LE(1, value_input_count); |
| 145 node->ReplaceInput(0, value); |
| 146 while (--value_input_count > 0) { |
| 147 node->RemoveInput(value_input_count); |
| 148 } |
| 149 } |
| 150 |
| 151 |
| 152 // static |
142 void NodeProperties::ReplaceContextInput(Node* node, Node* context) { | 153 void NodeProperties::ReplaceContextInput(Node* node, Node* context) { |
143 node->ReplaceInput(FirstContextIndex(node), context); | 154 node->ReplaceInput(FirstContextIndex(node), context); |
144 } | 155 } |
145 | 156 |
146 | 157 |
147 // static | 158 // static |
148 void NodeProperties::ReplaceControlInput(Node* node, Node* control) { | 159 void NodeProperties::ReplaceControlInput(Node* node, Node* control) { |
149 node->ReplaceInput(FirstControlIndex(node), control); | 160 node->ReplaceInput(FirstControlIndex(node), control); |
150 } | 161 } |
151 | 162 |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 // static | 407 // static |
397 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { | 408 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { |
398 if (num == 0) return false; | 409 if (num == 0) return false; |
399 int const index = edge.index(); | 410 int const index = edge.index(); |
400 return first <= index && index < first + num; | 411 return first <= index && index < first + num; |
401 } | 412 } |
402 | 413 |
403 } // namespace compiler | 414 } // namespace compiler |
404 } // namespace internal | 415 } // namespace internal |
405 } // namespace v8 | 416 } // namespace v8 |
OLD | NEW |