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

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

Issue 852633002: add register allocator regression test (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 | « no previous file | no next file » | 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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 TEST_F(RegisterAllocatorTest, RegressionSpillTwice) { 425 TEST_F(RegisterAllocatorTest, RegressionSpillTwice) {
426 StartBlock(); 426 StartBlock();
427 auto p_0 = Parameter(Reg(1)); 427 auto p_0 = Parameter(Reg(1));
428 EmitCall(Slot(-2), Unique(p_0), Reg(p_0, 1)); 428 EmitCall(Slot(-2), Unique(p_0), Reg(p_0, 1));
429 EndBlock(Last()); 429 EndBlock(Last());
430 430
431 Allocate(); 431 Allocate();
432 } 432 }
433 433
434 434
435 TEST_F(RegisterAllocatorTest, RegressionLoadConstantBeforeSpill) {
436 StartBlock();
437 // Fill registers.
438 VReg values[kDefaultNRegs];
439 for (size_t i = arraysize(values); i > 0; --i) {
440 values[i - 1] = Define(Reg(static_cast<int>(i - 1)));
441 }
442 auto c = DefineConstant();
443 auto to_spill = Define(Reg());
444 EndBlock(Jump(1));
445
446 {
447 StartLoop(1);
448
449 StartBlock();
450 // Create a use for c in second half of prev block's last gap
451 Phi(c);
452 for (size_t i = arraysize(values); i > 0; --i) {
453 Phi(values[i - 1]);
454 }
455 EndBlock(Jump(1));
456
457 EndLoop();
458 }
459
460 StartBlock();
461 // Force c to split within to_spill's definition.
462 EmitI(Reg(c));
463 EmitI(Reg(to_spill));
464 EndBlock(Last());
465
466 Allocate();
467 }
468
435 } // namespace compiler 469 } // namespace compiler
436 } // namespace internal 470 } // namespace internal
437 } // namespace v8 471 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698