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

Unified Diff: src/virtual-frame.cc

Issue 92121: Materializing a frame element on the stack by pushing it can cause the... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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
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)) {

Powered by Google App Engine
This is Rietveld 408576698