Index: src/x64/code-stubs-x64.cc |
=================================================================== |
--- src/x64/code-stubs-x64.cc (revision 5829) |
+++ src/x64/code-stubs-x64.cc (working copy) |
@@ -2535,18 +2535,18 @@ |
#ifdef _WIN64 |
// Windows 64-bit ABI passes arguments in rcx, rdx, r8, r9 |
// Store Arguments object on stack, below the 4 WIN64 ABI parameter slots. |
- __ movq(Operand(rsp, 4 * kPointerSize), r14); // argc. |
- __ movq(Operand(rsp, 5 * kPointerSize), r12); // argv. |
+ __ movq(StackSpaceOperand(0), r14); // argc. |
+ __ movq(StackSpaceOperand(1), r12); // argv. |
if (result_size_ < 2) { |
// Pass a pointer to the Arguments object as the first argument. |
// Return result in single register (rax). |
- __ lea(rcx, Operand(rsp, 4 * kPointerSize)); |
+ __ lea(rcx, StackSpaceOperand(0)); |
} else { |
ASSERT_EQ(2, result_size_); |
// Pass a pointer to the result location as the first argument. |
- __ lea(rcx, Operand(rsp, 6 * kPointerSize)); |
+ __ lea(rcx, StackSpaceOperand(2)); |
// Pass a pointer to the Arguments object as the second argument. |
- __ lea(rdx, Operand(rsp, 4 * kPointerSize)); |
+ __ lea(rdx, StackSpaceOperand(0)); |
} |
#else // _WIN64 |
@@ -2686,7 +2686,12 @@ |
// builtin once. |
// Enter the exit frame that transitions from JavaScript to C++. |
- __ EnterExitFrame(result_size_); |
+#ifdef _WIN64 |
+ int arg_stack_space = (result_size_ < 2 ? 2 : 4); |
+#else |
+ int arg_stack_space = 0; |
+#endif |
+ __ EnterExitFrame(arg_stack_space); |
// rax: Holds the context at this point, but should not be used. |
// On entry to code generated by GenerateCore, it must hold |