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
This commit is contained in:
whesse@chromium.org 2010-05-18 11:19:34 +00:00
parent b46757a4e1
commit cd6afbc617
4 changed files with 14 additions and 0 deletions

View File

@ -2981,6 +2981,7 @@ void CodeGenerator::CallWithArguments(ZoneList<Expression*>* 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.

View File

@ -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);

View File

@ -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<Expression*>* 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.

View File

@ -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);