| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_GRAPH_REDUCER_H_ | 5 #ifndef V8_COMPILER_GRAPH_REDUCER_H_ |
| 6 #define V8_COMPILER_GRAPH_REDUCER_H_ | 6 #define V8_COMPILER_GRAPH_REDUCER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include "src/zone-containers.h" |
| 9 | |
| 10 #include "src/zone-allocator.h" | |
| 11 | 9 |
| 12 namespace v8 { | 10 namespace v8 { |
| 13 namespace internal { | 11 namespace internal { |
| 14 namespace compiler { | 12 namespace compiler { |
| 15 | 13 |
| 16 // Forward declarations. | 14 // Forward declarations. |
| 17 class Graph; | 15 class Graph; |
| 18 class Node; | 16 class Node; |
| 19 | 17 |
| 20 | 18 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 Graph* graph() const { return graph_; } | 60 Graph* graph() const { return graph_; } |
| 63 | 61 |
| 64 void AddReducer(Reducer* reducer) { reducers_.push_back(reducer); } | 62 void AddReducer(Reducer* reducer) { reducers_.push_back(reducer); } |
| 65 | 63 |
| 66 // Reduce a single node. | 64 // Reduce a single node. |
| 67 void ReduceNode(Node* node); | 65 void ReduceNode(Node* node); |
| 68 // Reduce the whole graph. | 66 // Reduce the whole graph. |
| 69 void ReduceGraph(); | 67 void ReduceGraph(); |
| 70 | 68 |
| 71 private: | 69 private: |
| 72 typedef std::list<Reducer*, zone_allocator<Reducer*> > Reducers; | |
| 73 | |
| 74 Graph* graph_; | 70 Graph* graph_; |
| 75 Reducers reducers_; | 71 ZoneVector<Reducer*> reducers_; |
| 76 | 72 |
| 77 DISALLOW_COPY_AND_ASSIGN(GraphReducer); | 73 DISALLOW_COPY_AND_ASSIGN(GraphReducer); |
| 78 }; | 74 }; |
| 79 | 75 |
| 80 } // namespace compiler | 76 } // namespace compiler |
| 81 } // namespace internal | 77 } // namespace internal |
| 82 } // namespace v8 | 78 } // namespace v8 |
| 83 | 79 |
| 84 #endif // V8_COMPILER_GRAPH_REDUCER_H_ | 80 #endif // V8_COMPILER_GRAPH_REDUCER_H_ |
| OLD | NEW |