Index: src/ia32/codegen-ia32.cc |
=================================================================== |
--- src/ia32/codegen-ia32.cc (revision 3473) |
+++ src/ia32/codegen-ia32.cc (working copy) |
@@ -4543,9 +4543,6 @@ |
// JavaScript example: 'foo(1, 2, 3)' // foo is global |
// ---------------------------------- |
- // Push the name of the function and the receiver onto the stack. |
- frame_->Push(var->name()); |
- |
// Pass the global object as the receiver and let the IC stub |
// patch the stack to use the global proxy as 'this' in the |
// invoked function. |
@@ -4557,14 +4554,16 @@ |
Load(args->at(i)); |
} |
+ // Push the name of the function onto the frame. |
+ frame_->Push(var->name()); |
+ |
// Call the IC initialization code. |
CodeForSourcePosition(node->position()); |
Result result = frame_->CallCallIC(RelocInfo::CODE_TARGET_CONTEXT, |
arg_count, |
loop_nesting()); |
frame_->RestoreContextRegister(); |
- // Replace the function on the stack with the result. |
- frame_->SetElementAt(0, &result); |
+ frame_->Push(&result); |
} else if (var != NULL && var->slot() != NULL && |
var->slot()->type() == Slot::LOOKUP) { |
@@ -4617,8 +4616,7 @@ |
node->position()); |
} else { |
- // Push the name of the function and the receiver onto the stack. |
- frame_->Push(name); |
+ // Push the receiver onto the frame. |
Load(property->obj()); |
// Load the arguments. |
@@ -4627,14 +4625,16 @@ |
Load(args->at(i)); |
} |
+ // Push the name of the function onto the frame. |
+ frame_->Push(name); |
+ |
// Call the IC initialization code. |
CodeForSourcePosition(node->position()); |
Result result = |
frame_->CallCallIC(RelocInfo::CODE_TARGET, arg_count, |
loop_nesting()); |
frame_->RestoreContextRegister(); |
- // Replace the function on the stack with the result. |
- frame_->SetElementAt(0, &result); |
+ frame_->Push(&result); |
} |
} else { |
@@ -5292,8 +5292,6 @@ |
Runtime::Function* function = node->function(); |
if (function == NULL) { |
- // Prepare stack for calling JS runtime function. |
- frame_->Push(node->name()); |
// Push the builtins object found in the current global object. |
Result temp = allocator()->Allocate(); |
ASSERT(temp.is_valid()); |
@@ -5310,11 +5308,12 @@ |
if (function == NULL) { |
// Call the JS runtime function. |
+ frame_->Push(node->name()); |
Result answer = frame_->CallCallIC(RelocInfo::CODE_TARGET, |
arg_count, |
loop_nesting_); |
frame_->RestoreContextRegister(); |
- frame_->SetElementAt(0, &answer); |
+ frame_->Push(&answer); |
} else { |
// Call the C runtime function. |
Result answer = frame_->CallRuntime(function, arg_count); |