Ignore:
Timestamp:
Apr 18, 2013, 3:11:22 AM (12 years ago)
Author:
[email protected]
Message:

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

Patch by Jonathan Liu <[email protected]> on 2013-04-18
Reviewed by Jocelyn Turcotte.

  • jit/JITStubs.cpp:

(JSC):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jit/JITStubs.cpp

    r148639 r148663  
    372372#else // USE(JSVALUE32_64)
    373373
    374 #if COMPILER(GCC) && CPU(X86_64)
     374#if COMPILER(GCC) && CPU(X86_64) && !OS(WINDOWS)
    375375
    376376// These ASSERTs remind you that, if you change the layout of JITStackFrame, you
     
    432432SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
    433433    "addq $0x78, %rsp" "\n"
     434    "popq %rbx" "\n"
     435    "popq %r15" "\n"
     436    "popq %r14" "\n"
     437    "popq %r13" "\n"
     438    "popq %r12" "\n"
     439    "popq %rbp" "\n"
     440    "ret" "\n"
     441);
     442
     443#elif COMPILER(GCC) && CPU(X86_64) && OS(WINDOWS)
     444
     445// These ASSERTs remind you that, if you change the layout of JITStackFrame, you
     446// need to change the assembly trampolines below to match.
     447COMPILE_ASSERT(offsetof(struct JITStackFrame, code) % 16 == 0x0, JITStackFrame_maintains_16byte_stack_alignment);
     448COMPILE_ASSERT(offsetof(struct JITStackFrame, savedRBX) == 0x58, JITStackFrame_stub_argument_space_matches_ctiTrampoline);
     449
     450asm (
     451".text\n"
     452".globl " SYMBOL_STRING(ctiTrampoline) "\n"
     453HIDE_SYMBOL(ctiTrampoline) "\n"
     454SYMBOL_STRING(ctiTrampoline) ":" "\n"
     455    // Dump register parameters to their home address
     456    "movq %r9, 0x20(%rsp)" "\n"
     457    "movq %r8, 0x18(%rsp)" "\n"
     458    "movq %rdx, 0x10(%rsp)" "\n"
     459    "movq %rcx, 0x8(%rsp)" "\n"
     460
     461    "pushq %rbp" "\n"
     462    "movq %rsp, %rbp" "\n"
     463    "pushq %r12" "\n"
     464    "pushq %r13" "\n"
     465    "pushq %r14" "\n"
     466    "pushq %r15" "\n"
     467    "pushq %rbx" "\n"
     468
     469    // Decrease rsp to point to the start of our JITStackFrame
     470    "subq $0x58, %rsp" "\n"
     471    "movq $512, %r12" "\n"
     472    "movq $0xFFFF000000000000, %r14" "\n"
     473    "movq $0xFFFF000000000002, %r15" "\n"
     474    "movq %r8, %r13" "\n"
     475    "call *%rcx" "\n"
     476    "addq $0x58, %rsp" "\n"
     477    "popq %rbx" "\n"
     478    "popq %r15" "\n"
     479    "popq %r14" "\n"
     480    "popq %r13" "\n"
     481    "popq %r12" "\n"
     482    "popq %rbp" "\n"
     483    "ret" "\n"
     484".globl " SYMBOL_STRING(ctiTrampolineEnd) "\n"
     485HIDE_SYMBOL(ctiTrampolineEnd) "\n"
     486SYMBOL_STRING(ctiTrampolineEnd) ":" "\n"
     487);
     488
     489asm (
     490".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
     491HIDE_SYMBOL(ctiVMThrowTrampoline) "\n"
     492SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
     493    "movq %rsp, %rcx" "\n"
     494    "call " LOCAL_REFERENCE(cti_vm_throw) "\n"
     495    "int3" "\n"
     496);
     497
     498asm (
     499".globl " SYMBOL_STRING(ctiOpThrowNotCaught) "\n"
     500HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
     501SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
     502    "addq $0x58, %rsp" "\n"
    434503    "popq %rbx" "\n"
    435504    "popq %r15" "\n"
Note: See TracChangeset for help on using the changeset viewer.