From f525532363449f1e766f145ded01d635a368ab4a Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Wed, 3 Jul 2013 15:36:47 +0200 Subject: JIT: support WIN64 Change-Id: Id657831231ddec66f7d41f32aaac22a71c4c1673 Reviewed-by: Simon Hausmann --- src/3rdparty/masm/masm-defs.pri | 2 +- src/qml/qml/v4/qv4isel_masm_p.h | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/masm/masm-defs.pri b/src/3rdparty/masm/masm-defs.pri index 255c490fd7..b349f5a79c 100644 --- a/src/3rdparty/masm/masm-defs.pri +++ b/src/3rdparty/masm/masm-defs.pri @@ -1,4 +1,4 @@ -!ios:!if(win*:isEqual(QT_ARCH, "x86_64")): DEFINES += V4_ENABLE_JIT +!ios: DEFINES += V4_ENABLE_JIT DEFINES += WTF_EXPORT_PRIVATE="" JS_EXPORT_PRIVATE="" diff --git a/src/qml/qml/v4/qv4isel_masm_p.h b/src/qml/qml/v4/qv4isel_masm_p.h index b0ba22dbfd..bef577a90e 100644 --- a/src/qml/qml/v4/qv4isel_masm_p.h +++ b/src/qml/qml/v4/qv4isel_masm_p.h @@ -98,6 +98,7 @@ public: // Return address is pushed onto stack by the CPU. static const int StackSpaceAllocatedUponFunctionEntry = RegisterSize; + static const int StackShadowSpace = 0; inline void platformEnterStandardStackFrame() {} inline void platformLeaveStandardStackFrame() {} #elif CPU(X86_64) @@ -118,6 +119,21 @@ public: static const int RegisterSize = 8; +#if OS(WINDOWS) + static const int RegisterArgumentCount = 4; + static RegisterID registerForArgument(int index) + { + static RegisterID regs[RegisterArgumentCount] = { + JSC::X86Registers::ecx, + JSC::X86Registers::edx, + JSC::X86Registers::r8, + JSC::X86Registers::r9 + }; + assert(index >= 0 && index < RegisterArgumentCount); + return regs[index]; + }; + static const int StackShadowSpace = 32; +#else // Unix static const int RegisterArgumentCount = 6; static RegisterID registerForArgument(int index) { @@ -132,6 +148,8 @@ public: assert(index >= 0 && index < RegisterArgumentCount); return regs[index]; }; + static const int StackShadowSpace = 0; +#endif // Return address is pushed onto stack by the CPU. static const int StackSpaceAllocatedUponFunctionEntry = RegisterSize; @@ -169,6 +187,7 @@ public: // Registers saved in platformEnterStandardStackFrame below. static const int StackSpaceAllocatedUponFunctionEntry = 5 * RegisterSize; + static const int StackShadowSpace = 0; inline void platformEnterStandardStackFrame() { // Move the register arguments onto the stack as if they were @@ -473,7 +492,11 @@ public: if (argumentNumber < RegisterArgumentCount) loadArgumentInRegister(value, registerForArgument(argumentNumber)); else +#if OS(WINDOWS) && CPU(X86_64) + loadArgumentOnStack(value); +#else // Sanity: loadArgumentOnStack(value); +#endif } template @@ -515,7 +538,8 @@ public: + SizeOnStack<2, Arg3>::Size + SizeOnStack<3, Arg4>::Size + SizeOnStack<4, Arg5>::Size - + SizeOnStack<5, Arg6>::Size; + + SizeOnStack<5, Arg6>::Size + + StackShadowSpace; if (stackSpaceNeeded) { stackSpaceNeeded = WTF::roundUpToMultipleOf(StackAlignment, stackSpaceNeeded); -- cgit v1.2.3