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 return unallocated->fixed_register_index() == reg.code(); | 130 const int index = Register::ToAllocationIndex(reg); |
| 131 return unallocated->fixed_register_index() == index; |
131 } | 132 } |
132 | 133 |
133 | 134 |
134 bool InstructionSelectorTest::Stream::IsSameAsFirst( | 135 bool InstructionSelectorTest::Stream::IsSameAsFirst( |
135 const InstructionOperand* operand) const { | 136 const InstructionOperand* operand) const { |
136 if (!operand->IsUnallocated()) return false; | 137 if (!operand->IsUnallocated()) return false; |
137 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); | 138 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(operand); |
138 return unallocated->HasSameAsInputPolicy(); | 139 return unallocated->HasSameAsInputPolicy(); |
139 } | 140 } |
140 | 141 |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); | 611 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(14))); |
611 // Continuation. | 612 // Continuation. |
612 | 613 |
613 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 614 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
614 EXPECT_EQ(index, s.size()); | 615 EXPECT_EQ(index, s.size()); |
615 } | 616 } |
616 | 617 |
617 } // namespace compiler | 618 } // namespace compiler |
618 } // namespace internal | 619 } // namespace internal |
619 } // namespace v8 | 620 } // namespace v8 |
OLD | NEW |