Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index aeee584a1d4f3ec37e6b36f7f843251c6c5431f3..322bc2d4e8bf4d1216b8a07ffc59c8a7549bf0c5 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -3087,15 +3087,14 @@ void FullCodeGenerator::EmitMathSqrt(ZoneList<Expression*>* args) { |
void FullCodeGenerator::EmitCallFunction(ZoneList<Expression*>* args) { |
ASSERT(args->length() >= 2); |
- int arg_count = args->length() - 2; // For receiver and function. |
- VisitForStackValue(args->at(0)); // Receiver. |
- for (int i = 0; i < arg_count; i++) { |
- VisitForStackValue(args->at(i + 1)); |
+ int arg_count = args->length() - 2; // 2 ~ receiver and function. |
+ for (int i = 0; i < arg_count + 1; ++i) { |
+ VisitForStackValue(args->at(i)); |
} |
- VisitForAccumulatorValue(args->at(arg_count + 1)); // Function. |
+ VisitForAccumulatorValue(args->last()); // Function. |
- // InvokeFunction requires function in edi. Move it in there. |
- if (!result_register().is(edi)) __ mov(edi, result_register()); |
+ // InvokeFunction requires the function in edi. Move it in there. |
+ __ mov(edi, result_register()); |
ParameterCount count(arg_count); |
__ InvokeFunction(edi, count, CALL_FUNCTION); |
__ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |