Commit d71adb6d authored by vegorov@chromium.org's avatar vegorov@chromium.org

Fix two bugs in LiveRange::SplitAt:

- when splitting at the beginning of the UseInterval we need to find an interval preceding it.

- we need to reset cached iteration state after splitting.

BUG=v8:1410

Review URL: http://codereview.chromium.org/7053039

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@8123 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent c5fc4b90
......@@ -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_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment