diff options
author | Erik Verbruggen <erik.verbruggen@digia.com> | 2013-07-03 15:36:47 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-03 15:56:52 +0200 |
commit | f525532363449f1e766f145ded01d635a368ab4a (patch) | |
tree | fe846a8655c463f3392b4f24ee75a1228539a59b | |
parent | 181a174118e9405fe567262ce67f524b850db488 (diff) |
JIT: support WIN64
Change-Id: Id657831231ddec66f7d41f32aaac22a71c4c1673
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
-rw-r--r-- | src/3rdparty/masm/masm-defs.pri | 2 | ||||
-rw-r--r-- | 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<argumentNumber>(value); +#else // Sanity: loadArgumentOnStack<argumentNumber - RegisterArgumentCount>(value); +#endif } template <int argumentNumber> @@ -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); |