Index: src/full-codegen/ia32/full-codegen-ia32.cc |
diff --git a/src/full-codegen/ia32/full-codegen-ia32.cc b/src/full-codegen/ia32/full-codegen-ia32.cc |
index 1f1c19e2d98698478fead6c2735bf53dd40cfe33..e47243aa2d216c2f125250b30cddce1140f2de38 100644 |
--- a/src/full-codegen/ia32/full-codegen-ia32.cc |
+++ b/src/full-codegen/ia32/full-codegen-ia32.cc |
@@ -3965,6 +3965,26 @@ void FullCodeGenerator::EmitStringAdd(CallRuntime* expr) { |
} |
+void FullCodeGenerator::EmitCall(CallRuntime* expr) { |
+ ZoneList<Expression*>* args = expr->arguments(); |
+ DCHECK_LE(2, args->length()); |
+ // Push target, receiver and arguments onto the stack. |
+ for (Expression* const arg : *args) { |
+ VisitForStackValue(arg); |
+ } |
+ // Move target to edi. |
+ int const argc = args->length() - 2; |
+ __ mov(edi, Operand(esp, (argc + 1) * kPointerSize)); |
+ // Call the target. |
+ __ mov(eax, Immediate(argc)); |
+ __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
+ // Restore context register. |
+ __ mov(esi, Operand(ebp, StandardFrameConstants::kContextOffset)); |
+ // Discard the function left on TOS. |
+ context()->DropAndPlug(1, eax); |
+} |
+ |
+ |
void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
DCHECK(args->length() >= 2); |
@@ -3990,7 +4010,7 @@ void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
__ bind(&runtime); |
__ push(eax); |
- __ CallRuntime(Runtime::kCall, args->length()); |
+ __ CallRuntime(Runtime::kCallFunction, args->length()); |
__ bind(&done); |
context()->Plug(eax); |