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_ALGORITHM_INL_H_ | 5 #ifndef V8_COMPILER_GENERIC_ALGORITHM_INL_H_ |
6 #define V8_COMPILER_GENERIC_ALGORITHM_INL_H_ | 6 #define V8_COMPILER_GENERIC_ALGORITHM_INL_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "src/compiler/generic-algorithm.h" | 10 #include "src/compiler/generic-algorithm.h" |
11 #include "src/compiler/generic-graph.h" | 11 #include "src/compiler/generic-graph.h" |
12 #include "src/compiler/generic-node.h" | |
13 #include "src/compiler/generic-node-inl.h" | |
14 | 12 |
15 namespace v8 { | 13 namespace v8 { |
16 namespace internal { | 14 namespace internal { |
17 namespace compiler { | 15 namespace compiler { |
18 | 16 |
19 template <class N> | 17 template <class N> |
20 class NodeInputIterationTraits { | 18 class NodeInputIterationTraits { |
21 public: | 19 public: |
22 typedef N Node; | 20 typedef N Node; |
23 typedef typename N::Inputs::iterator Iterator; | 21 typedef typename N::Inputs::iterator Iterator; |
(...skipping 15 matching lines...) Expand all Loading... |
39 static Iterator end(Node* node) { return node->uses().end(); } | 37 static Iterator end(Node* node) { return node->uses().end(); } |
40 static int max_id(GenericGraphBase* graph) { return graph->NodeCount(); } | 38 static int max_id(GenericGraphBase* graph) { return graph->NodeCount(); } |
41 static Node* to(Iterator iterator) { return *iterator; } | 39 static Node* to(Iterator iterator) { return *iterator; } |
42 static Node* from(Iterator iterator) { return iterator.edge().to(); } | 40 static Node* from(Iterator iterator) { return iterator.edge().to(); } |
43 }; | 41 }; |
44 } | 42 } |
45 } | 43 } |
46 } // namespace v8::internal::compiler | 44 } // namespace v8::internal::compiler |
47 | 45 |
48 #endif // V8_COMPILER_GENERIC_ALGORITHM_INL_H_ | 46 #endif // V8_COMPILER_GENERIC_ALGORITHM_INL_H_ |
OLD | NEW |