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

Unified Diff: src/virtual-frame-ia32.cc

Issue 16567: Enable register allocation for return statements. Make sure to... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: '' Created 11 years, 11 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-ia32.cc
===================================================================
--- src/virtual-frame-ia32.cc (revision 1034)
+++ src/virtual-frame-ia32.cc (working copy)
@@ -594,11 +594,13 @@
// copy is stored in the frame. The external reference to esi
// remains in addition to the cached copy in the frame.
Push(esi);
+ SyncElementAt(elements_.length() - 1);
- // Store the function in the frame. The frame owns the register reference
- // now (ie, it can keep it in edi or spill it later).
+ // Store the function in the frame. The frame owns the register
+ // reference now (ie, it can keep it in edi or spill it later).
Push(edi);
cgen_->allocator()->Unuse(edi);
+ SpillElementAt(elements_.length() - 1);
}
@@ -626,6 +628,21 @@
}
+void VirtualFrame::PrepareForReturn() {
+ // Spill all locals. This is necessary to make sure all locals have
+ // the right value when breaking at the return site in the debugger.
+ for (int i = 0; i < expression_base_index(); i++) SpillElementAt(i);
+
+ // Forget all about non-local stack elements.
+ Forget(height());
Kevin Millikin (Chromium) 2009/01/07 10:25:12 As discussed offline, Forget as it currently stand
+
+ // Validate state: The expression stack should be empty and the
+ // stack pointer should have been updated to reflect this.
+ ASSERT(height() == 0);
+ ASSERT(stack_pointer_ == expression_base_index() - 1);
+}
+
+
void VirtualFrame::AllocateStackSlots(int count) {
ASSERT(height() == 0);
local_count_ = count;

Powered by Google App Engine
This is Rietveld 408576698