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 16 matching lines...) Expand all Loading... |
27 } | 27 } |
28 | 28 |
29 template <class B, class S> | 29 template <class B, class S> |
30 inline void GenericNode<B, S>::AssignUniqueID(GenericGraphBase* graph) { | 30 inline void GenericNode<B, S>::AssignUniqueID(GenericGraphBase* graph) { |
31 id_ = graph->NextNodeID(); | 31 id_ = graph->NextNodeID(); |
32 } | 32 } |
33 | 33 |
34 template <class B, class S> | 34 template <class B, class S> |
35 inline typename GenericNode<B, S>::Inputs::iterator | 35 inline typename GenericNode<B, S>::Inputs::iterator |
36 GenericNode<B, S>::Inputs::begin() { | 36 GenericNode<B, S>::Inputs::begin() { |
37 return GenericNode::Inputs::iterator(this->node_, 0); | 37 return GenericNode<B, S>::Inputs::iterator(this->node_, 0); |
38 } | 38 } |
39 | 39 |
40 template <class B, class S> | 40 template <class B, class S> |
41 inline typename GenericNode<B, S>::Inputs::iterator | 41 inline typename GenericNode<B, S>::Inputs::iterator |
42 GenericNode<B, S>::Inputs::end() { | 42 GenericNode<B, S>::Inputs::end() { |
43 return GenericNode::Inputs::iterator(this->node_, this->node_->InputCount()); | 43 return GenericNode<B, S>::Inputs::iterator(this->node_, |
| 44 this->node_->InputCount()); |
44 } | 45 } |
45 | 46 |
46 template <class B, class S> | 47 template <class B, class S> |
47 inline typename GenericNode<B, S>::Uses::iterator | 48 inline typename GenericNode<B, S>::Uses::iterator |
48 GenericNode<B, S>::Uses::begin() { | 49 GenericNode<B, S>::Uses::begin() { |
49 return GenericNode::Uses::iterator(this->node_); | 50 return GenericNode<B, S>::Uses::iterator(this->node_); |
50 } | 51 } |
51 | 52 |
52 template <class B, class S> | 53 template <class B, class S> |
53 inline typename GenericNode<B, S>::Uses::iterator | 54 inline typename GenericNode<B, S>::Uses::iterator |
54 GenericNode<B, S>::Uses::end() { | 55 GenericNode<B, S>::Uses::end() { |
55 return GenericNode::Uses::iterator(); | 56 return GenericNode<B, S>::Uses::iterator(); |
56 } | 57 } |
57 | 58 |
58 template <class B, class S> | 59 template <class B, class S> |
59 void GenericNode<B, S>::ReplaceUses(GenericNode* replace_to) { | 60 void GenericNode<B, S>::ReplaceUses(GenericNode* replace_to) { |
60 for (Use* use = first_use_; use != NULL; use = use->next) { | 61 for (Use* use = first_use_; use != NULL; use = use->next) { |
61 use->from->GetInputRecordPtr(use->input_index)->to = replace_to; | 62 use->from->GetInputRecordPtr(use->input_index)->to = replace_to; |
62 } | 63 } |
63 if (replace_to->last_use_ == NULL) { | 64 if (replace_to->last_use_ == NULL) { |
64 ASSERT_EQ(NULL, replace_to->first_use_); | 65 ASSERT_EQ(NULL, replace_to->first_use_); |
65 replace_to->first_use_ = first_use_; | 66 replace_to->first_use_ = first_use_; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 100 } |
100 | 101 |
101 template <class B, class S> | 102 template <class B, class S> |
102 void GenericNode<B, S>::TrimInputCount(int new_input_count) { | 103 void GenericNode<B, S>::TrimInputCount(int new_input_count) { |
103 if (new_input_count == input_count_) return; // Nothing to do. | 104 if (new_input_count == input_count_) return; // Nothing to do. |
104 | 105 |
105 ASSERT(new_input_count < input_count_); | 106 ASSERT(new_input_count < input_count_); |
106 | 107 |
107 // Update inline inputs. | 108 // Update inline inputs. |
108 for (int i = new_input_count; i < input_count_; i++) { | 109 for (int i = new_input_count; i < input_count_; i++) { |
109 GenericNode<B, S>::Input* input = GetInputRecordPtr(i); | 110 typename GenericNode<B, S>::Input* input = GetInputRecordPtr(i); |
110 input->Update(NULL); | 111 input->Update(NULL); |
111 } | 112 } |
112 input_count_ = new_input_count; | 113 input_count_ = new_input_count; |
113 } | 114 } |
114 | 115 |
115 template <class B, class S> | 116 template <class B, class S> |
116 void GenericNode<B, S>::ReplaceInput(int index, GenericNode<B, S>* new_to) { | 117 void GenericNode<B, S>::ReplaceInput(int index, GenericNode<B, S>* new_to) { |
117 Input* input = GetInputRecordPtr(index); | 118 Input* input = GetInputRecordPtr(index); |
118 input->Update(new_to); | 119 input->Update(new_to); |
119 } | 120 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 ++use; | 236 ++use; |
236 ++input; | 237 ++input; |
237 } | 238 } |
238 return result; | 239 return result; |
239 } | 240 } |
240 } | 241 } |
241 } | 242 } |
242 } // namespace v8::internal::compiler | 243 } // namespace v8::internal::compiler |
243 | 244 |
244 #endif // V8_COMPILER_GENERIC_NODE_INL_H_ | 245 #endif // V8_COMPILER_GENERIC_NODE_INL_H_ |
OLD | NEW |