Index: src/builtins/arm/builtins-arm.cc |
diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc |
index 5765f64484ec92129e3984513a3893cd4f157578..17274ee5ac3b552803eb9244fd1321643a4253c9 100644 |
--- a/src/builtins/arm/builtins-arm.cc |
+++ b/src/builtins/arm/builtins-arm.cc |
@@ -1249,6 +1249,32 @@ void Builtins::Generate_InterpreterPushArgsAndConstructImpl( |
} |
} |
+// static |
+void Builtins::Generate_InterpreterPushArgsAndConstructArray( |
+ MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- r0 : argument count (not including receiver) |
+ // -- r1 : target to call verified to be Array function |
+ // -- r2 : allocation site feedback if available, undefined otherwise. |
+ // -- r3 : address of the first argument |
+ // ----------------------------------- |
+ |
+ // Find the address of the last argument. |
+ __ add(r4, r0, Operand(1)); // Add one for receiver. |
+ __ mov(r4, Operand(r4, LSL, kPointerSizeLog2)); |
+ __ sub(r4, r3, r4); |
+ |
+ // TODO(mythria): Add a stack check before pushing arguments. |
+ // Push the arguments. |
+ Generate_InterpreterPushArgs(masm, r3, r4, r5); |
+ |
+ // Array constructor expects constructor in r3. It is same as r1 here. |
+ __ mov(r3, r1); |
+ |
+ 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. |