Changeset 157650 in webkit


Ignore:
Timestamp:
Oct 18, 2013 3:57:15 PM (11 years ago)
Author:
mark.lam@apple.com
Message:

Remove excess reserved space in ctiTrampoline frames for X86 and X86_64.
https://bugs.webkit.org/show_bug.cgi?id=123037.

Reviewed by Geoffrey Garen.

  • jit/JITStubsMSVC64.asm:
  • jit/JITStubsX86.h:
  • jit/JITStubsX86_64.h:
Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r157645 r157650  
     12013-10-18  Mark Lam  <mark.lam@apple.com>
     2
     3        Remove excess reserved space in ctiTrampoline frames for X86 and X86_64.
     4        https://bugs.webkit.org/show_bug.cgi?id=123037.
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        * jit/JITStubsMSVC64.asm:
     9        * jit/JITStubsX86.h:
     10        * jit/JITStubsX86_64.h:
     11
    1122013-10-18  Filip Pizlo  <fpizlo@apple.com>
    213
  • trunk/Source/JavaScriptCore/jit/JITStubsMSVC64.asm

    r157636 r157650  
    4747    push rbx
    4848
    49     ; Decrease rsp to point to the start of our JITStackFrame
    50     sub rsp, 58h
     49    ; JIT operations can use up to 6 args (4 in registers and 2 on the stack).
     50    ; In addition, X86_64 ABI specifies that the worse case stack alignment
     51    ; requirement is 32 bytes. Based on these factors, we need to pad the stack
     52    ; and additional 28h bytes.
     53    sub rsp, 28h
    5154    mov r12, 512
    5255    mov r14, 0FFFF000000000000h
     
    5457    mov r13, r8
    5558    call rcx
    56     add rsp, 58h
     59    add rsp, 28h
    5760    pop rbx
    5861    pop r15
     
    6568
    6669ctiOpThrowNotCaught PROC
    67     add rsp, 58h
     70    add rsp, 28h
    6871    pop rbx
    6972    pop r15
  • trunk/Source/JavaScriptCore/jit/JITStubsX86.h

    r157636 r157650  
    5656    "pushl %edi" "\n"
    5757    "pushl %ebx" "\n"
    58     "subl $0x3c, %esp" "\n"
    59     "movl 0x58(%esp), %edi" "\n"
    60     "call *0x50(%esp)" "\n"
    61     "addl $0x3c, %esp" "\n"
     58
     59    // JIT Operation can use up to 6 arguments right now. So, we need to
     60    // reserve space in this stack frame for the out-going args. To ensure that
     61    // the stack remains aligned on an 16 byte boundary, we round the padding up
     62    // by 0x1c bytes.
     63    "subl $0x1c, %esp" "\n"
     64    "movl 0x38(%esp), %edi" "\n"
     65    "call *0x30(%esp)" "\n"
     66    "addl $0x1c, %esp" "\n"
     67
    6268    "popl %ebx" "\n"
    6369    "popl %edi" "\n"
     
    7480HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
    7581SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
    76     "addl $0x3c, %esp" "\n"
     82    "addl $0x1c, %esp" "\n"
    7783    "popl %ebx" "\n"
    7884    "popl %edi" "\n"
     
    249255            push edi;
    250256            push ebx;
    251             sub esp, 0x3c;
     257            sub esp, 0x1c;
    252258            mov ecx, esp;
    253             mov edi, [esp + 0x58];
    254             call [esp + 0x50];
    255             add esp, 0x3c;
     259            mov edi, [esp + 0x38];
     260            call [esp + 0x30];
     261            add esp, 0x1c;
    256262            pop ebx;
    257263            pop edi;
     
    265271    {
    266272        __asm {
    267             add esp, 0x3c;
     273            add esp, 0x1c;
    268274            pop ebx;
    269275            pop edi;
  • trunk/Source/JavaScriptCore/jit/JITStubsX86_64.h

    r157636 r157650  
    5858    "pushq %r15" "\n"
    5959    "pushq %rbx" "\n"
    60     // Form the JIT stubs area
    61     "pushq %r9" "\n"
    62     "pushq %r8" "\n"
    63     "pushq %rcx" "\n"
    64     "pushq %rdx" "\n"
    65     "pushq %rsi" "\n"
    66     "pushq %rdi" "\n"
    67     "subq $0x48, %rsp" "\n"
     60
     61    // The X86_64 ABI specifies that the worse case stack alignment requirement
     62    // is 32 bytes.
     63    "subq $0x8, %rsp" "\n"
     64
    6865    "movq $512, %r12" "\n"
    6966    "movq $0xFFFF000000000000, %r14" "\n"
     
    7168    "movq %rdx, %r13" "\n"
    7269    "call *%rdi" "\n"
    73     "addq $0x78, %rsp" "\n"
     70    "addq $0x8, %rsp" "\n"
    7471    "popq %rbx" "\n"
    7572    "popq %r15" "\n"
     
    8885HIDE_SYMBOL(ctiOpThrowNotCaught) "\n"
    8986SYMBOL_STRING(ctiOpThrowNotCaught) ":" "\n"
    90     "addq $0x78, %rsp" "\n"
     87    "addq $0x8, %rsp" "\n"
    9188    "popq %rbx" "\n"
    9289    "popq %r15" "\n"
Note: See TracChangeset for help on using the changeset viewer.