Title: [148663] trunk/Source/_javascript_Core
Revision
148663
Author
commit-qu...@webkit.org
Date
2013-04-18 03:11:22 -0700 (Thu, 18 Apr 2013)

Log Message

Implement JIT for MinGW-w64 64-bit
https://bugs.webkit.org/show_bug.cgi?id=114580

Patch by Jonathan Liu <net...@gmail.com> on 2013-04-18
Reviewed by Jocelyn Turcotte.

* jit/JITStubs.cpp:
(JSC):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (148662 => 148663)


--- trunk/Source/_javascript_Core/ChangeLog	2013-04-18 09:47:36 UTC (rev 148662)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-04-18 10:11:22 UTC (rev 148663)
@@ -1,3 +1,13 @@
+2013-04-18  Jonathan Liu  <net...@gmail.com>
+
+        Implement JIT for MinGW-w64 64-bit
+        https://bugs.webkit.org/show_bug.cgi?id=114580
+
+        Reviewed by Jocelyn Turcotte.
+
+        * jit/JITStubs.cpp:
+        (JSC):
+
 2013-04-17  Mark Lam  <mark....@apple.com>
 
         Avoid using a branch range that is too far for some CPU architectures.

Modified: trunk/Source/_javascript_Core/jit/JITStubs.cpp (148662 => 148663)


--- trunk/Source/_javascript_Core/jit/JITStubs.cpp	2013-04-18 09:47:36 UTC (rev 148662)
+++ trunk/Source/_javascript_Core/jit/JITStubs.cpp	2013-04-18 10:11:22 UTC (rev 148663)
@@ -371,7 +371,7 @@
 
 #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.
@@ -440,6 +440,75 @@
     "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
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to