| 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 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 | 671 |
| 672 const int def_of_v2 = 3; | 672 const int def_of_v2 = 3; |
| 673 const int call_in_b1 = 4; | 673 const int call_in_b1 = 4; |
| 674 const int call_in_b2 = 6; | 674 const int call_in_b2 = 6; |
| 675 const int end_of_b1 = 5; | 675 const int end_of_b1 = 5; |
| 676 const int end_of_b2 = 7; | 676 const int end_of_b2 = 7; |
| 677 const int start_of_b3 = 8; | 677 const int start_of_b3 = 8; |
| 678 | 678 |
| 679 Allocate(); | 679 Allocate(); |
| 680 // TODO(mtrofin): at the moment, the linear allocator spills var1 and var2, | 680 // TODO(mtrofin): at the moment, the linear allocator spills var1 and var2, |
| 681 // so only var3 is spilled in deferred blocks. Greedy avoids spilling 1&2. | 681 // so only var3 is spilled in deferred blocks. |
| 682 // Expand the test once greedy is back online with this facility. | |
| 683 const int var3_reg = 2; | 682 const int var3_reg = 2; |
| 684 const int var3_slot = 2; | 683 const int var3_slot = 2; |
| 685 | 684 |
| 686 EXPECT_FALSE(IsParallelMovePresent(def_of_v2, Instruction::START, sequence(), | 685 EXPECT_FALSE(IsParallelMovePresent(def_of_v2, Instruction::START, sequence(), |
| 687 Reg(var3_reg), Slot())); | 686 Reg(var3_reg), Slot())); |
| 688 EXPECT_TRUE(IsParallelMovePresent(call_in_b1, Instruction::START, sequence(), | 687 EXPECT_TRUE(IsParallelMovePresent(call_in_b1, Instruction::START, sequence(), |
| 689 Reg(var3_reg), Slot(var3_slot))); | 688 Reg(var3_reg), Slot(var3_slot))); |
| 690 EXPECT_TRUE(IsParallelMovePresent(end_of_b1, Instruction::START, sequence(), | 689 EXPECT_TRUE(IsParallelMovePresent(end_of_b1, Instruction::START, sequence(), |
| 691 Slot(var3_slot), Reg())); | 690 Slot(var3_slot), Reg())); |
| 692 | 691 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 778 INSTANTIATE_TEST_CASE_P( | 777 INSTANTIATE_TEST_CASE_P( |
| 779 RegisterAllocatorTest, SlotConstraintTest, | 778 RegisterAllocatorTest, SlotConstraintTest, |
| 780 ::testing::Combine(::testing::ValuesIn(kParameterTypes), | 779 ::testing::Combine(::testing::ValuesIn(kParameterTypes), |
| 781 ::testing::Range(0, SlotConstraintTest::kMaxVariant))); | 780 ::testing::Range(0, SlotConstraintTest::kMaxVariant))); |
| 782 | 781 |
| 783 #endif // GTEST_HAS_COMBINE | 782 #endif // GTEST_HAS_COMBINE |
| 784 | 783 |
| 785 } // namespace compiler | 784 } // namespace compiler |
| 786 } // namespace internal | 785 } // namespace internal |
| 787 } // namespace v8 | 786 } // namespace v8 |
| OLD | NEW |