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

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

Issue 1365073002: Revert of Remove register index/code indirection (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 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
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
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