Index: src/builtins/x64/builtins-x64.cc |
diff --git a/src/builtins/x64/builtins-x64.cc b/src/builtins/x64/builtins-x64.cc |
index 028a0f327b7ca182a29af7ba8febfb41a8e2750d..3b13fa7529dc10e4f23a270246002fe9c51d0773 100644 |
--- a/src/builtins/x64/builtins-x64.cc |
+++ b/src/builtins/x64/builtins-x64.cc |
@@ -830,7 +830,7 @@ void Builtins::Generate_InterpreterPushArgsAndCallImpl( |
__ PopReturnAddressTo(kScratchRegister); |
// TODO(mythria): Add a stack check before pushing arguments. |
- // rax is readonly rcx and r8 will be modified. |
+ // rax is readonly rbx and rcx will be modified. |
Generate_InterpreterPushArgs(masm, rax, rbx, rcx, true); |
// Call the target. |
@@ -893,6 +893,35 @@ void Builtins::Generate_InterpreterPushArgsAndConstructImpl( |
} |
} |
+// static |
+void Builtins::Generate_InterpreterPushArgsAndConstructArray( |
+ MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- rax : the number of arguments (not including the receiver) |
+ // -- rdx : the target to call checked to be Array function. |
+ // -- rbx : the allocation site feedback |
+ // -- rcx : the address of the first argument to be pushed. Subsequent |
+ // arguments should be consecutive above this, in the same order as |
+ // they are to be pushed onto the stack. |
+ // ----------------------------------- |
+ |
+ // Pop return address to allow tail-call after pushing arguments. |
+ __ PopReturnAddressTo(kScratchRegister); |
+ |
+ // TODO(mythria): Add a stack check before pushing arguments. |
+ // rax is readonly rcx and r8 will be modified. |
+ Generate_InterpreterPushArgs(masm, rax, rcx, r8, true); |
+ |
+ // Push return address in preparation for the tail-call. |
+ __ PushReturnAddressFrom(kScratchRegister); |
+ |
+ // Array constructor expects constructor in rdi. It is same as rdx here. |
+ __ Move(rdi, rdx); |
+ |
+ ArrayConstructorStub stub(masm->isolate()); |
+ __ TailCallStub(&stub); |
+} |
+ |
void Builtins::Generate_InterpreterEnterBytecodeDispatch(MacroAssembler* masm) { |
// Set the return address to the correct point in the interpreter entry |
// trampoline. |