Index: src/arm64/builtins-arm64.cc |
diff --git a/src/arm64/builtins-arm64.cc b/src/arm64/builtins-arm64.cc |
index 8297fc3e2bc4d92869a8b9b06c13ee06674355c2..e8ae45a9ba08342639963f1b6b2c60b3c28b5d65 100644 |
--- a/src/arm64/builtins-arm64.cc |
+++ b/src/arm64/builtins-arm64.cc |
@@ -1700,6 +1700,38 @@ void Builtins::Generate_Call(MacroAssembler* masm) { |
} |
+// static |
+void Builtins::Generate_PushArgsAndCall(MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- x0 : the number of arguments (not including the receiver) |
+ // -- x2 : 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. |
+ // -- x1 : the target to call (can be any Object). |
+ |
+ // Find the address of the last argument. |
+ __ add(x3, x0, Operand(1)); // Add one for receiver. |
+ __ lsl(x3, x3, kPointerSizeLog2); |
+ __ sub(x4, x2, x3); |
+ |
+ // Push the arguments. |
+ Label loop_header, loop_check; |
+ __ Mov(x5, jssp); |
+ __ Claim(x3, 1); |
+ __ B(&loop_check); |
+ __ Bind(&loop_header); |
+ // TODO(rmcilroy): Push two at a time once we ensure we keep stack aligned. |
+ __ Ldr(x3, MemOperand(x2, -kPointerSize, PostIndex)); |
+ __ Str(x3, MemOperand(x5, -kPointerSize, PreIndex)); |
+ __ Bind(&loop_check); |
+ __ Cmp(x2, x4); |
+ __ B(gt, &loop_header); |
+ |
+ // Call the target. |
+ __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
+} |
+ |
+ |
void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { |
ASM_LOCATION("Builtins::Generate_ArgumentsAdaptorTrampoline"); |
// ----------- S t a t e ------------- |