Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: src/compiler/graph.h

Issue 505133003: Introduce subclass wrappers for STL containers that make them a lot easier (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/generic-node-inl.h ('k') | src/compiler/graph.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « src/compiler/generic-node-inl.h ('k') | src/compiler/graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698