| 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/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
| 6 #include "src/compiler/common-operator-reducer.h" | 6 #include "src/compiler/common-operator-reducer.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
| 9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
| 10 #include "src/compiler/machine-type.h" | 10 #include "src/compiler/machine-type.h" |
| 11 #include "src/compiler/operator.h" | 11 #include "src/compiler/operator.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 | 14 |
| 15 namespace v8 { | 15 namespace v8 { |
| 16 namespace internal { | 16 namespace internal { |
| 17 namespace compiler { | 17 namespace compiler { |
| 18 | 18 |
| 19 class CommonOperatorReducerTest : public GraphTest { | 19 class CommonOperatorReducerTest : public GraphTest { |
| 20 public: | 20 public: |
| 21 explicit CommonOperatorReducerTest(int num_parameters = 1) | 21 explicit CommonOperatorReducerTest(int num_parameters = 1) |
| 22 : GraphTest(num_parameters), machine_(zone()) {} | 22 : GraphTest(num_parameters), machine_(zone()) {} |
| 23 ~CommonOperatorReducerTest() OVERRIDE {} | 23 ~CommonOperatorReducerTest() override {} |
| 24 | 24 |
| 25 protected: | 25 protected: |
| 26 Reduction Reduce(Node* node, MachineOperatorBuilder::Flags flags = | 26 Reduction Reduce(Node* node, MachineOperatorBuilder::Flags flags = |
| 27 MachineOperatorBuilder::kNoFlags) { | 27 MachineOperatorBuilder::kNoFlags) { |
| 28 JSOperatorBuilder javascript(zone()); | 28 JSOperatorBuilder javascript(zone()); |
| 29 MachineOperatorBuilder machine(zone(), kMachPtr, flags); | 29 MachineOperatorBuilder machine(zone(), kMachPtr, flags); |
| 30 JSGraph jsgraph(isolate(), graph(), common(), &javascript, &machine); | 30 JSGraph jsgraph(isolate(), graph(), common(), &javascript, &machine); |
| 31 CommonOperatorReducer reducer(&jsgraph); | 31 CommonOperatorReducer reducer(&jsgraph); |
| 32 return reducer.Reduce(node); | 32 return reducer.Reduce(node); |
| 33 } | 33 } |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 Node* select = | 312 Node* select = |
| 313 graph()->NewNode(common()->Select(kMachFloat64), check, p0, p1); | 313 graph()->NewNode(common()->Select(kMachFloat64), check, p0, p1); |
| 314 Reduction r = Reduce(select, MachineOperatorBuilder::kFloat64Min); | 314 Reduction r = Reduce(select, MachineOperatorBuilder::kFloat64Min); |
| 315 ASSERT_TRUE(r.Changed()); | 315 ASSERT_TRUE(r.Changed()); |
| 316 EXPECT_THAT(r.replacement(), IsFloat64Min(p0, p1)); | 316 EXPECT_THAT(r.replacement(), IsFloat64Min(p0, p1)); |
| 317 } | 317 } |
| 318 | 318 |
| 319 } // namespace compiler | 319 } // namespace compiler |
| 320 } // namespace internal | 320 } // namespace internal |
| 321 } // namespace v8 | 321 } // namespace v8 |
| OLD | NEW |