From: whesse@chromium.org Date: Tue, 18 May 2010 11:19:34 +0000 (+0000) Subject: Spill arguments for a function call from the virtual frame as they are produced. X-Git-Tag: upstream/4.7.83~21791 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd6afbc617c22cc021e28bfad2ad5c0611deede8;p=platform%2Fupstream%2Fv8.git Spill arguments for a function call from the virtual frame as they are produced. Review URL: http://codereview.chromium.org/2103007 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4671 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/ia32/codegen-ia32.cc b/src/ia32/codegen-ia32.cc index 4364cb4..82d83da 100644 --- a/src/ia32/codegen-ia32.cc +++ b/src/ia32/codegen-ia32.cc @@ -2981,6 +2981,7 @@ void CodeGenerator::CallWithArguments(ZoneList* args, 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 @@ void CodeGenerator::VisitCall(Call* node) { 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 @@ void CodeGenerator::VisitCall(Call* node) { 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 @@ void CodeGenerator::VisitCall(Call* node) { 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. diff --git a/src/ia32/virtual-frame-ia32.h b/src/ia32/virtual-frame-ia32.h index 51a802c..129e0fa 100644 --- a/src/ia32/virtual-frame-ia32.h +++ b/src/ia32/virtual-frame-ia32.h @@ -144,6 +144,9 @@ class VirtualFrame: public ZoneObject { // (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); diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc index 8c67d0f..50e5aa1 100644 --- a/src/x64/codegen-x64.cc +++ b/src/x64/codegen-x64.cc @@ -2801,6 +2801,7 @@ void CodeGenerator::VisitCall(Call* node) { 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 @@ void CodeGenerator::VisitCall(Call* node) { 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 @@ void CodeGenerator::VisitCall(Call* node) { 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 @@ void CodeGenerator::CallWithArguments(ZoneList* args, 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. diff --git a/src/x64/virtual-frame-x64.h b/src/x64/virtual-frame-x64.h index 529f47a..81d49b0 100644 --- a/src/x64/virtual-frame-x64.h +++ b/src/x64/virtual-frame-x64.h @@ -145,6 +145,9 @@ class VirtualFrame : public ZoneObject { // (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);