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

Unified Diff: src/compiler/register-allocator.cc

Issue 1322623007: [turbofan] Optimize Splinter by remembering where it left off. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.cc
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc
index f6c339234abb4d8a143d4858134e16fa272d5dac..563c9a276d8d0da93cf1b7b0791f86566e22029b 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -825,6 +825,12 @@ void TopLevelLiveRange::Splinter(LifetimePosition start, LifetimePosition end,
result->set_spill_type(spill_type());
if (start <= Start()) {
+ // TODO(mtrofin): here, the TopLevel part is in the deferred range, so we
+ // may want to continue processing the splinter. However, if the value is
+ // defined in a cold block, and then used in a hot block, it follows that
+ // it should terminate on the RHS of a phi, defined on the hot path. We
+ // should check this, however, this may not be the place, because we don't
+ // have access to the instruction sequence.
DCHECK(end < End());
DetachAt(end, result, zone);
next_ = nullptr;
@@ -844,6 +850,10 @@ void TopLevelLiveRange::Splinter(LifetimePosition start, LifetimePosition end,
next_ = end_part.next_;
last_interval_->set_next(end_part.first_interval_);
+ // The next splinter will happen either at or after the current interval.
+ // We can optimize DetachAt by setting current_interval_ accordingly,
+ // which will then be picked up by FirstSearchIntervalForPosition.
+ current_interval_ = last_interval_;
last_interval_ = end_part.last_interval_;
« 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