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

Side by Side Diff: test/unittests/compiler/register-allocator-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, 3 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
« no previous file with comments | « test/unittests/compiler/instruction-sequence-unittest.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "src/compiler/pipeline.h" 5 #include "src/compiler/pipeline.h"
6 #include "test/unittests/compiler/instruction-sequence-unittest.h" 6 #include "test/unittests/compiler/instruction-sequence-unittest.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 namespace compiler { 10 namespace compiler {
(...skipping 23 matching lines...) Expand all
34 34
35 return (op.IsRegister() && test_op_is_reg) || 35 return (op.IsRegister() && test_op_is_reg) ||
36 (op.IsStackSlot() && !test_op_is_reg); 36 (op.IsStackSlot() && !test_op_is_reg);
37 } 37 }
38 38
39 39
40 bool AllocatedOperandMatches( 40 bool AllocatedOperandMatches(
41 const AllocatedOperand& op, 41 const AllocatedOperand& op,
42 const InstructionSequenceTest::TestOperand& test_op) { 42 const InstructionSequenceTest::TestOperand& test_op) {
43 return AreOperandsOfSameType(op, test_op) && 43 return AreOperandsOfSameType(op, test_op) &&
44 ((op.IsRegister() ? op.GetRegister().code() : op.index()) == 44 (op.index() == test_op.value_ ||
45 test_op.value_ ||
46 test_op.value_ == InstructionSequenceTest::kNoValue); 45 test_op.value_ == InstructionSequenceTest::kNoValue);
47 } 46 }
48 47
49 48
50 int GetParallelMoveCount(int instr_index, Instruction::GapPosition gap_pos, 49 int GetParallelMoveCount(int instr_index, Instruction::GapPosition gap_pos,
51 const InstructionSequence* sequence) { 50 const InstructionSequence* sequence) {
52 const ParallelMove* moves = 51 const ParallelMove* moves =
53 sequence->InstructionAt(instr_index)->GetParallelMove(gap_pos); 52 sequence->InstructionAt(instr_index)->GetParallelMove(gap_pos);
54 if (moves == nullptr) return 0; 53 if (moves == nullptr) return 0;
55 return GetMoveCount(*moves); 54 return GetMoveCount(*moves);
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
776 INSTANTIATE_TEST_CASE_P( 775 INSTANTIATE_TEST_CASE_P(
777 RegisterAllocatorTest, SlotConstraintTest, 776 RegisterAllocatorTest, SlotConstraintTest,
778 ::testing::Combine(::testing::ValuesIn(kParameterTypes), 777 ::testing::Combine(::testing::ValuesIn(kParameterTypes),
779 ::testing::Range(0, SlotConstraintTest::kMaxVariant))); 778 ::testing::Range(0, SlotConstraintTest::kMaxVariant)));
780 779
781 #endif // GTEST_HAS_COMBINE 780 #endif // GTEST_HAS_COMBINE
782 781
783 } // namespace compiler 782 } // namespace compiler
784 } // namespace internal 783 } // namespace internal
785 } // namespace v8 784 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/compiler/instruction-sequence-unittest.cc ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698