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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 DecoratorVector::iterator it = |
76 std::find(decorators_.begin(), decorators_.end(), decorator); | 76 std::find(decorators_.begin(), decorators_.end(), decorator); |
77 ASSERT(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 typedef std::vector<GraphDecorator*, zone_allocator<GraphDecorator*> > |
83 DecoratorVector; | 83 DecoratorVector; |
84 DecoratorVector decorators_; | 84 DecoratorVector decorators_; |
85 }; | 85 }; |
86 | 86 |
87 | 87 |
88 class GraphDecorator : public ZoneObject { | 88 class GraphDecorator : public ZoneObject { |
89 public: | 89 public: |
90 virtual ~GraphDecorator() {} | 90 virtual ~GraphDecorator() {} |
91 virtual void Decorate(Node* node) = 0; | 91 virtual void Decorate(Node* node) = 0; |
92 }; | 92 }; |
93 } | 93 } |
94 } | 94 } |
95 } // namespace v8::internal::compiler | 95 } // namespace v8::internal::compiler |
96 | 96 |
97 #endif // V8_COMPILER_GRAPH_H_ | 97 #endif // V8_COMPILER_GRAPH_H_ |
OLD | NEW |