| 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 <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // Base implementation used by all factory methods. | 27 // Base implementation used by all factory methods. |
| 28 Node* NewNode(Operator* op, int input_count, Node** inputs); | 28 Node* NewNode(Operator* op, int input_count, Node** inputs); |
| 29 | 29 |
| 30 // Factories for nodes with static input counts. | 30 // Factories for nodes with static input counts. |
| 31 Node* NewNode(Operator* op) { | 31 Node* NewNode(Operator* op) { |
| 32 return NewNode(op, 0, static_cast<Node**>(NULL)); | 32 return NewNode(op, 0, static_cast<Node**>(NULL)); |
| 33 } | 33 } |
| 34 Node* NewNode(Operator* op, Node* n1) { return NewNode(op, 1, &n1); } | 34 Node* NewNode(Operator* op, Node* n1) { return NewNode(op, 1, &n1); } |
| 35 Node* NewNode(Operator* op, Node* n1, Node* n2) { | 35 Node* NewNode(Operator* op, Node* n1, Node* n2) { |
| 36 Node* nodes[] = {n1, n2}; | 36 Node* nodes[] = {n1, n2}; |
| 37 return NewNode(op, ARRAY_SIZE(nodes), nodes); | 37 return NewNode(op, arraysize(nodes), nodes); |
| 38 } | 38 } |
| 39 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3) { | 39 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3) { |
| 40 Node* nodes[] = {n1, n2, n3}; | 40 Node* nodes[] = {n1, n2, n3}; |
| 41 return NewNode(op, ARRAY_SIZE(nodes), nodes); | 41 return NewNode(op, arraysize(nodes), nodes); |
| 42 } | 42 } |
| 43 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) { | 43 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4) { |
| 44 Node* nodes[] = {n1, n2, n3, n4}; | 44 Node* nodes[] = {n1, n2, n3, n4}; |
| 45 return NewNode(op, ARRAY_SIZE(nodes), nodes); | 45 return NewNode(op, arraysize(nodes), nodes); |
| 46 } | 46 } |
| 47 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, | 47 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, |
| 48 Node* n5) { | 48 Node* n5) { |
| 49 Node* nodes[] = {n1, n2, n3, n4, n5}; | 49 Node* nodes[] = {n1, n2, n3, n4, n5}; |
| 50 return NewNode(op, ARRAY_SIZE(nodes), nodes); | 50 return NewNode(op, arraysize(nodes), nodes); |
| 51 } | 51 } |
| 52 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, Node* n5, | 52 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, Node* n5, |
| 53 Node* n6) { | 53 Node* n6) { |
| 54 Node* nodes[] = {n1, n2, n3, n4, n5, n6}; | 54 Node* nodes[] = {n1, n2, n3, n4, n5, n6}; |
| 55 return NewNode(op, ARRAY_SIZE(nodes), nodes); | 55 return NewNode(op, arraysize(nodes), nodes); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void ChangeOperator(Node* node, Operator* op); | 58 void ChangeOperator(Node* node, Operator* op); |
| 59 void DeleteNode(Node* node); | 59 void DeleteNode(Node* node); |
| 60 | 60 |
| 61 template <class Visitor> | 61 template <class Visitor> |
| 62 void VisitNodeUsesFrom(Node* node, Visitor* visitor); | 62 void VisitNodeUsesFrom(Node* node, Visitor* visitor); |
| 63 | 63 |
| 64 template <class Visitor> | 64 template <class Visitor> |
| 65 void VisitNodeUsesFromStart(Visitor* visitor); | 65 void VisitNodeUsesFromStart(Visitor* visitor); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 88 class GraphDecorator : public ZoneObject { | 88 class GraphDecorator : public ZoneObject { |
| 89 public: | 89 public: |
| 90 virtual ~GraphDecorator() {} | 90 virtual ~GraphDecorator() {} |
| 91 virtual void Decorate(Node* node) = 0; | 91 virtual void Decorate(Node* node) = 0; |
| 92 }; | 92 }; |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 } // namespace v8::internal::compiler | 95 } // namespace v8::internal::compiler |
| 96 | 96 |
| 97 #endif // V8_COMPILER_GRAPH_H_ | 97 #endif // V8_COMPILER_GRAPH_H_ |
| OLD | NEW |