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_BUILDER_H_ | 5 #ifndef V8_COMPILER_GRAPH_BUILDER_H_ |
6 #define V8_COMPILER_GRAPH_BUILDER_H_ | 6 #define V8_COMPILER_GRAPH_BUILDER_H_ |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 virtual ~GraphBuilder() {} | 25 virtual ~GraphBuilder() {} |
26 | 26 |
27 Node* NewNode(Operator* op) { | 27 Node* NewNode(Operator* op) { |
28 return MakeNode(op, 0, static_cast<Node**>(NULL)); | 28 return MakeNode(op, 0, static_cast<Node**>(NULL)); |
29 } | 29 } |
30 | 30 |
31 Node* NewNode(Operator* op, Node* n1) { return MakeNode(op, 1, &n1); } | 31 Node* NewNode(Operator* op, Node* n1) { return MakeNode(op, 1, &n1); } |
32 | 32 |
33 Node* NewNode(Operator* op, Node* n1, Node* n2) { | 33 Node* NewNode(Operator* op, Node* n1, Node* n2) { |
34 Node* buffer[] = {n1, n2}; | 34 Node* buffer[] = {n1, n2}; |
35 return MakeNode(op, ARRAY_SIZE(buffer), buffer); | 35 return MakeNode(op, arraysize(buffer), buffer); |
36 } | 36 } |
37 | 37 |
38 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3) { | 38 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3) { |
39 Node* buffer[] = {n1, n2, n3}; | 39 Node* buffer[] = {n1, n2, n3}; |
40 return MakeNode(op, ARRAY_SIZE(buffer), buffer); | 40 return MakeNode(op, arraysize(buffer), buffer); |
41 } | 41 } |
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* buffer[] = {n1, n2, n3, n4}; | 44 Node* buffer[] = {n1, n2, n3, n4}; |
45 return MakeNode(op, ARRAY_SIZE(buffer), buffer); | 45 return MakeNode(op, arraysize(buffer), buffer); |
46 } | 46 } |
47 | 47 |
48 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, | 48 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, |
49 Node* n5) { | 49 Node* n5) { |
50 Node* buffer[] = {n1, n2, n3, n4, n5}; | 50 Node* buffer[] = {n1, n2, n3, n4, n5}; |
51 return MakeNode(op, ARRAY_SIZE(buffer), buffer); | 51 return MakeNode(op, arraysize(buffer), buffer); |
52 } | 52 } |
53 | 53 |
54 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, Node* n5, | 54 Node* NewNode(Operator* op, Node* n1, Node* n2, Node* n3, Node* n4, Node* n5, |
55 Node* n6) { | 55 Node* n6) { |
56 Node* nodes[] = {n1, n2, n3, n4, n5, n6}; | 56 Node* nodes[] = {n1, n2, n3, n4, n5, n6}; |
57 return MakeNode(op, ARRAY_SIZE(nodes), nodes); | 57 return MakeNode(op, arraysize(nodes), nodes); |
58 } | 58 } |
59 | 59 |
60 Node* NewNode(Operator* op, int value_input_count, Node** value_inputs) { | 60 Node* NewNode(Operator* op, int value_input_count, Node** value_inputs) { |
61 return MakeNode(op, value_input_count, value_inputs); | 61 return MakeNode(op, value_input_count, value_inputs); |
62 } | 62 } |
63 | 63 |
64 Graph* graph() const { return graph_; } | 64 Graph* graph() const { return graph_; } |
65 | 65 |
66 protected: | 66 protected: |
67 // Base implementation used by all factory methods. | 67 // Base implementation used by all factory methods. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 StructuredGraphBuilder* builder_; | 217 StructuredGraphBuilder* builder_; |
218 Node* control_dependency_; | 218 Node* control_dependency_; |
219 Node* effect_dependency_; | 219 Node* effect_dependency_; |
220 NodeVector values_; | 220 NodeVector values_; |
221 }; | 221 }; |
222 } | 222 } |
223 } | 223 } |
224 } // namespace v8::internal::compiler | 224 } // namespace v8::internal::compiler |
225 | 225 |
226 #endif // V8_COMPILER_GRAPH_BUILDER_H__ | 226 #endif // V8_COMPILER_GRAPH_BUILDER_H__ |
OLD | NEW |