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

Unified Diff: src/lithium-allocator.cc

Issue 5898001: Fix issue 982. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years 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 513a67c7c839dbe4c63e7eeda18f6bc8c93cf820..1510cc49aae2b89cd4b69abb8b20e4a61df5811c 100644
--- a/src/lithium-allocator.cc
+++ b/src/lithium-allocator.cc
@@ -296,13 +296,21 @@ void LiveRange::SplitAt(LifetimePosition position, LiveRange* result) {
// position is contained in one of the intervals in the chain, we
// split that interval and use the first part.
UseInterval* current = FirstSearchIntervalForPosition(position);
+
+ // If split position coincides with the beginning of use interval
Kevin Millikin (Chromium) 2010/12/15 14:01:52 "the split position"..."a use interval" :)
+ // we need to split use positons in a special way.
+ bool split_at_start = false;
+
while (current != NULL) {
if (current->Contains(position)) {
current->SplitAt(position);
break;
}
UseInterval* next = current->next();
- if (next->start().Value() >= position.Value()) break;
+ if (next->start().Value() >= position.Value()) {
+ split_at_start = (next->start().Value() == position.Value());
+ break;
+ }
current = next;
}
@@ -319,9 +327,16 @@ void LiveRange::SplitAt(LifetimePosition position, LiveRange* result) {
// position after it.
UsePosition* use_after = first_pos_;
UsePosition* use_before = NULL;
- while (use_after != NULL && use_after->pos().Value() <= position.Value()) {
- use_before = use_after;
- use_after = use_after->next();
+ if (split_at_start) {
+ while (use_after != NULL && use_after->pos().Value() < position.Value()) {
Kevin Millikin (Chromium) 2010/12/15 14:01:52 Maybe this case needs a short comment too, somethi
+ use_before = use_after;
+ use_after = use_after->next();
+ }
+ } else {
+ while (use_after != NULL && use_after->pos().Value() <= position.Value()) {
+ use_before = use_after;
+ use_after = use_after->next();
+ }
}
// Partition original use positions to the two live ranges.
« 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