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

Unified Diff: src/lithium-allocator.cc

Issue 7053039: Fix two bugs in LiveRange::SplitAt: (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 7 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/lithium-allocator.cc
diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc
index 50ed122784ebda46e9ff90ba3d204bb2eff415d0..c39d5998a1a62365bbabbd6cd8c32d738d842b32 100644
--- a/src/lithium-allocator.cc
+++ b/src/lithium-allocator.cc
@@ -303,6 +303,11 @@ void LiveRange::SplitAt(LifetimePosition position, LiveRange* result) {
// we need to split use positons in a special way.
bool split_at_start = false;
+ if (current->start().Value() == position.Value()) {
+ // When splitting at start we need to locate the previous use interval.
+ current = first_interval_;
+ }
+
while (current != NULL) {
if (current->Contains(position)) {
current->SplitAt(position);
@@ -352,6 +357,11 @@ void LiveRange::SplitAt(LifetimePosition position, LiveRange* result) {
}
result->first_pos_ = use_after;
+ // Discard cached iteration state. It might be pointing
+ // to the use that no longer belongs to this live range.
+ last_processed_use_ = NULL;
+ current_interval_ = NULL;
+
// Link the new live range in the chain before any of the other
// ranges linked from the range before the split.
result->parent_ = (parent_ == NULL) ? this : parent_;
« 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