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 "test/unittests/compiler/instruction-selector-unittest.h" | 5 #include "test/unittests/compiler/instruction-selector-unittest.h" |
6 | 6 |
7 #include "src/compiler/graph-inl.h" | 7 #include "src/compiler/graph-inl.h" |
8 #include "src/flags.h" | 8 #include "src/flags.h" |
9 #include "test/unittests/compiler/compiler-test-utils.h" | 9 #include "test/unittests/compiler/compiler-test-utils.h" |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 bool InstructionSelectorTest::Stream::IsFixed(const InstructionOperand* operand, | 131 bool InstructionSelectorTest::Stream::IsFixed(const InstructionOperand* operand, |
132 Register reg) const { | 132 Register reg) const { |
133 if (!operand->IsUnallocated()) return false; | 133 if (!operand->IsUnallocated()) return false; |
134 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); | 134 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); |
135 if (!unallocated->HasFixedRegisterPolicy()) return false; | 135 if (!unallocated->HasFixedRegisterPolicy()) return false; |
136 const int index = Register::ToAllocationIndex(reg); | 136 const int index = Register::ToAllocationIndex(reg); |
137 return unallocated->fixed_register_index() == index; | 137 return unallocated->fixed_register_index() == index; |
138 } | 138 } |
139 | 139 |
140 | 140 |
| 141 bool InstructionSelectorTest::Stream::IsSameAsFirst( |
| 142 const InstructionOperand* operand) const { |
| 143 if (!operand->IsUnallocated()) return false; |
| 144 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); |
| 145 return unallocated->HasSameAsInputPolicy(); |
| 146 } |
| 147 |
| 148 |
141 bool InstructionSelectorTest::Stream::IsUsedAtStart( | 149 bool InstructionSelectorTest::Stream::IsUsedAtStart( |
142 const InstructionOperand* operand) const { | 150 const InstructionOperand* operand) const { |
143 if (!operand->IsUnallocated()) return false; | 151 if (!operand->IsUnallocated()) return false; |
144 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); | 152 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); |
145 return unallocated->IsUsedAtStart(); | 153 return unallocated->IsUsedAtStart(); |
146 } | 154 } |
147 | 155 |
148 | 156 |
149 // ----------------------------------------------------------------------------- | 157 // ----------------------------------------------------------------------------- |
150 // Return. | 158 // Return. |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(12))); | 576 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(12))); |
569 // Continuation. | 577 // Continuation. |
570 | 578 |
571 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 579 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
572 EXPECT_EQ(index, s.size()); | 580 EXPECT_EQ(index, s.size()); |
573 } | 581 } |
574 | 582 |
575 } // namespace compiler | 583 } // namespace compiler |
576 } // namespace internal | 584 } // namespace internal |
577 } // namespace v8 | 585 } // namespace v8 |
OLD | NEW |