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

Side by Side Diff: src/compiler/register-allocator.cc

Issue 1315113003: [turbofan] Live Range unit tests (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 | « no previous file | test/unittests/compiler/live-range-builder.h » ('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/base/adapters.h" 5 #include "src/base/adapters.h"
6 #include "src/compiler/linkage.h" 6 #include "src/compiler/linkage.h"
7 #include "src/compiler/register-allocator.h" 7 #include "src/compiler/register-allocator.h"
8 #include "src/string-stream.h" 8 #include "src/string-stream.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 if (child->next() == nullptr) { 430 if (child->next() == nullptr) {
431 TopLevel()->set_last_child(child); 431 TopLevel()->set_last_child(child);
432 } 432 }
433 return child; 433 return child;
434 } 434 }
435 435
436 436
437 void LiveRange::DetachAt(LifetimePosition position, LiveRange* result, 437 void LiveRange::DetachAt(LifetimePosition position, LiveRange* result,
438 Zone* zone) { 438 Zone* zone) {
439 DCHECK(Start() < position); 439 DCHECK(Start() < position);
440 DCHECK(End() > position);
440 DCHECK(result->IsEmpty()); 441 DCHECK(result->IsEmpty());
441 // Find the last interval that ends before the position. If the 442 // Find the last interval that ends before the position. If the
442 // position is contained in one of the intervals in the chain, we 443 // position is contained in one of the intervals in the chain, we
443 // split that interval and use the first part. 444 // split that interval and use the first part.
444 auto current = FirstSearchIntervalForPosition(position); 445 auto current = FirstSearchIntervalForPosition(position);
445 446
446 // If the split position coincides with the beginning of a use interval 447 // If the split position coincides with the beginning of a use interval
447 // we need to split use positons in a special way. 448 // we need to split use positons in a special way.
448 bool split_at_start = false; 449 bool split_at_start = false;
449 450
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 872
872 result->SetSplinteredFrom(this); 873 result->SetSplinteredFrom(this);
873 } 874 }
874 875
875 876
876 void TopLevelLiveRange::SetSplinteredFrom(TopLevelLiveRange* splinter_parent) { 877 void TopLevelLiveRange::SetSplinteredFrom(TopLevelLiveRange* splinter_parent) {
877 // The splinter parent is always the original "Top". 878 // The splinter parent is always the original "Top".
878 DCHECK(splinter_parent->Start() < Start()); 879 DCHECK(splinter_parent->Start() < Start());
879 880
880 splintered_from_ = splinter_parent; 881 splintered_from_ = splinter_parent;
881 if (!HasSpillOperand()) { 882 if (!HasSpillOperand() && splinter_parent->spill_range_ != nullptr) {
882 SetSpillRange(splinter_parent->spill_range_); 883 SetSpillRange(splinter_parent->spill_range_);
883 } 884 }
884 } 885 }
885 886
886 887
887 void TopLevelLiveRange::UpdateSpillRangePostMerge(TopLevelLiveRange* merged) { 888 void TopLevelLiveRange::UpdateSpillRangePostMerge(TopLevelLiveRange* merged) {
888 DCHECK(merged->TopLevel() == this); 889 DCHECK(merged->TopLevel() == this);
889 890
890 if (HasNoSpillType() && merged->HasSpillRange()) { 891 if (HasNoSpillType() && merged->HasSpillRange()) {
891 set_spill_type(merged->spill_type()); 892 set_spill_type(merged->spill_type());
(...skipping 2421 matching lines...) Expand 10 before | Expand all | Expand 10 after
3313 auto eliminate = moves->PrepareInsertAfter(move); 3314 auto eliminate = moves->PrepareInsertAfter(move);
3314 to_insert.push_back(move); 3315 to_insert.push_back(move);
3315 if (eliminate != nullptr) to_eliminate.push_back(eliminate); 3316 if (eliminate != nullptr) to_eliminate.push_back(eliminate);
3316 } 3317 }
3317 } 3318 }
3318 3319
3319 3320
3320 } // namespace compiler 3321 } // namespace compiler
3321 } // namespace internal 3322 } // namespace internal
3322 } // namespace v8 3323 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/unittests/compiler/live-range-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698