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_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_ | 5 #ifndef V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_ |
6 #define V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_ | 6 #define V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_ |
7 | 7 |
8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
10 #include "test/compiler-unittests/common-operator-unittest.h" | 10 #include "test/compiler-unittests/common-operator-unittest.h" |
11 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 | 15 |
16 // Forward declarations. | 16 // Forward declarations. |
17 class HeapObject; | 17 class HeapObject; |
18 template <class T> | 18 template <class T> |
19 class PrintableUnique; | 19 class PrintableUnique; |
20 | 20 |
21 namespace compiler { | 21 namespace compiler { |
22 | 22 |
| 23 using ::testing::Matcher; |
| 24 |
| 25 |
23 class GraphTest : public CommonOperatorTest { | 26 class GraphTest : public CommonOperatorTest { |
24 public: | 27 public: |
25 explicit GraphTest(int parameters = 1); | 28 explicit GraphTest(int parameters = 1); |
26 virtual ~GraphTest(); | 29 virtual ~GraphTest(); |
27 | 30 |
28 protected: | 31 protected: |
29 Graph* graph() { return &graph_; } | 32 Graph* graph() { return &graph_; } |
30 | 33 |
| 34 Matcher<Node*> IsAllocateHeapNumber(const Matcher<Node*>& effect_matcher, |
| 35 const Matcher<Node*>& control_matcher); |
| 36 |
31 private: | 37 private: |
32 Graph graph_; | 38 Graph graph_; |
33 }; | 39 }; |
34 | 40 |
35 | 41 |
36 using ::testing::Matcher; | |
37 | |
38 Matcher<Node*> IsBranch(const Matcher<Node*>& value_matcher, | 42 Matcher<Node*> IsBranch(const Matcher<Node*>& value_matcher, |
39 const Matcher<Node*>& control_matcher); | 43 const Matcher<Node*>& control_matcher); |
40 Matcher<Node*> IsMerge(const Matcher<Node*>& control0_matcher, | 44 Matcher<Node*> IsMerge(const Matcher<Node*>& control0_matcher, |
41 const Matcher<Node*>& control1_matcher); | 45 const Matcher<Node*>& control1_matcher); |
42 Matcher<Node*> IsIfTrue(const Matcher<Node*>& control_matcher); | 46 Matcher<Node*> IsIfTrue(const Matcher<Node*>& control_matcher); |
43 Matcher<Node*> IsIfFalse(const Matcher<Node*>& control_matcher); | 47 Matcher<Node*> IsIfFalse(const Matcher<Node*>& control_matcher); |
44 Matcher<Node*> IsControlEffect(const Matcher<Node*>& control_matcher); | 48 Matcher<Node*> IsControlEffect(const Matcher<Node*>& control_matcher); |
| 49 Matcher<Node*> IsValueEffect(const Matcher<Node*>& value_matcher); |
45 Matcher<Node*> IsFinish(const Matcher<Node*>& value_matcher, | 50 Matcher<Node*> IsFinish(const Matcher<Node*>& value_matcher, |
46 const Matcher<Node*>& effect_matcher); | 51 const Matcher<Node*>& effect_matcher); |
47 Matcher<Node*> IsExternalConstant( | 52 Matcher<Node*> IsExternalConstant( |
48 const Matcher<ExternalReference>& value_matcher); | 53 const Matcher<ExternalReference>& value_matcher); |
49 Matcher<Node*> IsHeapConstant( | 54 Matcher<Node*> IsHeapConstant( |
50 const Matcher<PrintableUnique<HeapObject> >& value_matcher); | 55 const Matcher<PrintableUnique<HeapObject> >& value_matcher); |
51 Matcher<Node*> IsInt32Constant(const Matcher<int32_t>& value_matcher); | 56 Matcher<Node*> IsInt32Constant(const Matcher<int32_t>& value_matcher); |
52 Matcher<Node*> IsNumberConstant(const Matcher<double>& value_matcher); | 57 Matcher<Node*> IsNumberConstant(const Matcher<double>& value_matcher); |
53 Matcher<Node*> IsPhi(const Matcher<Node*>& value0_matcher, | 58 Matcher<Node*> IsPhi(const Matcher<Node*>& value0_matcher, |
54 const Matcher<Node*>& value1_matcher, | 59 const Matcher<Node*>& value1_matcher, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 const Matcher<Node*>& rhs_matcher); | 91 const Matcher<Node*>& rhs_matcher); |
87 Matcher<Node*> IsWord64Shl(const Matcher<Node*>& lhs_matcher, | 92 Matcher<Node*> IsWord64Shl(const Matcher<Node*>& lhs_matcher, |
88 const Matcher<Node*>& rhs_matcher); | 93 const Matcher<Node*>& rhs_matcher); |
89 Matcher<Node*> IsWord64Sar(const Matcher<Node*>& lhs_matcher, | 94 Matcher<Node*> IsWord64Sar(const Matcher<Node*>& lhs_matcher, |
90 const Matcher<Node*>& rhs_matcher); | 95 const Matcher<Node*>& rhs_matcher); |
91 Matcher<Node*> IsWord64Equal(const Matcher<Node*>& lhs_matcher, | 96 Matcher<Node*> IsWord64Equal(const Matcher<Node*>& lhs_matcher, |
92 const Matcher<Node*>& rhs_matcher); | 97 const Matcher<Node*>& rhs_matcher); |
93 Matcher<Node*> IsInt32AddWithOverflow(const Matcher<Node*>& lhs_matcher, | 98 Matcher<Node*> IsInt32AddWithOverflow(const Matcher<Node*>& lhs_matcher, |
94 const Matcher<Node*>& rhs_matcher); | 99 const Matcher<Node*>& rhs_matcher); |
95 Matcher<Node*> IsConvertInt64ToInt32(const Matcher<Node*>& input_matcher); | 100 Matcher<Node*> IsConvertInt64ToInt32(const Matcher<Node*>& input_matcher); |
| 101 Matcher<Node*> IsChangeFloat64ToInt32(const Matcher<Node*>& input_matcher); |
96 Matcher<Node*> IsChangeInt32ToFloat64(const Matcher<Node*>& input_matcher); | 102 Matcher<Node*> IsChangeInt32ToFloat64(const Matcher<Node*>& input_matcher); |
97 | 103 |
98 } // namespace compiler | 104 } // namespace compiler |
99 } // namespace internal | 105 } // namespace internal |
100 } // namespace v8 | 106 } // namespace v8 |
101 | 107 |
102 #endif // V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_ | 108 #endif // V8_COMPILER_UNITTESTS_GRAPH_UNITTEST_H_ |
OLD | NEW |