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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
75 | 75 |
76 Zone* zone() const { return zone_; } | 76 Zone* zone() const { return zone_; } |
77 Node* start() const { return start_; } | 77 Node* start() const { return start_; } |
78 Node* end() const { return end_; } | 78 Node* end() const { return end_; } |
79 | 79 |
80 void SetStart(Node* start) { start_ = start; } | 80 void SetStart(Node* start) { start_ = start; } |
81 void SetEnd(Node* end) { end_ = end; } | 81 void SetEnd(Node* end) { end_ = end; } |
82 | 82 |
83 int NodeCount() const { return next_node_id_; } | 83 int NodeCount() const { return next_node_id_; } |
84 | 84 |
85 void Decorate(Node* node); | 85 void Decorate(Node* node, bool incomplete); |
titzer
2015/02/04 13:46:19
Is this incomplete flag necessary for source posit
danno
2015/02/04 14:04:59
Nope, this is intended. Note that previously Decor
| |
86 void AddDecorator(GraphDecorator* decorator); | 86 void AddDecorator(GraphDecorator* decorator); |
87 void RemoveDecorator(GraphDecorator* decorator); | 87 void RemoveDecorator(GraphDecorator* decorator); |
88 | 88 |
89 private: | 89 private: |
90 friend class NodeMarkerBase; | 90 friend class NodeMarkerBase; |
91 | 91 |
92 inline NodeId NextNodeId(); | 92 inline NodeId NextNodeId(); |
93 | 93 |
94 Zone* const zone_; | 94 Zone* const zone_; |
95 Node* start_; | 95 Node* start_; |
96 Node* end_; | 96 Node* end_; |
97 Mark mark_max_; | 97 Mark mark_max_; |
98 NodeId next_node_id_; | 98 NodeId next_node_id_; |
99 ZoneVector<GraphDecorator*> decorators_; | 99 ZoneVector<GraphDecorator*> decorators_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(Graph); | 101 DISALLOW_COPY_AND_ASSIGN(Graph); |
102 }; | 102 }; |
103 | 103 |
104 | 104 |
105 // A graph decorator can be used to add behavior to the creation of nodes | 105 // A graph decorator can be used to add behavior to the creation of nodes |
106 // in a graph. | 106 // in a graph. |
107 class GraphDecorator : public ZoneObject { | 107 class GraphDecorator : public ZoneObject { |
108 public: | 108 public: |
109 virtual ~GraphDecorator() {} | 109 virtual ~GraphDecorator() {} |
110 virtual void Decorate(Node* node) = 0; | 110 virtual void Decorate(Node* node, bool incomplete) = 0; |
111 }; | 111 }; |
112 | 112 |
113 } // namespace compiler | 113 } // namespace compiler |
114 } // namespace internal | 114 } // namespace internal |
115 } // namespace v8 | 115 } // namespace v8 |
116 | 116 |
117 #endif // V8_COMPILER_GRAPH_H_ | 117 #endif // V8_COMPILER_GRAPH_H_ |
OLD | NEW |