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/js-operator.h" | 7 #include "src/compiler/js-operator.h" |
8 #include "src/compiler/linkage.h" | 8 #include "src/compiler/linkage.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 #include "src/compiler/operator-properties.h" | 10 #include "src/compiler/operator-properties.h" |
(...skipping 140 matching lines...) Loading... |
151 } | 151 } |
152 | 152 |
153 | 153 |
154 // static | 154 // static |
155 void NodeProperties::ReplaceContextInput(Node* node, Node* context) { | 155 void NodeProperties::ReplaceContextInput(Node* node, Node* context) { |
156 node->ReplaceInput(FirstContextIndex(node), context); | 156 node->ReplaceInput(FirstContextIndex(node), context); |
157 } | 157 } |
158 | 158 |
159 | 159 |
160 // static | 160 // static |
161 void NodeProperties::ReplaceControlInput(Node* node, Node* control) { | 161 void NodeProperties::ReplaceControlInput(Node* node, Node* control, int index) { |
162 node->ReplaceInput(FirstControlIndex(node), control); | 162 DCHECK(index < node->op()->ControlInputCount()); |
| 163 node->ReplaceInput(FirstControlIndex(node) + index, control); |
163 } | 164 } |
164 | 165 |
165 | 166 |
166 // static | 167 // static |
167 void NodeProperties::ReplaceEffectInput(Node* node, Node* effect, int index) { | 168 void NodeProperties::ReplaceEffectInput(Node* node, Node* effect, int index) { |
168 DCHECK(index < node->op()->EffectInputCount()); | 169 DCHECK(index < node->op()->EffectInputCount()); |
169 return node->ReplaceInput(FirstEffectIndex(node) + index, effect); | 170 return node->ReplaceInput(FirstEffectIndex(node) + index, effect); |
170 } | 171 } |
171 | 172 |
172 | 173 |
(...skipping 246 matching lines...) Loading... |
419 // static | 420 // static |
420 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { | 421 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { |
421 if (num == 0) return false; | 422 if (num == 0) return false; |
422 int const index = edge.index(); | 423 int const index = edge.index(); |
423 return first <= index && index < first + num; | 424 return first <= index && index < first + num; |
424 } | 425 } |
425 | 426 |
426 } // namespace compiler | 427 } // namespace compiler |
427 } // namespace internal | 428 } // namespace internal |
428 } // namespace v8 | 429 } // namespace v8 |
OLD | NEW |