Chromium Code Reviews| 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_H_ | 5 #ifndef V8_COMPILER_GENERIC_NODE_H_ |
| 6 #define V8_COMPILER_GENERIC_NODE_H_ | 6 #define V8_COMPILER_GENERIC_NODE_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/zone-containers.h" | 10 #include "src/zone-containers.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 | 34 |
| 35 inline NodeId id() const { return id_; } | 35 inline NodeId id() const { return id_; } |
| 36 | 36 |
| 37 int InputCount() const { return input_count_; } | 37 int InputCount() const { return input_count_; } |
| 38 S* InputAt(int index) const { | 38 S* InputAt(int index) const { |
| 39 return static_cast<S*>(GetInputRecordPtr(index)->to); | 39 return static_cast<S*>(GetInputRecordPtr(index)->to); |
| 40 } | 40 } |
| 41 inline void ReplaceInput(int index, GenericNode* new_input); | 41 inline void ReplaceInput(int index, GenericNode* new_input); |
| 42 inline void AppendInput(Zone* zone, GenericNode* new_input); | 42 inline void AppendInput(Zone* zone, GenericNode* new_input); |
| 43 inline void InsertInput(Zone* zone, int index, GenericNode* new_input); | 43 inline void InsertInput(Zone* zone, int index, GenericNode* new_input); |
| 44 inline void RemoveInput(int index); | |
|
Michael Starzinger
2014/09/24 08:59:12
There is a copy of this method in js-generic-lower
Benedikt Meurer
2014/09/24 09:24:48
Done.
| |
| 44 | 45 |
| 45 int UseCount() { return use_count_; } | 46 int UseCount() { return use_count_; } |
| 46 S* UseAt(int index) { | 47 S* UseAt(int index) { |
| 47 DCHECK(index < use_count_); | 48 DCHECK(index < use_count_); |
| 48 Use* current = first_use_; | 49 Use* current = first_use_; |
| 49 while (index-- != 0) { | 50 while (index-- != 0) { |
| 50 current = current->next; | 51 current = current->next; |
| 51 } | 52 } |
| 52 return static_cast<S*>(current->from); | 53 return static_cast<S*>(current->from); |
| 53 } | 54 } |
| 54 inline void ReplaceUses(GenericNode* replace_to); | 55 inline void ReplaceUses(GenericNode* replace_to); |
| 55 template <class UnaryPredicate> | 56 template <class UnaryPredicate> |
| 56 inline void ReplaceUsesIf(UnaryPredicate pred, GenericNode* replace_to); | 57 inline void ReplaceUsesIf(UnaryPredicate pred, GenericNode* replace_to); |
| 57 inline void RemoveAllInputs(); | 58 inline void RemoveAllInputs(); |
| 58 | 59 |
| 59 void TrimInputCount(int input_count); | 60 inline void TrimInputCount(int input_count); |
| 60 | 61 |
| 61 class Inputs { | 62 class Inputs { |
| 62 public: | 63 public: |
| 63 class iterator; | 64 class iterator; |
| 64 iterator begin(); | 65 iterator begin(); |
| 65 iterator end(); | 66 iterator end(); |
| 66 | 67 |
| 67 explicit Inputs(GenericNode* node) : node_(node) {} | 68 explicit Inputs(GenericNode* node) : node_(node) {} |
| 68 | 69 |
| 69 private: | 70 private: |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 } | 263 } |
| 263 | 264 |
| 264 typename GenericNode<B, S>::Use* current_; | 265 typename GenericNode<B, S>::Use* current_; |
| 265 int index_; | 266 int index_; |
| 266 }; | 267 }; |
| 267 } | 268 } |
| 268 } | 269 } |
| 269 } // namespace v8::internal::compiler | 270 } // namespace v8::internal::compiler |
| 270 | 271 |
| 271 #endif // V8_COMPILER_GENERIC_NODE_H_ | 272 #endif // V8_COMPILER_GENERIC_NODE_H_ |
| OLD | NEW |