| Index: src/virtual-frame.cc
|
| ===================================================================
|
| --- src/virtual-frame.cc (revision 1784)
|
| +++ src/virtual-frame.cc (working copy)
|
| @@ -213,40 +213,14 @@
|
| }
|
|
|
|
|
| -// Clear the dirty bits for the range of elements in
|
| -// [min(stack_pointer_ + 1,begin), end).
|
| -void VirtualFrame::SyncRange(int begin, int end) {
|
| - ASSERT(begin >= 0);
|
| - ASSERT(end <= elements_.length());
|
| - if (begin > stack_pointer_) {
|
| - // Elements between stack_pointer_ + 1 and begin must also be synced.
|
| - for (int i = stack_pointer_ + 1; i < end; i++) {
|
| - SyncElementByPushing(i);
|
| - }
|
| - } else if (end <= stack_pointer_ + 1) {
|
| - for (int i = begin; i < end; i++) {
|
| - if (!elements_[i].is_synced()) {
|
| - SyncElementBelowStackPointer(i);
|
| - }
|
| - }
|
| - } else {
|
| - // Split into two ranges that each satisfy a condition above.
|
| - SyncRange(begin, stack_pointer_ + 1);
|
| - SyncRange(stack_pointer_ + 1, end);
|
| - }
|
| -}
|
| -
|
| -
|
| // Clear the dirty bit for the element at a given index.
|
| void VirtualFrame::SyncElementAt(int index) {
|
| if (index <= stack_pointer_) {
|
| - if (!elements_[index].is_synced()) {
|
| - SyncElementBelowStackPointer(index);
|
| - }
|
| + if (!elements_[index].is_synced()) SyncElementBelowStackPointer(index);
|
| + } else if (index == stack_pointer_ + 1) {
|
| + SyncElementByPushing(index);
|
| } else {
|
| - for (int i = stack_pointer_ + 1; i <= index; i++) {
|
| - SyncElementByPushing(i);
|
| - }
|
| + SyncRange(stack_pointer_ + 1, index);
|
| }
|
| }
|
|
|
| @@ -310,7 +284,7 @@
|
| ASSERT(height() >= spilled_args);
|
| ASSERT(dropped_args <= spilled_args);
|
|
|
| - SyncRange(0, elements_.length());
|
| + SyncRange(0, elements_.length() - 1);
|
| // Spill registers.
|
| for (int i = 0; i < kNumRegisters; i++) {
|
| if (is_used(i)) {
|
|
|