Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: test/unittests/compiler/instruction-selector-unittest.cc

Issue 1287383003: Re-reland: Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix MIPS tests again Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « test/cctest/test-code-stubs-x64.cc ('k') | test/unittests/compiler/instruction-sequence-unittest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698