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 "src/zone.h" | 8 #include "src/zone.h" |
9 #include "src/zone-containers.h" | 9 #include "src/zone-containers.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 Zone* zone() const { return zone_; } | 86 Zone* zone() const { return zone_; } |
87 Node* start() const { return start_; } | 87 Node* start() const { return start_; } |
88 Node* end() const { return end_; } | 88 Node* end() const { return end_; } |
89 | 89 |
90 void SetStart(Node* start) { start_ = start; } | 90 void SetStart(Node* start) { start_ = start; } |
91 void SetEnd(Node* end) { end_ = end; } | 91 void SetEnd(Node* end) { end_ = end; } |
92 | 92 |
93 size_t NodeCount() const { return next_node_id_; } | 93 size_t NodeCount() const { return next_node_id_; } |
94 | 94 |
95 void Decorate(Node* node, bool incomplete); | 95 void Decorate(Node* node); |
96 void AddDecorator(GraphDecorator* decorator); | 96 void AddDecorator(GraphDecorator* decorator); |
97 void RemoveDecorator(GraphDecorator* decorator); | 97 void RemoveDecorator(GraphDecorator* decorator); |
98 | 98 |
99 private: | 99 private: |
100 friend class NodeMarkerBase; | 100 friend class NodeMarkerBase; |
101 | 101 |
102 inline NodeId NextNodeId(); | 102 inline NodeId NextNodeId(); |
103 | 103 |
104 Zone* const zone_; | 104 Zone* const zone_; |
105 Node* start_; | 105 Node* start_; |
106 Node* end_; | 106 Node* end_; |
107 Mark mark_max_; | 107 Mark mark_max_; |
108 NodeId next_node_id_; | 108 NodeId next_node_id_; |
109 ZoneVector<GraphDecorator*> decorators_; | 109 ZoneVector<GraphDecorator*> decorators_; |
110 | 110 |
111 DISALLOW_COPY_AND_ASSIGN(Graph); | 111 DISALLOW_COPY_AND_ASSIGN(Graph); |
112 }; | 112 }; |
113 | 113 |
114 | 114 |
115 // A graph decorator can be used to add behavior to the creation of nodes | 115 // A graph decorator can be used to add behavior to the creation of nodes |
116 // in a graph. | 116 // in a graph. |
117 class GraphDecorator : public ZoneObject { | 117 class GraphDecorator : public ZoneObject { |
118 public: | 118 public: |
119 virtual ~GraphDecorator() {} | 119 virtual ~GraphDecorator() {} |
120 virtual void Decorate(Node* node, bool incomplete) = 0; | 120 virtual void Decorate(Node* node) = 0; |
121 }; | 121 }; |
122 | 122 |
123 } // namespace compiler | 123 } // namespace compiler |
124 } // namespace internal | 124 } // namespace internal |
125 } // namespace v8 | 125 } // namespace v8 |
126 | 126 |
127 #endif // V8_COMPILER_GRAPH_H_ | 127 #endif // V8_COMPILER_GRAPH_H_ |
OLD | NEW |