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 23 matching lines...) Expand all Loading... |
34 | 34 |
35 return (op.IsRegister() && test_op_is_reg) || | 35 return (op.IsRegister() && test_op_is_reg) || |
36 (op.IsStackSlot() && !test_op_is_reg); | 36 (op.IsStackSlot() && !test_op_is_reg); |
37 } | 37 } |
38 | 38 |
39 | 39 |
40 bool AllocatedOperandMatches( | 40 bool AllocatedOperandMatches( |
41 const AllocatedOperand& op, | 41 const AllocatedOperand& op, |
42 const InstructionSequenceTest::TestOperand& test_op) { | 42 const InstructionSequenceTest::TestOperand& test_op) { |
43 return AreOperandsOfSameType(op, test_op) && | 43 return AreOperandsOfSameType(op, test_op) && |
44 (op.index() == test_op.value_ || | 44 ((op.IsRegister() ? op.GetRegister().code() : op.index()) == |
| 45 test_op.value_ || |
45 test_op.value_ == InstructionSequenceTest::kNoValue); | 46 test_op.value_ == InstructionSequenceTest::kNoValue); |
46 } | 47 } |
47 | 48 |
48 | 49 |
49 int GetParallelMoveCount(int instr_index, Instruction::GapPosition gap_pos, | 50 int GetParallelMoveCount(int instr_index, Instruction::GapPosition gap_pos, |
50 const InstructionSequence* sequence) { | 51 const InstructionSequence* sequence) { |
51 const ParallelMove* moves = | 52 const ParallelMove* moves = |
52 sequence->InstructionAt(instr_index)->GetParallelMove(gap_pos); | 53 sequence->InstructionAt(instr_index)->GetParallelMove(gap_pos); |
53 if (moves == nullptr) return 0; | 54 if (moves == nullptr) return 0; |
54 return GetMoveCount(*moves); | 55 return GetMoveCount(*moves); |
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 INSTANTIATE_TEST_CASE_P( | 778 INSTANTIATE_TEST_CASE_P( |
778 RegisterAllocatorTest, SlotConstraintTest, | 779 RegisterAllocatorTest, SlotConstraintTest, |
779 ::testing::Combine(::testing::ValuesIn(kParameterTypes), | 780 ::testing::Combine(::testing::ValuesIn(kParameterTypes), |
780 ::testing::Range(0, SlotConstraintTest::kMaxVariant))); | 781 ::testing::Range(0, SlotConstraintTest::kMaxVariant))); |
781 | 782 |
782 #endif // GTEST_HAS_COMBINE | 783 #endif // GTEST_HAS_COMBINE |
783 | 784 |
784 } // namespace compiler | 785 } // namespace compiler |
785 } // namespace internal | 786 } // namespace internal |
786 } // namespace v8 | 787 } // namespace v8 |
OLD | NEW |