| 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.h" | 7 #include "src/compiler/graph.h" |
| 8 #include "src/compiler/schedule.h" | 8 #include "src/compiler/schedule.h" |
| 9 #include "src/flags.h" | 9 #include "src/flags.h" |
| 10 #include "test/unittests/compiler/compiler-test-utils.h" | 10 #include "test/unittests/compiler/compiler-test-utils.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 CHECK(i != virtual_registers_.end()); | 120 CHECK(i != virtual_registers_.end()); |
| 121 return i->second; | 121 return i->second; |
| 122 } | 122 } |
| 123 | 123 |
| 124 | 124 |
| 125 bool InstructionSelectorTest::Stream::IsFixed(const InstructionOperand* operand, | 125 bool InstructionSelectorTest::Stream::IsFixed(const InstructionOperand* operand, |
| 126 Register reg) const { | 126 Register reg) const { |
| 127 if (!operand->IsUnallocated()) return false; | 127 if (!operand->IsUnallocated()) return false; |
| 128 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); | 128 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); |
| 129 if (!unallocated->HasFixedRegisterPolicy()) return false; | 129 if (!unallocated->HasFixedRegisterPolicy()) return false; |
| 130 const int index = Register::ToAllocationIndex(reg); | 130 return unallocated->fixed_register_index() == reg.code(); |
| 131 return unallocated->fixed_register_index() == index; | |
| 132 } | 131 } |
| 133 | 132 |
| 134 | 133 |
| 135 bool InstructionSelectorTest::Stream::IsSameAsFirst( | 134 bool InstructionSelectorTest::Stream::IsSameAsFirst( |
| 136 const InstructionOperand* operand) const { | 135 const InstructionOperand* operand) const { |
| 137 if (!operand->IsUnallocated()) return false; | 136 if (!operand->IsUnallocated()) return false; |
| 138 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); | 137 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); |
| 139 return unallocated->HasSameAsInputPolicy(); | 138 return unallocated->HasSameAsInputPolicy(); |
| 140 } | 139 } |
| 141 | 140 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 611 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); | 610 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); |
| 612 // Continuation. | 611 // Continuation. |
| 613 | 612 |
| 614 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 613 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
| 615 EXPECT_EQ(index, s.size()); | 614 EXPECT_EQ(index, s.size()); |
| 616 } | 615 } |
| 617 | 616 |
| 618 } // namespace compiler | 617 } // namespace compiler |
| 619 } // namespace internal | 618 } // namespace internal |
| 620 } // namespace v8 | 619 } // namespace v8 |
| OLD | NEW |