Commit 3f2fe534 authored by dslomov@chromium.org's avatar dslomov@chromium.org

Fix x64 frame size to accomodate saved XMM registers

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/13881016

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14312 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 02f85aed
......@@ -4272,10 +4272,6 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
Label invoke, handler_entry, exit;
Label not_outermost_js, not_outermost_js_2;
#ifdef _WIN64
const int kCalleeSaveXMMRegisters = 10;
const int kFullXMMRegisterSize = 16;
#endif
{ // NOLINT. Scope block confuses linter.
MacroAssembler::NoRootArrayScope uninitialized_root_register(masm);
// Set up frame.
......@@ -4305,17 +4301,17 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
#ifdef _WIN64
// On Win64 XMM6-XMM15 are callee-save
__ subq(rsp, Immediate(kCalleeSaveXMMRegisters * kFullXMMRegisterSize));
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 0), xmm6);
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 1), xmm7);
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 2), xmm8);
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 3), xmm9);
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 4), xmm10);
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 5), xmm11);
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 6), xmm12);
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 7), xmm13);
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 8), xmm14);
__ movdqu(Operand(rsp, kFullXMMRegisterSize * 9), xmm15);
__ subq(rsp, Immediate(EntryFrameConstants::kXMMRegistersBlockSize));
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 0), xmm6);
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 1), xmm7);
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 2), xmm8);
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 3), xmm9);
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 4), xmm10);
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 5), xmm11);
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 6), xmm12);
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 7), xmm13);
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 8), xmm14);
__ movdqu(Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 9), xmm15);
#endif
// Set up the roots and smi constant registers.
......@@ -4408,17 +4404,17 @@ void JSEntryStub::GenerateBody(MacroAssembler* masm, bool is_construct) {
// Restore callee-saved registers (X64 conventions).
#ifdef _WIN64
// On Win64 XMM6-XMM15 are callee-save
__ movdqu(xmm6, Operand(rsp, kFullXMMRegisterSize * 0));
__ movdqu(xmm7, Operand(rsp, kFullXMMRegisterSize * 1));
__ movdqu(xmm8, Operand(rsp, kFullXMMRegisterSize * 2));
__ movdqu(xmm8, Operand(rsp, kFullXMMRegisterSize * 3));
__ movdqu(xmm10, Operand(rsp, kFullXMMRegisterSize * 4));
__ movdqu(xmm11, Operand(rsp, kFullXMMRegisterSize * 5));
__ movdqu(xmm12, Operand(rsp, kFullXMMRegisterSize * 6));
__ movdqu(xmm13, Operand(rsp, kFullXMMRegisterSize * 7));
__ movdqu(xmm14, Operand(rsp, kFullXMMRegisterSize * 8));
__ movdqu(xmm15, Operand(rsp, kFullXMMRegisterSize * 9));
__ addq(rsp, Immediate(kCalleeSaveXMMRegisters * kFullXMMRegisterSize));
__ movdqu(xmm6, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 0));
__ movdqu(xmm7, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 1));
__ movdqu(xmm8, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 2));
__ movdqu(xmm8, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 3));
__ movdqu(xmm10, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 4));
__ movdqu(xmm11, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 5));
__ movdqu(xmm12, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 6));
__ movdqu(xmm13, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 7));
__ movdqu(xmm14, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 8));
__ movdqu(xmm15, Operand(rsp, EntryFrameConstants::kXMMRegisterSize * 9));
__ addq(rsp, Immediate(EntryFrameConstants::kXMMRegistersBlockSize));
#endif
__ pop(rbx);
......
......@@ -51,7 +51,12 @@ const int kNumSafepointRegisters = 16;
class EntryFrameConstants : public AllStatic {
public:
#ifdef _WIN64
static const int kCallerFPOffset = -10 * kPointerSize;
static const int kCalleeSaveXMMRegisters = 10;
static const int kXMMRegisterSize = 16;
static const int kXMMRegistersBlockSize =
kXMMRegisterSize * kCalleeSaveXMMRegisters;
static const int kCallerFPOffset =
-10 * kPointerSize - kXMMRegistersBlockSize;
#else
static const int kCallerFPOffset = -8 * kPointerSize;
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment