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_GRAPH_H_ | 5 #ifndef V8_COMPILER_GRAPH_H_ |
6 #define V8_COMPILER_GRAPH_H_ | 6 #define V8_COMPILER_GRAPH_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void VisitNodeUsesFromStart(Visitor* visitor); | 65 void VisitNodeUsesFromStart(Visitor* visitor); |
66 | 66 |
67 template <class Visitor> | 67 template <class Visitor> |
68 void VisitNodeInputsFromEnd(Visitor* visitor); | 68 void VisitNodeInputsFromEnd(Visitor* visitor); |
69 | 69 |
70 void AddDecorator(GraphDecorator* decorator) { | 70 void AddDecorator(GraphDecorator* decorator) { |
71 decorators_.push_back(decorator); | 71 decorators_.push_back(decorator); |
72 } | 72 } |
73 | 73 |
74 void RemoveDecorator(GraphDecorator* decorator) { | 74 void RemoveDecorator(GraphDecorator* decorator) { |
75 DecoratorVector::iterator it = | 75 ZoneVector<GraphDecorator*>::iterator it = |
76 std::find(decorators_.begin(), decorators_.end(), decorator); | 76 std::find(decorators_.begin(), decorators_.end(), decorator); |
77 DCHECK(it != decorators_.end()); | 77 DCHECK(it != decorators_.end()); |
78 decorators_.erase(it, it + 1); | 78 decorators_.erase(it, it + 1); |
79 } | 79 } |
80 | 80 |
81 private: | 81 private: |
82 typedef std::vector<GraphDecorator*, zone_allocator<GraphDecorator*> > | 82 ZoneVector<GraphDecorator*> decorators_; |
83 DecoratorVector; | |
84 DecoratorVector decorators_; | |
85 }; | 83 }; |
86 | 84 |
87 | 85 |
88 class GraphDecorator : public ZoneObject { | 86 class GraphDecorator : public ZoneObject { |
89 public: | 87 public: |
90 virtual ~GraphDecorator() {} | 88 virtual ~GraphDecorator() {} |
91 virtual void Decorate(Node* node) = 0; | 89 virtual void Decorate(Node* node) = 0; |
92 }; | 90 }; |
93 } | 91 } |
94 } | 92 } |
95 } // namespace v8::internal::compiler | 93 } // namespace v8::internal::compiler |
96 | 94 |
97 #endif // V8_COMPILER_GRAPH_H_ | 95 #endif // V8_COMPILER_GRAPH_H_ |
OLD | NEW |