Index: src/full-codegen/arm/full-codegen-arm.cc |
diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc |
index 24dc51608246b9210775e13be332ff905bd77c01..02363c17ce914876bf4f4752a521446b20256566 100644 |
--- a/src/full-codegen/arm/full-codegen-arm.cc |
+++ b/src/full-codegen/arm/full-codegen-arm.cc |
@@ -4056,6 +4056,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 r1. |
+ int const argc = args->length() - 2; |
+ __ ldr(r1, MemOperand(sp, (argc + 1) * kPointerSize)); |
+ // Call the target. |
+ __ mov(r0, Operand(argc)); |
+ __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
+ // Restore context register. |
+ __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ // Discard the function left on TOS. |
+ context()->DropAndPlug(1, r0); |
+} |
+ |
+ |
void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
DCHECK(args->length() >= 2); |
@@ -4081,7 +4101,7 @@ void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
__ bind(&runtime); |
__ push(r0); |
- __ CallRuntime(Runtime::kCall, args->length()); |
+ __ CallRuntime(Runtime::kCallFunction, args->length()); |
__ bind(&done); |
context()->Plug(r0); |