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

Unified Diff: src/lithium-allocator.cc

Issue 14771015: Cache first hint operand while building live ranges. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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 | « src/lithium-allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium-allocator.cc
diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc
index 5eb95e5e9fae7c74c9f116e793ce5c6b747513d5..74132b3b76a6138fa530aa46f72fce9883f1585e 100644
--- a/src/lithium-allocator.cc
+++ b/src/lithium-allocator.cc
@@ -140,6 +140,7 @@ LiveRange::LiveRange(int id, Zone* zone)
next_(NULL),
current_interval_(NULL),
last_processed_use_(NULL),
+ current_hint_operand_(NULL),
spill_operand_(new(zone) LOperand()),
spill_start_index_(kMaxInt) { }
@@ -452,9 +453,11 @@ void LiveRange::AddUsePosition(LifetimePosition pos,
id_,
pos.Value());
UsePosition* use_pos = new(zone) UsePosition(pos, operand, hint);
+ UsePosition* prev_hint = NULL;
UsePosition* prev = NULL;
UsePosition* current = first_pos_;
while (current != NULL && current->pos().Value() < pos.Value()) {
+ prev_hint = current->HasHint() ? current : prev_hint;
prev = current;
current = current->next();
}
@@ -466,6 +469,10 @@ void LiveRange::AddUsePosition(LifetimePosition pos,
use_pos->next_ = prev->next_;
prev->next_ = use_pos;
}
+
+ if (prev_hint == NULL && use_pos->HasHint()) {
+ current_hint_operand_ = hint;
+ }
}
@@ -918,7 +925,7 @@ void LAllocator::ProcessInstructions(HBasicBlock* block, BitVector* live) {
if (phi != NULL) {
// This is a phi resolving move.
if (!phi->block()->IsLoopHeader()) {
- hint = LiveRangeFor(phi->id())->FirstHint();
+ hint = LiveRangeFor(phi->id())->current_hint_operand();
}
} else {
if (to->IsUnallocated()) {
« no previous file with comments | « src/lithium-allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698