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_NODE_H_ | 5 #ifndef V8_COMPILER_NODE_H_ |
6 #define V8_COMPILER_NODE_H_ | 6 #define V8_COMPILER_NODE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // during compilation, e.g. during lowering passes. Other information that | 47 // during compilation, e.g. during lowering passes. Other information that |
48 // needs to be associated with Nodes during compilation must be stored | 48 // needs to be associated with Nodes during compilation must be stored |
49 // out-of-line indexed by the Node's id. | 49 // out-of-line indexed by the Node's id. |
50 class Node : public GenericNode<NodeData, Node> { | 50 class Node : public GenericNode<NodeData, Node> { |
51 public: | 51 public: |
52 Node(GenericGraphBase* graph, int input_count) | 52 Node(GenericGraphBase* graph, int input_count) |
53 : GenericNode<NodeData, Node>(graph, input_count) {} | 53 : GenericNode<NodeData, Node>(graph, input_count) {} |
54 | 54 |
55 void Initialize(Operator* op) { set_op(op); } | 55 void Initialize(Operator* op) { set_op(op); } |
56 | 56 |
57 void CollectProjections(int projection_count, Node** projections); | 57 void CollectProjections(std::vector<Node*>* projections); |
58 Node* FindProjection(int32_t projection_index); | 58 Node* FindProjection(int32_t projection_index); |
59 }; | 59 }; |
60 | 60 |
61 OStream& operator<<(OStream& os, const Node& n); | 61 OStream& operator<<(OStream& os, const Node& n); |
62 | 62 |
63 typedef GenericGraphVisit::NullNodeVisitor<NodeData, Node> NullNodeVisitor; | 63 typedef GenericGraphVisit::NullNodeVisitor<NodeData, Node> NullNodeVisitor; |
64 | 64 |
65 typedef zone_allocator<Node*> NodePtrZoneAllocator; | 65 typedef zone_allocator<Node*> NodePtrZoneAllocator; |
66 | 66 |
67 typedef std::set<Node*, std::less<Node*>, NodePtrZoneAllocator> NodeSet; | 67 typedef std::set<Node*, std::less<Node*>, NodePtrZoneAllocator> NodeSet; |
(...skipping 18 matching lines...) Expand all Loading... |
86 // Helper to extract parameters from Operator1<*> nodes. | 86 // Helper to extract parameters from Operator1<*> nodes. |
87 template <typename T> | 87 template <typename T> |
88 static inline T OpParameter(Node* node) { | 88 static inline T OpParameter(Node* node) { |
89 return reinterpret_cast<Operator1<T>*>(node->op())->parameter(); | 89 return reinterpret_cast<Operator1<T>*>(node->op())->parameter(); |
90 } | 90 } |
91 } | 91 } |
92 } | 92 } |
93 } // namespace v8::internal::compiler | 93 } // namespace v8::internal::compiler |
94 | 94 |
95 #endif // V8_COMPILER_NODE_H_ | 95 #endif // V8_COMPILER_NODE_H_ |
OLD | NEW |