OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_ | 5 #ifndef V8_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_ |
6 #define V8_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_ | 6 #define V8_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_ |
7 | 7 |
8 #include "src/compiler/common-operator.h" | 8 #include "src/compiler/common-operator.h" |
9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
| 11 #include "src/compiler/typer.h" |
11 #include "test/unittests/test-utils.h" | 12 #include "test/unittests/test-utils.h" |
12 #include "testing/gmock/include/gmock/gmock.h" | 13 #include "testing/gmock/include/gmock/gmock.h" |
13 | 14 |
14 namespace v8 { | 15 namespace v8 { |
15 namespace internal { | 16 namespace internal { |
16 | 17 |
17 // Forward declarations. | 18 // Forward declarations. |
18 template <class T> | 19 template <class T> |
19 class Handle; | 20 class Handle; |
20 class HeapObject; | 21 class HeapObject; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 58 |
58 CommonOperatorBuilder* common() { return &common_; } | 59 CommonOperatorBuilder* common() { return &common_; } |
59 Graph* graph() { return &graph_; } | 60 Graph* graph() { return &graph_; } |
60 | 61 |
61 private: | 62 private: |
62 CommonOperatorBuilder common_; | 63 CommonOperatorBuilder common_; |
63 Graph graph_; | 64 Graph graph_; |
64 }; | 65 }; |
65 | 66 |
66 | 67 |
| 68 class TypedGraphTest : public GraphTest { |
| 69 public: |
| 70 explicit TypedGraphTest(int parameters = 1) |
| 71 : GraphTest(parameters), |
| 72 typer_(graph(), MaybeHandle<Context>()) {} |
| 73 |
| 74 protected: |
| 75 Typer* typer() { return &typer_; } |
| 76 |
| 77 private: |
| 78 Typer typer_; |
| 79 }; |
| 80 |
| 81 |
67 Matcher<Node*> IsBranch(const Matcher<Node*>& value_matcher, | 82 Matcher<Node*> IsBranch(const Matcher<Node*>& value_matcher, |
68 const Matcher<Node*>& control_matcher); | 83 const Matcher<Node*>& control_matcher); |
69 Matcher<Node*> IsMerge(const Matcher<Node*>& control0_matcher, | 84 Matcher<Node*> IsMerge(const Matcher<Node*>& control0_matcher, |
70 const Matcher<Node*>& control1_matcher); | 85 const Matcher<Node*>& control1_matcher); |
71 Matcher<Node*> IsIfTrue(const Matcher<Node*>& control_matcher); | 86 Matcher<Node*> IsIfTrue(const Matcher<Node*>& control_matcher); |
72 Matcher<Node*> IsIfFalse(const Matcher<Node*>& control_matcher); | 87 Matcher<Node*> IsIfFalse(const Matcher<Node*>& control_matcher); |
73 Matcher<Node*> IsValueEffect(const Matcher<Node*>& value_matcher); | 88 Matcher<Node*> IsValueEffect(const Matcher<Node*>& value_matcher); |
74 Matcher<Node*> IsFinish(const Matcher<Node*>& value_matcher, | 89 Matcher<Node*> IsFinish(const Matcher<Node*>& value_matcher, |
75 const Matcher<Node*>& effect_matcher); | 90 const Matcher<Node*>& effect_matcher); |
76 Matcher<Node*> IsExternalConstant( | 91 Matcher<Node*> IsExternalConstant( |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 Matcher<Node*> IsTruncateFloat64ToFloat32(const Matcher<Node*>& input_matcher); | 188 Matcher<Node*> IsTruncateFloat64ToFloat32(const Matcher<Node*>& input_matcher); |
174 Matcher<Node*> IsTruncateFloat64ToInt32(const Matcher<Node*>& input_matcher); | 189 Matcher<Node*> IsTruncateFloat64ToInt32(const Matcher<Node*>& input_matcher); |
175 Matcher<Node*> IsTruncateInt64ToInt32(const Matcher<Node*>& input_matcher); | 190 Matcher<Node*> IsTruncateInt64ToInt32(const Matcher<Node*>& input_matcher); |
176 Matcher<Node*> IsFloat64Sqrt(const Matcher<Node*>& input_matcher); | 191 Matcher<Node*> IsFloat64Sqrt(const Matcher<Node*>& input_matcher); |
177 | 192 |
178 } // namespace compiler | 193 } // namespace compiler |
179 } // namespace internal | 194 } // namespace internal |
180 } // namespace v8 | 195 } // namespace v8 |
181 | 196 |
182 #endif // V8_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_ | 197 #endif // V8_UNITTESTS_COMPILER_GRAPH_UNITTEST_H_ |
OLD | NEW |