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 #include "src/compiler/machine-operator-reducer.h" | 5 #include "src/compiler/machine-operator-reducer.h" |
6 #include "src/base/bits.h" | 6 #include "src/base/bits.h" |
7 #include "src/base/division-by-constant.h" | 7 #include "src/base/division-by-constant.h" |
8 #include "src/base/ieee754.h" | 8 #include "src/base/ieee754.h" |
9 #include "src/compiler/js-graph.h" | 9 #include "src/compiler/js-graph.h" |
10 #include "src/compiler/typer.h" | 10 #include "src/compiler/typer.h" |
11 #include "src/conversions-inl.h" | 11 #include "src/conversions-inl.h" |
12 #include "test/unittests/compiler/graph-unittest.h" | 12 #include "test/unittests/compiler/graph-unittest.h" |
13 #include "test/unittests/compiler/node-test-utils.h" | 13 #include "test/unittests/compiler/node-test-utils.h" |
14 #include "testing/gmock-support.h" | 14 #include "testing/gmock-support.h" |
15 | 15 |
16 using testing::AllOf; | 16 using testing::AllOf; |
17 using testing::BitEq; | 17 using testing::BitEq; |
18 using testing::Capture; | 18 using testing::Capture; |
19 using testing::CaptureEq; | 19 using testing::CaptureEq; |
20 using testing::NanSensitiveDoubleEq; | 20 using testing::NanSensitiveDoubleEq; |
21 | 21 |
22 namespace v8 { | 22 namespace v8 { |
23 namespace internal { | 23 namespace internal { |
24 namespace compiler { | 24 namespace compiler { |
25 | 25 |
26 class MachineOperatorReducerTest : public TypedGraphTest { | 26 class MachineOperatorReducerTest : public GraphTest { |
27 public: | 27 public: |
28 explicit MachineOperatorReducerTest(int num_parameters = 2) | 28 explicit MachineOperatorReducerTest(int num_parameters = 2) |
29 : TypedGraphTest(num_parameters), machine_(zone()) {} | 29 : GraphTest(num_parameters), machine_(zone()) {} |
30 | 30 |
31 protected: | 31 protected: |
32 Reduction Reduce(Node* node) { | 32 Reduction Reduce(Node* node) { |
33 JSOperatorBuilder javascript(zone()); | 33 JSOperatorBuilder javascript(zone()); |
34 JSGraph jsgraph(isolate(), graph(), common(), &javascript, nullptr, | 34 JSGraph jsgraph(isolate(), graph(), common(), &javascript, nullptr, |
35 &machine_); | 35 &machine_); |
36 MachineOperatorReducer reducer(&jsgraph); | 36 MachineOperatorReducer reducer(&jsgraph); |
37 return reducer.Reduce(node); | 37 return reducer.Reduce(node); |
38 } | 38 } |
39 | 39 |
(...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2069 Reduction r = Reduce(node); | 2069 Reduction r = Reduce(node); |
2070 ASSERT_TRUE(r.Changed()); | 2070 ASSERT_TRUE(r.Changed()); |
2071 EXPECT_THAT(r.replacement(), | 2071 EXPECT_THAT(r.replacement(), |
2072 IsStore(rep, base, index, value, effect, control)); | 2072 IsStore(rep, base, index, value, effect, control)); |
2073 } | 2073 } |
2074 } | 2074 } |
2075 | 2075 |
2076 } // namespace compiler | 2076 } // namespace compiler |
2077 } // namespace internal | 2077 } // namespace internal |
2078 } // namespace v8 | 2078 } // namespace v8 |
OLD | NEW |