| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/node.h" | 5 #include "src/compiler/node.h" |
| 6 | 6 |
| 7 namespace v8 { | 7 namespace v8 { |
| 8 namespace internal { | 8 namespace internal { |
| 9 namespace compiler { | 9 namespace compiler { |
| 10 | 10 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 DCHECK_LE(0, index); | 186 DCHECK_LE(0, index); |
| 187 DCHECK_LT(index, InputCount()); | 187 DCHECK_LT(index, InputCount()); |
| 188 AppendInput(zone, InputAt(InputCount() - 1)); | 188 AppendInput(zone, InputAt(InputCount() - 1)); |
| 189 for (int i = InputCount() - 1; i > index; --i) { | 189 for (int i = InputCount() - 1; i > index; --i) { |
| 190 ReplaceInput(i, InputAt(i - 1)); | 190 ReplaceInput(i, InputAt(i - 1)); |
| 191 } | 191 } |
| 192 ReplaceInput(index, new_to); | 192 ReplaceInput(index, new_to); |
| 193 Verify(); | 193 Verify(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 void Node::InsertInputs(Zone* zone, int index, int count) { |
| 197 DCHECK_NOT_NULL(zone); |
| 198 DCHECK_LE(0, index); |
| 199 DCHECK_LT(0, count); |
| 200 DCHECK_LT(index, InputCount()); |
| 201 for (int i = 0; i < count; i++) { |
| 202 AppendInput(zone, InputAt(Max(InputCount() - count, 0))); |
| 203 } |
| 204 for (int i = InputCount() - count - 1; i >= Max(index, count); --i) { |
| 205 ReplaceInput(i, InputAt(i - count)); |
| 206 } |
| 207 for (int i = 0; i < count; i++) { |
| 208 ReplaceInput(index + i, nullptr); |
| 209 } |
| 210 Verify(); |
| 211 } |
| 196 | 212 |
| 197 void Node::RemoveInput(int index) { | 213 void Node::RemoveInput(int index) { |
| 198 DCHECK_LE(0, index); | 214 DCHECK_LE(0, index); |
| 199 DCHECK_LT(index, InputCount()); | 215 DCHECK_LT(index, InputCount()); |
| 200 for (; index < InputCount() - 1; ++index) { | 216 for (; index < InputCount() - 1; ++index) { |
| 201 ReplaceInput(index, InputAt(index + 1)); | 217 ReplaceInput(index, InputAt(index + 1)); |
| 202 } | 218 } |
| 203 TrimInputCount(InputCount() - 1); | 219 TrimInputCount(InputCount() - 1); |
| 204 Verify(); | 220 Verify(); |
| 205 } | 221 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 ++(*this); | 432 ++(*this); |
| 417 return result; | 433 return result; |
| 418 } | 434 } |
| 419 | 435 |
| 420 | 436 |
| 421 bool Node::Uses::empty() const { return begin() == end(); } | 437 bool Node::Uses::empty() const { return begin() == end(); } |
| 422 | 438 |
| 423 } // namespace compiler | 439 } // namespace compiler |
| 424 } // namespace internal | 440 } // namespace internal |
| 425 } // namespace v8 | 441 } // namespace v8 |
| OLD | NEW |