Index: src/full-codegen/mips64/full-codegen-mips64.cc |
diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc |
index 10528179134c176d544ba45438d893c790abd2d6..1e7ae09980c57ebeb2f523599295c502939ff6b3 100644 |
--- a/src/full-codegen/mips64/full-codegen-mips64.cc |
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc |
@@ -4082,6 +4082,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 a1. |
+ int const argc = args->length() - 2; |
+ __ ld(a1, MemOperand(sp, (argc + 1) * kPointerSize)); |
+ // Call the target. |
+ __ li(a0, Operand(argc)); |
+ __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
+ // Restore context register. |
+ __ ld(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
+ // Discard the function left on TOS. |
+ context()->DropAndPlug(1, v0); |
+} |
+ |
+ |
void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
DCHECK(args->length() >= 2); |
@@ -4107,7 +4127,7 @@ void FullCodeGenerator::EmitCallFunction(CallRuntime* expr) { |
__ bind(&runtime); |
__ push(v0); |
- __ CallRuntime(Runtime::kCall, args->length()); |
+ __ CallRuntime(Runtime::kCallFunction, args->length()); |
__ bind(&done); |
context()->Plug(v0); |