Index: src/ia32/codegen-ia32.cc |
=================================================================== |
--- src/ia32/codegen-ia32.cc (revision 3528) |
+++ src/ia32/codegen-ia32.cc (working copy) |
@@ -4580,23 +4580,20 @@ |
frame_->Push(Factory::undefined_value()); |
} |
+ // Push the receiver. |
+ frame_->PushParameterAt(-1); |
+ |
// Resolve the call. |
Result result = |
- frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 2); |
+ frame_->CallRuntime(Runtime::kResolvePossiblyDirectEval, 3); |
- // Touch up the stack with the right values for the function and the |
- // receiver. Use a scratch register to avoid destroying the result. |
- Result scratch = allocator_->Allocate(); |
- ASSERT(scratch.is_valid()); |
- __ mov(scratch.reg(), FieldOperand(result.reg(), FixedArray::kHeaderSize)); |
- frame_->SetElementAt(arg_count + 1, &scratch); |
+ // The runtime call returns a pair of values in eax (function) and |
+ // edx (receiver). Touch up the stack with the right values. |
+ Result receiver = allocator_->Allocate(edx); |
+ frame_->SetElementAt(arg_count + 1, &result); |
+ frame_->SetElementAt(arg_count, &receiver); |
+ receiver.Unuse(); |
- // We can reuse the result register now. |
- frame_->Spill(result.reg()); |
- __ mov(result.reg(), |
- FieldOperand(result.reg(), FixedArray::kHeaderSize + kPointerSize)); |
- frame_->SetElementAt(arg_count, &result); |
- |
// Call the function. |
CodeForSourcePosition(node->position()); |
InLoopFlag in_loop = loop_nesting() > 0 ? IN_LOOP : NOT_IN_LOOP; |