Ignore:
Timestamp:
May 7, 2009, 4:33:00 PM (16 years ago)
Author:
[email protected]
Message:

2009-05-07 Geoffrey Garen <[email protected]>

Reviewed by Cameron Zwarich.


Replaced two more macros with references to the JITStackFrame structure.

  • jit/JIT.cpp: (JSC::JIT::privateCompileMainPass):
  • jit/JITInlineMethods.h: (JSC::JIT::restoreArgumentReference):
  • jit/JITStubs.cpp: (JSC::):
  • jit/JITStubs.h:
File:
1 edited

Legend:

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

    r43362 r43374  
    6666#if COMPILER(GCC) && PLATFORM(X86)
    6767
    68 COMPILE_ASSERT(STUB_ARGS_code == 0x0C, STUB_ARGS_code_is_0x0C);
    69 COMPILE_ASSERT(STUB_ARGS_callFrame == 0x0E, STUB_ARGS_callFrame_is_0x0E);
     68// These ASSERTs remind you that, if you change the layout of JITStackFrame, you
     69// need to change the assembly trampolines below to match.
     70COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x38, JITStackFrame_callFrame_offset_matches_ctiTrampoline);
     71COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x30, JITStackFrame_code_offset_matches_ctiTrampoline);
     72COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x1c, JITStackFrame_stub_argument_space_matches_ctiTrampoline);
    7073
    7174#if PLATFORM(DARWIN)
     
    8588    "subl $0x1c, %esp" "\n"
    8689    "movl $512, %esi" "\n"
    87     "movl 0x38(%esp), %edi" "\n" // Ox38 = 0x0E * 4, 0x0E = STUB_ARGS_callFrame (see assertion above)
    88     "call *0x30(%esp)" "\n" // Ox30 = 0x0C * 4, 0x0C = STUB_ARGS_code (see assertion above)
     90    "movl 0x38(%esp), %edi" "\n"
     91    "call *0x30(%esp)" "\n"
    8992    "addl $0x1c, %esp" "\n"
    9093    "popl %ebx" "\n"
     
    118121#elif COMPILER(GCC) && PLATFORM(X86_64)
    119122
    120 COMPILE_ASSERT(STUB_ARGS_code == 0x10, STUB_ARGS_code_is_0x10);
    121 COMPILE_ASSERT(STUB_ARGS_callFrame == 0x12, STUB_ARGS_callFrame_is_0x12);
     123// These ASSERTs remind you that, if you change the layout of JITStackFrame, you
     124// need to change the assembly trampolines below to match.
     125COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x90, JITStackFrame_callFrame_offset_matches_ctiTrampoline);
     126COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x80, JITStackFrame_code_offset_matches_ctiTrampoline);
     127COMPILE_ASSERT(offsetof(struct JITStackFrame, savedRBX) == 0x48, JITStackFrame_stub_argument_space_matches_ctiTrampoline);
    122128
    123129#if PLATFORM(DARWIN)
     
    141147    "movq $0xFFFF000000000000, %r14" "\n"
    142148    "movq $0xFFFF000000000002, %r15" "\n"
    143     "movq 0x90(%rsp), %r13" "\n" // Ox90 = 0x12 * 8, 0x12 = STUB_ARGS_callFrame (see assertion above)
    144     "call *0x80(%rsp)" "\n" // Ox80 = 0x10 * 8, 0x10 = STUB_ARGS_code (see assertion above)
     149    "movq 0x90(%rsp), %r13" "\n"
     150    "call *0x80(%rsp)" "\n"
    145151    "addq $0x48, %rsp" "\n"
    146152    "popq %rbx" "\n"
     
    171177    "ret" "\n"
    172178);
    173    
     179
    174180#elif COMPILER(MSVC)
     181
     182// These ASSERTs remind you that, if you change the layout of JITStackFrame, you
     183// need to change the assembly trampolines below to match.
     184COMPILE_ASSERT(offsetof(struct JITStackFrame, callFrame) == 0x38, JITStackFrame_callFrame_offset_matches_ctiTrampoline);
     185COMPILE_ASSERT(offsetof(struct JITStackFrame, code) == 0x30, JITStackFrame_code_offset_matches_ctiTrampoline);
     186COMPILE_ASSERT(offsetof(struct JITStackFrame, savedEBX) == 0x1c, JITStackFrame_stub_argument_space_matches_ctiTrampoline);
    175187
    176188extern "C" {
     
    188200            mov ecx, esp;
    189201            mov edi, [esp + 0x38];
    190             call [esp + 0x30]; // Ox30 = 0x0C * 4, 0x0C = STUB_ARGS_code (see assertion above)
     202            call [esp + 0x30];
    191203            add esp, 0x1c;
    192204            pop ebx;
Note: See TracChangeset for help on using the changeset viewer.