Revision: 4671
Author: [email protected]
Date: Tue May 18 04:19:34 2010
Log: Spill arguments for a function call from the virtual frame as they are produced.
Review URL: http://codereview.chromium.org/2103007
http://code.google.com/p/v8/source/detail?r=4671

Modified:
 /branches/bleeding_edge/src/ia32/codegen-ia32.cc
 /branches/bleeding_edge/src/ia32/virtual-frame-ia32.h
 /branches/bleeding_edge/src/x64/codegen-x64.cc
 /branches/bleeding_edge/src/x64/virtual-frame-x64.h

=======================================
--- /branches/bleeding_edge/src/ia32/codegen-ia32.cc Mon May 17 08:41:35 2010 +++ /branches/bleeding_edge/src/ia32/codegen-ia32.cc Tue May 18 04:19:34 2010
@@ -2981,6 +2981,7 @@
   int arg_count = args->length();
   for (int i = 0; i < arg_count; i++) {
     Load(args->at(i));
+    frame_->SpillTop();
   }

   // Record the position for debugging purposes.
@@ -5732,6 +5733,7 @@
     int arg_count = args->length();
     for (int i = 0; i < arg_count; i++) {
       Load(args->at(i));
+      frame_->SpillTop();
     }

     // Prepare the stack for the call to ResolvePossiblyDirectEval.
@@ -5781,6 +5783,7 @@
     int arg_count = args->length();
     for (int i = 0; i < arg_count; i++) {
       Load(args->at(i));
+      frame_->SpillTop();
     }

     // Push the name of the function onto the frame.
@@ -5886,6 +5889,7 @@
         int arg_count = args->length();
         for (int i = 0; i < arg_count; i++) {
           Load(args->at(i));
+          frame_->SpillTop();
         }

         // Push the name of the function onto the frame.
=======================================
--- /branches/bleeding_edge/src/ia32/virtual-frame-ia32.h Mon May 10 04:32:25 2010 +++ /branches/bleeding_edge/src/ia32/virtual-frame-ia32.h Tue May 18 04:19:34 2010
@@ -143,6 +143,9 @@
   // register spilled or no_reg if it was not possible to free any register
   // (ie, they all have frame-external references).
   Register SpillAnyRegister();
+
+  // Spill the top element of the frame.
+  void SpillTop() { SpillElementAt(element_count() - 1); }

   // Sync the range of elements in [begin, end] with memory.
   void SyncRange(int begin, int end);
=======================================
--- /branches/bleeding_edge/src/x64/codegen-x64.cc      Tue May 18 01:43:08 2010
+++ /branches/bleeding_edge/src/x64/codegen-x64.cc      Tue May 18 04:19:34 2010
@@ -2801,6 +2801,7 @@
     int arg_count = args->length();
     for (int i = 0; i < arg_count; i++) {
       Load(args->at(i));
+      frame_->SpillTop();
     }

     // Prepare the stack for the call to ResolvePossiblyDirectEval.
@@ -2850,6 +2851,7 @@
     int arg_count = args->length();
     for (int i = 0; i < arg_count; i++) {
       Load(args->at(i));
+      frame_->SpillTop();
     }

     // Push the name of the function on the frame.
@@ -2955,6 +2957,7 @@
         int arg_count = args->length();
         for (int i = 0; i < arg_count; i++) {
           Load(args->at(i));
+          frame_->SpillTop();
         }

         // Push the name of the function onto the frame.
@@ -8902,6 +8905,7 @@
   int arg_count = args->length();
   for (int i = 0; i < arg_count; i++) {
     Load(args->at(i));
+    frame_->SpillTop();
   }

   // Record the position for debugging purposes.
=======================================
--- /branches/bleeding_edge/src/x64/virtual-frame-x64.h Mon May 10 04:32:25 2010 +++ /branches/bleeding_edge/src/x64/virtual-frame-x64.h Tue May 18 04:19:34 2010
@@ -144,6 +144,9 @@
   // register spilled or no_reg if it was not possible to free any register
   // (ie, they all have frame-external references).
   Register SpillAnyRegister();
+
+  // Spill the top element of the frame to memory.
+  void SpillTop() { SpillElementAt(element_count() - 1); }

   // Sync the range of elements in [begin, end] with memory.
   void SyncRange(int begin, int end);

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

Reply via email to