Chromium Code Reviews

Side by Side Diff: test/unittests/compiler/register-allocator-unittest.cc

Issue 1389373002: [turbofan] Create ExplicitOperands to specify operands without virtual registers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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...)
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.IsRegister()
45 test_op.value_ || 45 ? LocationOperand::cast(op).GetRegister().code()
46 : LocationOperand::cast(op).index()) == test_op.value_ ||
46 test_op.value_ == InstructionSequenceTest::kNoValue); 47 test_op.value_ == InstructionSequenceTest::kNoValue);
Mircea Trofin 2015/10/15 15:05:38 Should we also have a unit test where the register
danno 2015/10/23 08:07:50 The register allocator itself should never see Exp
47 } 48 }
48 49
49 50
50 int GetParallelMoveCount(int instr_index, Instruction::GapPosition gap_pos, 51 int GetParallelMoveCount(int instr_index, Instruction::GapPosition gap_pos,
51 const InstructionSequence* sequence) { 52 const InstructionSequence* sequence) {
52 const ParallelMove* moves = 53 const ParallelMove* moves =
53 sequence->InstructionAt(instr_index)->GetParallelMove(gap_pos); 54 sequence->InstructionAt(instr_index)->GetParallelMove(gap_pos);
54 if (moves == nullptr) return 0; 55 if (moves == nullptr) return 0;
55 return GetMoveCount(*moves); 56 return GetMoveCount(*moves);
56 } 57 }
(...skipping 721 matching lines...)
778 INSTANTIATE_TEST_CASE_P( 779 INSTANTIATE_TEST_CASE_P(
779 RegisterAllocatorTest, SlotConstraintTest, 780 RegisterAllocatorTest, SlotConstraintTest,
780 ::testing::Combine(::testing::ValuesIn(kParameterTypes), 781 ::testing::Combine(::testing::ValuesIn(kParameterTypes),
781 ::testing::Range(0, SlotConstraintTest::kMaxVariant))); 782 ::testing::Range(0, SlotConstraintTest::kMaxVariant)));
782 783
783 #endif // GTEST_HAS_COMBINE 784 #endif // GTEST_HAS_COMBINE
784 785
785 } // namespace compiler 786 } // namespace compiler
786 } // namespace internal 787 } // namespace internal
787 } // namespace v8 788 } // namespace v8
OLDNEW

Powered by Google App Engine