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 #ifndef V8_COMPILER_GENERIC_NODE_INL_H_ | 5 #ifndef V8_COMPILER_GENERIC_NODE_INL_H_ |
6 #define V8_COMPILER_GENERIC_NODE_INL_H_ | 6 #define V8_COMPILER_GENERIC_NODE_INL_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compiler/generic-graph.h" | 10 #include "src/compiler/generic-graph.h" |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 DCHECK(index >= 0 && index < InputCount()); | 171 DCHECK(index >= 0 && index < InputCount()); |
172 // TODO(turbofan): Optimize this implementation! | 172 // TODO(turbofan): Optimize this implementation! |
173 AppendInput(zone, InputAt(InputCount() - 1)); | 173 AppendInput(zone, InputAt(InputCount() - 1)); |
174 for (int i = InputCount() - 1; i > index; --i) { | 174 for (int i = InputCount() - 1; i > index; --i) { |
175 ReplaceInput(i, InputAt(i - 1)); | 175 ReplaceInput(i, InputAt(i - 1)); |
176 } | 176 } |
177 ReplaceInput(index, to_insert); | 177 ReplaceInput(index, to_insert); |
178 } | 178 } |
179 | 179 |
180 template <class B, class S> | 180 template <class B, class S> |
| 181 void GenericNode<B, S>::RemoveInput(int index) { |
| 182 DCHECK(index >= 0 && index < InputCount()); |
| 183 // TODO(turbofan): Optimize this implementation! |
| 184 for (; index < InputCount() - 1; ++index) { |
| 185 ReplaceInput(index, InputAt(index + 1)); |
| 186 } |
| 187 TrimInputCount(InputCount() - 1); |
| 188 } |
| 189 |
| 190 template <class B, class S> |
181 void GenericNode<B, S>::AppendUse(Use* use) { | 191 void GenericNode<B, S>::AppendUse(Use* use) { |
182 use->next = NULL; | 192 use->next = NULL; |
183 use->prev = last_use_; | 193 use->prev = last_use_; |
184 if (last_use_ == NULL) { | 194 if (last_use_ == NULL) { |
185 first_use_ = use; | 195 first_use_ = use; |
186 } else { | 196 } else { |
187 last_use_->next = use; | 197 last_use_->next = use; |
188 } | 198 } |
189 last_use_ = use; | 199 last_use_ = use; |
190 ++use_count_; | 200 ++use_count_; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 ++use; | 247 ++use; |
238 ++input; | 248 ++input; |
239 } | 249 } |
240 return result; | 250 return result; |
241 } | 251 } |
242 } | 252 } |
243 } | 253 } |
244 } // namespace v8::internal::compiler | 254 } // namespace v8::internal::compiler |
245 | 255 |
246 #endif // V8_COMPILER_GENERIC_NODE_INL_H_ | 256 #endif // V8_COMPILER_GENERIC_NODE_INL_H_ |
OLD | NEW |