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/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
6 #include "test/unittests/compiler/instruction-sequence-unittest.h" | 6 #include "test/unittests/compiler/instruction-sequence-unittest.h" |
7 | 7 |
8 namespace v8 { | 8 namespace v8 { |
9 namespace internal { | 9 namespace internal { |
10 namespace compiler { | 10 namespace compiler { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 if (move->IsEliminated() || move->IsRedundant()) continue; | 68 if (move->IsEliminated() || move->IsRedundant()) continue; |
69 if (AllocatedOperandMatches(AllocatedOperand::cast(move->source()), src) && | 69 if (AllocatedOperandMatches(AllocatedOperand::cast(move->source()), src) && |
70 AllocatedOperandMatches(AllocatedOperand::cast(move->destination()), | 70 AllocatedOperandMatches(AllocatedOperand::cast(move->destination()), |
71 dest)) { | 71 dest)) { |
72 found_match = true; | 72 found_match = true; |
73 break; | 73 break; |
74 } | 74 } |
75 } | 75 } |
76 return found_match; | 76 return found_match; |
77 } | 77 } |
78 } | 78 |
| 79 } // namespace |
79 | 80 |
80 | 81 |
81 class RegisterAllocatorTest : public InstructionSequenceTest { | 82 class RegisterAllocatorTest : public InstructionSequenceTest { |
82 public: | 83 public: |
83 void Allocate() { | 84 void Allocate() { |
84 WireBlocks(); | 85 WireBlocks(); |
85 Pipeline::AllocateRegistersForTesting(config(), sequence(), true); | 86 Pipeline::AllocateRegistersForTesting(config(), sequence(), true); |
86 } | 87 } |
87 }; | 88 }; |
88 | 89 |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 | 716 |
716 protected: | 717 protected: |
717 ParameterType parameter_type() const { | 718 ParameterType parameter_type() const { |
718 return ::testing::get<0>(B::GetParam()); | 719 return ::testing::get<0>(B::GetParam()); |
719 } | 720 } |
720 int variant() const { return ::testing::get<1>(B::GetParam()); } | 721 int variant() const { return ::testing::get<1>(B::GetParam()); } |
721 | 722 |
722 private: | 723 private: |
723 typedef ::testing::WithParamInterface<::testing::tuple<ParameterType, int>> B; | 724 typedef ::testing::WithParamInterface<::testing::tuple<ParameterType, int>> B; |
724 }; | 725 }; |
725 } | 726 |
| 727 } // namespace |
726 | 728 |
727 | 729 |
728 #if GTEST_HAS_COMBINE | 730 #if GTEST_HAS_COMBINE |
729 | 731 |
730 TEST_P(SlotConstraintTest, SlotConstraint) { | 732 TEST_P(SlotConstraintTest, SlotConstraint) { |
731 StartBlock(); | 733 StartBlock(); |
732 VReg p_0; | 734 VReg p_0; |
733 switch (parameter_type()) { | 735 switch (parameter_type()) { |
734 case ParameterType::kFixedSlot: | 736 case ParameterType::kFixedSlot: |
735 p_0 = Parameter(Slot(-1)); | 737 p_0 = Parameter(Slot(-1)); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
775 INSTANTIATE_TEST_CASE_P( | 777 INSTANTIATE_TEST_CASE_P( |
776 RegisterAllocatorTest, SlotConstraintTest, | 778 RegisterAllocatorTest, SlotConstraintTest, |
777 ::testing::Combine(::testing::ValuesIn(kParameterTypes), | 779 ::testing::Combine(::testing::ValuesIn(kParameterTypes), |
778 ::testing::Range(0, SlotConstraintTest::kMaxVariant))); | 780 ::testing::Range(0, SlotConstraintTest::kMaxVariant))); |
779 | 781 |
780 #endif // GTEST_HAS_COMBINE | 782 #endif // GTEST_HAS_COMBINE |
781 | 783 |
782 } // namespace compiler | 784 } // namespace compiler |
783 } // namespace internal | 785 } // namespace internal |
784 } // namespace v8 | 786 } // namespace v8 |
OLD | NEW |