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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 int index = imm->indexed_value(); | 89 int index = imm->indexed_value(); |
90 s.immediates_.insert( | 90 s.immediates_.insert( |
91 std::make_pair(index, sequence.GetImmediate(imm))); | 91 std::make_pair(index, sequence.GetImmediate(imm))); |
92 } | 92 } |
93 } | 93 } |
94 } | 94 } |
95 s.instructions_.push_back(instr); | 95 s.instructions_.push_back(instr); |
96 } | 96 } |
97 for (auto i : s.virtual_registers_) { | 97 for (auto i : s.virtual_registers_) { |
98 int const virtual_register = i.second; | 98 int const virtual_register = i.second; |
99 if (sequence.IsFloat(virtual_register)) { | 99 if (sequence.IsDouble(virtual_register)) { |
100 EXPECT_FALSE(sequence.IsReference(virtual_register)); | 100 EXPECT_FALSE(sequence.IsReference(virtual_register)); |
101 s.doubles_.insert(virtual_register); | 101 s.doubles_.insert(virtual_register); |
102 } | 102 } |
103 if (sequence.IsReference(virtual_register)) { | 103 if (sequence.IsReference(virtual_register)) { |
104 EXPECT_FALSE(sequence.IsFloat(virtual_register)); | 104 EXPECT_FALSE(sequence.IsDouble(virtual_register)); |
105 s.references_.insert(virtual_register); | 105 s.references_.insert(virtual_register); |
106 } | 106 } |
107 } | 107 } |
108 for (int i = 0; i < sequence.GetFrameStateDescriptorCount(); i++) { | 108 for (int i = 0; i < sequence.GetFrameStateDescriptorCount(); i++) { |
109 s.deoptimization_entries_.push_back(sequence.GetFrameStateDescriptor( | 109 s.deoptimization_entries_.push_back(sequence.GetFrameStateDescriptor( |
110 InstructionSequence::StateId::FromInt(i))); | 110 InstructionSequence::StateId::FromInt(i))); |
111 } | 111 } |
112 return s; | 112 return s; |
113 } | 113 } |
114 | 114 |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(12))); | 586 EXPECT_EQ(s.ToVreg(context2), s.ToVreg(call_instr->InputAt(12))); |
587 // Continuation. | 587 // Continuation. |
588 | 588 |
589 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); | 589 EXPECT_EQ(kArchRet, s[index++]->arch_opcode()); |
590 EXPECT_EQ(index, s.size()); | 590 EXPECT_EQ(index, s.size()); |
591 } | 591 } |
592 | 592 |
593 } // namespace compiler | 593 } // namespace compiler |
594 } // namespace internal | 594 } // namespace internal |
595 } // namespace v8 | 595 } // namespace v8 |
OLD | NEW |