| Index: src/mips64/builtins-mips64.cc
|
| diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc
|
| index 9414628a37ec1d17b53375949a02f2c0aedd7a47..6ec462a7f8c95fee86c28f0a38607c2d19ecac18 100644
|
| --- a/src/mips64/builtins-mips64.cc
|
| +++ b/src/mips64/builtins-mips64.cc
|
| @@ -1375,51 +1375,7 @@ void Builtins::Generate_OsrAfterStackCheck(MacroAssembler* masm) {
|
|
|
|
|
| // static
|
| -void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
|
| - // 1. Make sure we have at least one argument.
|
| - // a0: actual number of arguments
|
| - {
|
| - Label done;
|
| - __ Branch(&done, ne, a0, Operand(zero_reg));
|
| - __ PushRoot(Heap::kUndefinedValueRootIndex);
|
| - __ Daddu(a0, a0, Operand(1));
|
| - __ bind(&done);
|
| - }
|
| -
|
| - // 2. Get the function to call (passed as receiver) from the stack.
|
| - // a0: actual number of arguments
|
| - __ dsll(at, a0, kPointerSizeLog2);
|
| - __ daddu(at, sp, at);
|
| - __ ld(a1, MemOperand(at));
|
| -
|
| - // 3. Shift arguments and return address one slot down on the stack
|
| - // (overwriting the original receiver). Adjust argument count to make
|
| - // the original first argument the new receiver.
|
| - // a0: actual number of arguments
|
| - // a1: function
|
| - {
|
| - Label loop;
|
| - // Calculate the copy start address (destination). Copy end address is sp.
|
| - __ dsll(at, a0, kPointerSizeLog2);
|
| - __ daddu(a2, sp, at);
|
| -
|
| - __ bind(&loop);
|
| - __ ld(at, MemOperand(a2, -kPointerSize));
|
| - __ sd(at, MemOperand(a2));
|
| - __ Dsubu(a2, a2, Operand(kPointerSize));
|
| - __ Branch(&loop, ne, a2, Operand(sp));
|
| - // Adjust the actual number of arguments and remove the top element
|
| - // (which is a copy of the last argument).
|
| - __ Dsubu(a0, a0, Operand(1));
|
| - __ Pop();
|
| - }
|
| -
|
| - // 4. Call the callable.
|
| - __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
|
| -}
|
| -
|
| -
|
| -void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
|
| +void Builtins::Generate_FunctionPrototypeApply(MacroAssembler* masm) {
|
| // ----------- S t a t e -------------
|
| // -- a0 : argc
|
| // -- sp[0] : argArray
|
| @@ -1491,6 +1447,51 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
|
| }
|
|
|
|
|
| +// static
|
| +void Builtins::Generate_FunctionPrototypeCall(MacroAssembler* masm) {
|
| + // 1. Make sure we have at least one argument.
|
| + // a0: actual number of arguments
|
| + {
|
| + Label done;
|
| + __ Branch(&done, ne, a0, Operand(zero_reg));
|
| + __ PushRoot(Heap::kUndefinedValueRootIndex);
|
| + __ Daddu(a0, a0, Operand(1));
|
| + __ bind(&done);
|
| + }
|
| +
|
| + // 2. Get the function to call (passed as receiver) from the stack.
|
| + // a0: actual number of arguments
|
| + __ dsll(at, a0, kPointerSizeLog2);
|
| + __ daddu(at, sp, at);
|
| + __ ld(a1, MemOperand(at));
|
| +
|
| + // 3. Shift arguments and return address one slot down on the stack
|
| + // (overwriting the original receiver). Adjust argument count to make
|
| + // the original first argument the new receiver.
|
| + // a0: actual number of arguments
|
| + // a1: function
|
| + {
|
| + Label loop;
|
| + // Calculate the copy start address (destination). Copy end address is sp.
|
| + __ dsll(at, a0, kPointerSizeLog2);
|
| + __ daddu(a2, sp, at);
|
| +
|
| + __ bind(&loop);
|
| + __ ld(at, MemOperand(a2, -kPointerSize));
|
| + __ sd(at, MemOperand(a2));
|
| + __ Dsubu(a2, a2, Operand(kPointerSize));
|
| + __ Branch(&loop, ne, a2, Operand(sp));
|
| + // Adjust the actual number of arguments and remove the top element
|
| + // (which is a copy of the last argument).
|
| + __ Dsubu(a0, a0, Operand(1));
|
| + __ Pop();
|
| + }
|
| +
|
| + // 4. Call the callable.
|
| + __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
|
| +}
|
| +
|
| +
|
| void Builtins::Generate_ReflectApply(MacroAssembler* masm) {
|
| // ----------- S t a t e -------------
|
| // -- a0 : argc
|
|
|