Index: src/mips64/builtins-mips64.cc |
diff --git a/src/mips64/builtins-mips64.cc b/src/mips64/builtins-mips64.cc |
index 99701a0d85c7660db8ab10efb1f4ed1b7f8cedf6..b00ba88da42d8bdf9d080a068478f137c764b6af 100644 |
--- a/src/mips64/builtins-mips64.cc |
+++ b/src/mips64/builtins-mips64.cc |
@@ -982,6 +982,7 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
// arguments should be consecutive above this, in the same order as |
// they are to be pushed onto the stack. |
// -- a1 : the target to call (can be any Object). |
+ // ----------------------------------- |
// Find the address of the last argument. |
__ Daddu(a3, a0, Operand(1)); // Add one for receiver. |
@@ -1003,6 +1004,37 @@ void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
} |
+// static |
+void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- a0 : argument count (not including receiver) |
+ // -- a3 : original constructor |
+ // -- a1 : constructor to call |
+ // -- a2 : address of the first argument |
+ // ----------------------------------- |
+ |
+ // Find the address of the last argument. |
+ __ dsll(t0, a0, kPointerSizeLog2); |
+ __ Dsubu(t0, a2, Operand(t0)); |
+ |
+ // Push a slot for the receiver. |
+ __ push(zero_reg); |
+ |
+ // Push the arguments. |
+ Label loop_header, loop_check; |
+ __ Branch(&loop_check); |
+ __ bind(&loop_header); |
+ __ ld(t1, MemOperand(a2)); |
+ __ Daddu(a2, a2, Operand(-kPointerSize)); |
+ __ push(t1); |
+ __ bind(&loop_check); |
+ __ Branch(&loop_header, gt, a2, Operand(t0)); |
+ |
+ // Call the constructor with a0, a1, and a3 unmodified. |
+ __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL); |
+} |
+ |
+ |
void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
GenerateTailCallToReturnedCode(masm); |