| 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/base/bits.h" | 5 #include "src/base/bits.h" |
| 6 #include "src/base/division-by-constant.h" | 6 #include "src/base/division-by-constant.h" |
| 7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
| 8 #include "src/compiler/machine-operator-reducer.h" | 8 #include "src/compiler/machine-operator-reducer.h" |
| 9 #include "src/compiler/typer.h" | 9 #include "src/compiler/typer.h" |
| 10 #include "src/conversions-inl.h" | 10 #include "src/conversions-inl.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace compiler { | 22 namespace compiler { |
| 23 | 23 |
| 24 class MachineOperatorReducerTest : public TypedGraphTest { | 24 class MachineOperatorReducerTest : public TypedGraphTest { |
| 25 public: | 25 public: |
| 26 explicit MachineOperatorReducerTest(int num_parameters = 2) | 26 explicit MachineOperatorReducerTest(int num_parameters = 2) |
| 27 : TypedGraphTest(num_parameters), machine_(zone()) {} | 27 : TypedGraphTest(num_parameters), machine_(zone()) {} |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 Reduction Reduce(Node* node) { | 30 Reduction Reduce(Node* node) { |
| 31 JSOperatorBuilder javascript(zone()); | 31 JSOperatorBuilder javascript(zone()); |
| 32 JSGraph jsgraph(isolate(), graph(), common(), &javascript, &machine_); | 32 JSGraph jsgraph(isolate(), graph(), common(), &javascript, nullptr, |
| 33 &machine_); |
| 33 MachineOperatorReducer reducer(&jsgraph); | 34 MachineOperatorReducer reducer(&jsgraph); |
| 34 return reducer.Reduce(node); | 35 return reducer.Reduce(node); |
| 35 } | 36 } |
| 36 | 37 |
| 37 Matcher<Node*> IsTruncatingDiv(const Matcher<Node*>& dividend_matcher, | 38 Matcher<Node*> IsTruncatingDiv(const Matcher<Node*>& dividend_matcher, |
| 38 const int32_t divisor) { | 39 const int32_t divisor) { |
| 39 base::MagicNumbersForDivision<uint32_t> const mag = | 40 base::MagicNumbersForDivision<uint32_t> const mag = |
| 40 base::SignedDivisionByConstant(bit_cast<uint32_t>(divisor)); | 41 base::SignedDivisionByConstant(bit_cast<uint32_t>(divisor)); |
| 41 int32_t const multiplier = bit_cast<int32_t>(mag.multiplier); | 42 int32_t const multiplier = bit_cast<int32_t>(mag.multiplier); |
| 42 int32_t const shift = bit_cast<int32_t>(mag.shift); | 43 int32_t const shift = bit_cast<int32_t>(mag.shift); |
| (...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 Reduction r = Reduce(node); | 1642 Reduction r = Reduce(node); |
| 1642 ASSERT_TRUE(r.Changed()); | 1643 ASSERT_TRUE(r.Changed()); |
| 1643 EXPECT_THAT(r.replacement(), | 1644 EXPECT_THAT(r.replacement(), |
| 1644 IsStore(rep, base, index, value, effect, control)); | 1645 IsStore(rep, base, index, value, effect, control)); |
| 1645 } | 1646 } |
| 1646 } | 1647 } |
| 1647 | 1648 |
| 1648 } // namespace compiler | 1649 } // namespace compiler |
| 1649 } // namespace internal | 1650 } // namespace internal |
| 1650 } // namespace v8 | 1651 } // namespace v8 |
| OLD | NEW |