Author: [EMAIL PROTECTED]
Date: Thu Nov 20 00:27:03 2008
New Revision: 797

Modified:
    branches/experimental/toiger/src/codegen-ia32.cc
    branches/experimental/toiger/src/virtual-frame-ia32.cc
    branches/experimental/toiger/src/virtual-frame-ia32.h

Log:
Experimental: eagerly allocate space in the actual frame for spilling
locals.  It's more compact for multiple locals, and we will always
need to allocate this space anyway.
Review URL: http://codereview.chromium.org/11470

Modified: branches/experimental/toiger/src/codegen-ia32.cc
==============================================================================
--- branches/experimental/toiger/src/codegen-ia32.cc    (original)
+++ branches/experimental/toiger/src/codegen-ia32.cc    Thu Nov 20 00:27:03  
2008
@@ -1228,7 +1228,7 @@
  // Call the function just below TOS on the stack with the given
  // arguments. The receiver is the TOS.
  void CodeGenerator::CallWithArguments(ZoneList<Expression*>* args,
-                                          int position) {
+                                      int position) {
    // Push the arguments ("left-to-right") on the stack.
    int arg_count = args->length();
    for (int i = 0; i < arg_count; i++) {

Modified: branches/experimental/toiger/src/virtual-frame-ia32.cc
==============================================================================
--- branches/experimental/toiger/src/virtual-frame-ia32.cc      (original)
+++ branches/experimental/toiger/src/virtual-frame-ia32.cc      Thu Nov 20  
00:27:03 2008
@@ -206,8 +206,19 @@
  void VirtualFrame::AllocateStackSlots(int count) {
    ASSERT(height() == 0);
    local_count_ = count;
-  for (int i = 0; i < count; i++) {
-    elements_.Add(FrameElement(Factory::undefined_value()));
+
+  if (count > 0) {
+    Comment cmnt(masm_, "[ Allocate space for locals");
+    // The locals are constants (the undefined value), but we sync them  
with
+    // the actual frame to allocate space for spilling them.
+    FrameElement initial_value(Factory::undefined_value());
+    initial_value.clear_dirty();
+    __ Set(eax, Immediate(Factory::undefined_value()));
+    for (int i = 0; i < count; i++) {
+      elements_.Add(initial_value);
+      stack_pointer_++;
+      __ push(eax);
+    }
    }
  }


Modified: branches/experimental/toiger/src/virtual-frame-ia32.h
==============================================================================
--- branches/experimental/toiger/src/virtual-frame-ia32.h       (original)
+++ branches/experimental/toiger/src/virtual-frame-ia32.h       Thu Nov 20  
00:27:03 2008
@@ -137,9 +137,8 @@
    void Enter();
    void Exit();

-  // Allocate and initialize the frame-allocated locals.  The number of
-  // locals is known from the frame's code generator's state (specifically
-  // its scope).  As a side effect, code may be emitted.
+  // Allocate and initialize the frame-allocated locals.  The eax register
+  // us clobbered.
    void AllocateStackSlots(int count);

    // The current top of the expression stack as an assembly operand.

--~--~---------~--~----~------------~-------~--~----~
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to