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

Unified Diff: src/lithium-allocator.cc

Issue 14524008: Make UsePosition::hint immutable. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Sven Panne. 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 7bddef7f99b940cfaa6c02bf8dfdd3378f34915e..a010f4ea805d19737221b6b16435b650dcbc81b4 100644
--- a/src/lithium-allocator.cc
+++ b/src/lithium-allocator.cc
@@ -56,9 +56,11 @@ static inline LifetimePosition Max(LifetimePosition a, LifetimePosition b) {
}
-UsePosition::UsePosition(LifetimePosition pos, LOperand* operand)
+UsePosition::UsePosition(LifetimePosition pos,
+ LOperand* operand,
+ LOperand* hint)
: operand_(operand),
- hint_(NULL),
+ hint_(hint),
pos_(pos),
next_(NULL),
requires_reg_(false),
@@ -449,13 +451,14 @@ void LiveRange::AddUseInterval(LifetimePosition start,
}
-UsePosition* LiveRange::AddUsePosition(LifetimePosition pos,
- LOperand* operand,
- Zone* zone) {
+void LiveRange::AddUsePosition(LifetimePosition pos,
+ LOperand* operand,
+ LOperand* hint,
+ Zone* zone) {
LAllocator::TraceAlloc("Add to live range %d use position %d\n",
id_,
pos.Value());
- UsePosition* use_pos = new(zone) UsePosition(pos, operand);
+ UsePosition* use_pos = new(zone) UsePosition(pos, operand, hint);
UsePosition* prev = NULL;
UsePosition* current = first_pos_;
while (current != NULL && current->pos().Value() < pos.Value()) {
@@ -470,8 +473,6 @@ UsePosition* LiveRange::AddUsePosition(LifetimePosition pos,
use_pos->next_ = prev->next_;
prev->next_ = use_pos;
}
-
- return use_pos;
}
@@ -725,14 +726,14 @@ void LAllocator::Define(LifetimePosition position,
if (range->IsEmpty() || range->Start().Value() > position.Value()) {
// Can happen if there is a definition without use.
range->AddUseInterval(position, position.NextInstruction(), zone_);
- range->AddUsePosition(position.NextInstruction(), NULL, zone_);
+ range->AddUsePosition(position.NextInstruction(), NULL, NULL, zone_);
} else {
range->ShortenTo(position);
}
if (operand->IsUnallocated()) {
LUnallocated* unalloc_operand = LUnallocated::cast(operand);
- range->AddUsePosition(position, unalloc_operand, zone_)->set_hint(hint);
+ range->AddUsePosition(position, unalloc_operand, hint, zone_);
}
}
@@ -745,7 +746,7 @@ void LAllocator::Use(LifetimePosition block_start,
if (range == NULL) return;
if (operand->IsUnallocated()) {
LUnallocated* unalloc_operand = LUnallocated::cast(operand);
- range->AddUsePosition(position, unalloc_operand, zone_)->set_hint(hint);
+ range->AddUsePosition(position, unalloc_operand, hint, zone_);
}
range->AddUseInterval(block_start, position, zone_);
}
« 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