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

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

Issue 11406: Simplify virtual frame by removing the virtual stack pointer, which... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/toiger/
Patch Set: Created 12 years, 1 month 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
« src/virtual-frame-arm.cc ('K') | « src/virtual-frame-ia32.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/virtual-frame-ia32.cc
===================================================================
--- src/virtual-frame-ia32.cc (revision 766)
+++ src/virtual-frame-ia32.cc (working copy)
@@ -41,10 +41,9 @@
VirtualFrame::VirtualFrame(CodeGenerator* cgen)
: masm_(cgen->masm()),
elements_(0),
- virtual_stack_pointer_(-1),
- virtual_frame_pointer_(-1),
parameter_count_(cgen->scope()->num_parameters()),
- local_count_(0) {
+ local_count_(0),
+ frame_pointer_(-1) {
// The virtual frame contains a receiver, the parameters, and a return
// address (all in memory) when it is created.
Adjust(parameter_count_ + 2);
@@ -54,12 +53,11 @@
VirtualFrame::VirtualFrame(VirtualFrame* original)
: masm_(original->masm_),
elements_(original->elements_.length()),
- virtual_stack_pointer_(original->virtual_stack_pointer_),
- virtual_frame_pointer_(original->virtual_frame_pointer_),
parameter_count_(original->parameter_count_),
- local_count_(original->local_count_) {
+ local_count_(original->local_count_),
+ frame_pointer_(original->frame_pointer_) {
// Copy all the elements.
- for (int i = 0; i <= virtual_stack_pointer_; i++) {
+ for (int i = 0; i < original->elements_.length(); i++) {
elements_.Add(original->elements_[i]);
}
}
@@ -68,16 +66,16 @@
void VirtualFrame::Adjust(int count) {
ASSERT(count >= 0);
for (int i = 0; i < count; i++) {
- AddElement(Element());
+ elements_.Add(Element());
}
}
void VirtualFrame::Forget(int count) {
ASSERT(count >= 0);
- ASSERT(virtual_stack_pointer_ >= count);
+ ASSERT(elements_.length() >= count);
for (int i = 0; i < count; i++) {
- RemoveElement();
+ elements_.RemoveLast();
}
}
@@ -85,11 +83,10 @@
void VirtualFrame::MergeTo(VirtualFrame* expected) {
ASSERT(masm_ == expected->masm_);
ASSERT(elements_.length() == expected->elements_.length());
- ASSERT(virtual_frame_pointer_ == expected->virtual_frame_pointer_);
- ASSERT(virtual_stack_pointer_ == expected->virtual_stack_pointer_);
ASSERT(parameter_count_ == expected->parameter_count_);
ASSERT(local_count_ == expected->local_count_);
- for (int i = 0; i <= virtual_stack_pointer_; i++) {
+ ASSERT(frame_pointer_ == expected->frame_pointer_);
+ for (int i = 0; i < elements_.length(); i++) {
ASSERT(elements_[i].matches(expected->elements_[i]));
}
}
@@ -100,7 +97,7 @@
Adjust(1);
__ push(ebp);
- virtual_frame_pointer_ = virtual_stack_pointer_;
+ frame_pointer_ = elements_.length() - 1;
__ mov(ebp, Operand(esp));
// Store the context and the function in the frame.
« src/virtual-frame-arm.cc ('K') | « src/virtual-frame-ia32.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698