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

Unified Diff: src/virtual-frame-arm.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
« no previous file with comments | « src/virtual-frame-arm.h ('k') | src/virtual-frame-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/virtual-frame-arm.cc
===================================================================
--- src/virtual-frame-arm.cc (revision 766)
+++ src/virtual-frame-arm.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) {
iposva 2008/11/17 17:11:53 Ideally you could define an illegal index and use
// The virtual frame contains a receiver and the parameters (all in
// memory) when it is created.
Adjust(parameter_count_ + 1);
@@ -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]));
}
}
@@ -114,7 +111,7 @@
Adjust(4);
iposva 2008/11/17 17:11:53 Can you please document the magic numbers in this
__ stm(db_w, sp, r1.bit() | cp.bit() | fp.bit() | lr.bit());
// Adjust FP to point to saved FP.
- virtual_frame_pointer_ = virtual_stack_pointer_ - 1;
+ frame_pointer_ = elements_.length() - 2;
__ add(fp, sp, Operand(2 * kPointerSize));
}
« no previous file with comments | « src/virtual-frame-arm.h ('k') | src/virtual-frame-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698