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 "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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 TEST_F(RegisterAllocatorTest, DoubleDiamondManyRedundantPhis) { | 148 TEST_F(RegisterAllocatorTest, DoubleDiamondManyRedundantPhis) { |
149 const int kPhis = kDefaultNRegs * 2; | 149 const int kPhis = kDefaultNRegs * 2; |
150 | 150 |
151 // First diamond. | 151 // First diamond. |
152 StartBlock(); | 152 StartBlock(); |
153 VReg vals[kPhis]; | 153 VReg vals[kPhis]; |
154 for (int i = 0; i < kPhis; ++i) { | 154 for (int i = 0; i < kPhis; ++i) { |
155 vals[i] = Parameter(Slot(i)); | 155 vals[i] = Parameter(Slot(-1 - i)); |
156 } | 156 } |
157 EndBlock(Branch(Reg(DefineConstant()), 1, 2)); | 157 EndBlock(Branch(Reg(DefineConstant()), 1, 2)); |
158 | 158 |
159 StartBlock(); | 159 StartBlock(); |
160 EndBlock(Jump(2)); | 160 EndBlock(Jump(2)); |
161 | 161 |
162 StartBlock(); | 162 StartBlock(); |
163 EndBlock(Jump(1)); | 163 EndBlock(Jump(1)); |
164 | 164 |
165 // Second diamond. | 165 // Second diamond. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 } | 270 } |
271 EmitCall(Slot(-1), arraysize(call_ops), call_ops); | 271 EmitCall(Slot(-1), arraysize(call_ops), call_ops); |
272 EndBlock(Last()); | 272 EndBlock(Last()); |
273 | 273 |
274 Allocate(); | 274 Allocate(); |
275 } | 275 } |
276 | 276 |
277 } // namespace compiler | 277 } // namespace compiler |
278 } // namespace internal | 278 } // namespace internal |
279 } // namespace v8 | 279 } // namespace v8 |
OLD | NEW |