Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 3a9a0234e2e8ed1d1f511687c6f26a493aef21f3..aba2a3835555f379ca5eb5b7ce9b011604e4c594 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -30,6 +30,7 @@ |
#if defined(V8_TARGET_ARCH_X64) |
#include "bootstrapper.h" |
+#include "builtins-decls.h" |
#include "code-stubs.h" |
#include "regexp-macro-assembler.h" |
#include "stub-cache.h" |
@@ -4106,22 +4107,23 @@ void CEntryStub::GenerateCore(MacroAssembler* masm, |
// Call C function. |
#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(StackSpaceOperand(0), r14); // argc. |
- __ movq(StackSpaceOperand(1), r15); // argv. |
+ // Windows 64-bit ABI passes arguments in rcx, rdx, r8, r9. |
+ // Pass argv and argc as two parameters. The arguments object will |
+ // be created by stubs declared by DECLARE_RUNTIME_FUNCTION(). |
if (result_size_ < 2) { |
// Pass a pointer to the Arguments object as the first argument. |
// Return result in single register (rax). |
- __ lea(rcx, StackSpaceOperand(0)); |
- __ LoadAddress(rdx, ExternalReference::isolate_address(masm->isolate())); |
+ __ movq(rcx, r14); // argc. |
+ __ movq(rdx, r15); // argv. |
+ __ movq(r8, ExternalReference::isolate_address(masm->isolate())); |
} else { |
ASSERT_EQ(2, result_size_); |
// Pass a pointer to the result location as the first argument. |
__ lea(rcx, StackSpaceOperand(2)); |
// Pass a pointer to the Arguments object as the second argument. |
- __ lea(rdx, StackSpaceOperand(0)); |
- __ LoadAddress(r8, ExternalReference::isolate_address(masm->isolate())); |
+ __ movq(rdx, r14); // argc. |
+ __ movq(r8, r15); // argv. |
+ __ movq(r9, ExternalReference::isolate_address(masm->isolate())); |
} |
#else // _WIN64 |