| 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/base/compiler-specific.h" | 8 #include "src/base/compiler-specific.h" |
| 9 #include "src/globals.h" | 9 #include "src/globals.h" |
| 10 #include "src/zone/zone-containers.h" | 10 #include "src/zone/zone-containers.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 void SetStart(Node* start) { start_ = start; } | 115 void SetStart(Node* start) { start_ = start; } |
| 116 void SetEnd(Node* end) { end_ = end; } | 116 void SetEnd(Node* end) { end_ = end; } |
| 117 | 117 |
| 118 size_t NodeCount() const { return next_node_id_; } | 118 size_t NodeCount() const { return next_node_id_; } |
| 119 | 119 |
| 120 void Decorate(Node* node); | 120 void Decorate(Node* node); |
| 121 void AddDecorator(GraphDecorator* decorator); | 121 void AddDecorator(GraphDecorator* decorator); |
| 122 void RemoveDecorator(GraphDecorator* decorator); | 122 void RemoveDecorator(GraphDecorator* decorator); |
| 123 | 123 |
| 124 // Very simple print API usable in a debugger. |
| 125 void Print() const; |
| 126 |
| 124 private: | 127 private: |
| 125 friend class NodeMarkerBase; | 128 friend class NodeMarkerBase; |
| 126 | 129 |
| 127 inline NodeId NextNodeId(); | 130 inline NodeId NextNodeId(); |
| 128 | 131 |
| 129 Zone* const zone_; | 132 Zone* const zone_; |
| 130 Node* start_; | 133 Node* start_; |
| 131 Node* end_; | 134 Node* end_; |
| 132 Mark mark_max_; | 135 Mark mark_max_; |
| 133 NodeId next_node_id_; | 136 NodeId next_node_id_; |
| 134 ZoneVector<GraphDecorator*> decorators_; | 137 ZoneVector<GraphDecorator*> decorators_; |
| 135 | 138 |
| 136 DISALLOW_COPY_AND_ASSIGN(Graph); | 139 DISALLOW_COPY_AND_ASSIGN(Graph); |
| 137 }; | 140 }; |
| 138 | 141 |
| 139 | 142 |
| 140 // A graph decorator can be used to add behavior to the creation of nodes | 143 // A graph decorator can be used to add behavior to the creation of nodes |
| 141 // in a graph. | 144 // in a graph. |
| 142 class GraphDecorator : public ZoneObject { | 145 class GraphDecorator : public ZoneObject { |
| 143 public: | 146 public: |
| 144 virtual ~GraphDecorator() {} | 147 virtual ~GraphDecorator() {} |
| 145 virtual void Decorate(Node* node) = 0; | 148 virtual void Decorate(Node* node) = 0; |
| 146 }; | 149 }; |
| 147 | 150 |
| 148 } // namespace compiler | 151 } // namespace compiler |
| 149 } // namespace internal | 152 } // namespace internal |
| 150 } // namespace v8 | 153 } // namespace v8 |
| 151 | 154 |
| 152 #endif // V8_COMPILER_GRAPH_H_ | 155 #endif // V8_COMPILER_GRAPH_H_ |
| OLD | NEW |