5 #ifndef V8_COMPILER_GRAPH_H_ 6 #define V8_COMPILER_GRAPH_H_ 10 #include "src/base/compiler-specific.h" 11 #include "src/globals.h" 12 #include "src/zone/zone-containers.h" 13 #include "src/zone/zone.h" 35 class V8_EXPORT_PRIVATE
Graph final :
public NON_EXPORTED_BASE(ZoneObject) {
45 : graph_(graph), start_(graph->start()), end_(graph->end()) {}
47 graph_->SetStart(start_);
60 Node* NewNodeUnchecked(
const Operator* op,
int input_count,
61 Node*
const* inputs,
bool incomplete =
false);
65 bool incomplete =
false);
68 template <
typename... Nodes>
70 std::array<
Node*,
sizeof...(nodes)> nodes_arr{{nodes...}};
71 return NewNode(op, nodes_arr.size(), nodes_arr.data());
75 Node* CloneNode(
const Node* node);
77 Zone* zone()
const {
return zone_; }
78 Node* start()
const {
return start_; }
79 Node* end()
const {
return end_; }
81 void SetStart(Node* start) { start_ = start; }
82 void SetEnd(Node* end) { end_ = end; }
84 size_t NodeCount()
const {
return next_node_id_; }
86 void Decorate(Node* node);
87 void AddDecorator(GraphDecorator* decorator);
88 void RemoveDecorator(GraphDecorator* decorator);
94 friend class NodeMarkerBase;
96 inline NodeId NextNodeId();
102 NodeId next_node_id_;
103 ZoneVector<GraphDecorator*> decorators_;
105 DISALLOW_COPY_AND_ASSIGN(Graph);
114 virtual void Decorate(
Node* node) = 0;
121 #endif // V8_COMPILER_GRAPH_H_