diff options
author | Jonathan Liu <net147@gmail.com> | 2013-04-18 10:11:22 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-04-19 00:59:32 +0200 |
commit | 018937c7ba8b9afb85b8ae7ccb2aba438768cdf5 (patch) | |
tree | 17545571bbde0aad8c5fae329230a8db4e850535 /Source/JavaScriptCore/jit | |
parent | 3e1f0e71779c6eb8ff2ba3dd2d68a4a675419fff (diff) | |
download | qtwebkit-018937c7ba8b9afb85b8ae7ccb2aba438768cdf5.tar.gz |
Implement JIT for MinGW-w64 64-bit
https://bugs.webkit.org/show_bug.cgi?id=114580
Reviewed by Jocelyn Turcotte.
* jit/JITStubs.cpp:
(JSC):
Change-Id: Ibdda0a09ba3db010bbd7858b745834dff2d92260
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@148663 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/jit')
-rw-r--r-- | Source/JavaScriptCore/jit/JITStubs.cpp | 71 |
1 files changed, 70 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/jit/JITStubs.cpp b/Source/JavaScriptCore/jit/JITStubs.cpp index eca0fb079..64acfeef5 100644 --- a/Source/JavaScriptCore/jit/JITStubs.cpp +++ b/Source/JavaScriptCore/jit/JITStubs.cpp @@ -364,7 +364,7 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" #else // USE(JSVALUE32_64) -#if COMPILER(GCC) && CPU(X86_64) +#if COMPILER(GCC) && CPU(X86_64) && !OS(WINDOWS) // These ASSERTs remind you that, if you change the layout of JITStackFrame, you // need to change the assembly trampolines below to match. @@ -433,6 +433,75 @@ SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" "ret" "\n" ); +#elif COMPILER(GCC) && CPU(X86_64) && OS(WINDOWS) + +// These ASSERTs remind you that, if you change the layout of JITStackFrame, you +// need to change the assembly trampolines below to match. +COMPILE_ASSERT(offsetof(struct JITStackFrame, code) % 16 == 0x0, JITStackFrame_maintains_16byte_stack_alignment); +COMPILE_ASSERT(offsetof(struct JITStackFrame, savedRBX) == 0x58, JITStackFrame_stub_argument_space_matches_ctiTrampoline); + +asm ( +".text\n" +".globl " SYMBOL_STRING(ctiTrampoline) "\n" +HIDE_SYMBOL(ctiTrampoline) "\n" +SYMBOL_STRING(ctiTrampoline) ":" "\n" + // Dump register parameters to their home address + "movq %r9, 0x20(%rsp)" "\n" + "movq %r8, 0x18(%rsp)" "\n" + "movq %rdx, 0x10(%rsp)" "\n" + "movq %rcx, 0x8(%rsp)" "\n" + + "pushq %rbp" "\n" + "movq %rsp, %rbp" "\n" + "pushq %r12" "\n" + "pushq %r13" "\n" + "pushq %r14" "\n" + "pushq %r15" "\n" + "pushq %rbx" "\n" + + // Decrease rsp to point to the start of our JITStackFrame + "subq $0x58, %rsp" "\n" + "movq $512, %r12" "\n" + "movq $0xFFFF000000000000, %r14" "\n" + "movq $0xFFFF000000000002, %r15" "\n" + "movq %r8, %r13" "\n" + "call *%rcx" "\n" + "addq $0x58, %rsp" "\n" + "popq %rbx" "\n" + "popq %r15" "\n" + "popq %r14" "\n" + "popq %r13" "\n" + "popq %r12" "\n" + "popq %rbp" "\n" + "ret" "\n" +".globl " SYMBOL_STRING(ctiTrampolineEnd) "\n" +HIDE_SYMBOL(ctiTrampolineEnd) "\n" +SYMBOL_STRING(ctiTrampolineEnd) ":" "\n" +); + +asm ( +".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n" +HIDE_SYMBOL(ctiVMThrowTrampoline) "\n" +SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n" + "movq %rsp, %rcx" "\n" + "call " LOCAL_REFERENCE(cti_vm_throw) "\n" + "int3" "\n" +); + +asm ( +".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n" +HIDE_SYMBOL(ctiOpThrowNotCaught) "\n" +SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n" + "addq $0x58, %rsp" "\n" + "popq %rbx" "\n" + "popq %r15" "\n" + "popq %r14" "\n" + "popq %r13" "\n" + "popq %r12" "\n" + "popq %rbp" "\n" + "ret" "\n" +); + #elif COMPILER(MSVC) && CPU(X86_64) // These ASSERTs remind you that, if you change the layout of JITStackFrame, you |