Changeset 39226 in webkit


Ignore:
Timestamp:
Dec 11, 2008 8:20:17 PM (15 years ago)
Author:
barraclough@apple.com
Message:

2008-12-11 Gavin Barraclough <barraclough@apple.com>

Reviewed by Oliver Hunt.

Remove CTI_ARGUMENTS mode, use va_start implementation on Windows,
unifying JIT callback (cti_*) argument access on OS X & Windows

No performance impact.

  • interpreter/Interpreter.h:
  • jit/JIT.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JIT.h:
  • jit/JITInlineMethods.h: (JSC::JIT::emitCTICall):
  • jit/JITPropertyAccess.cpp: (JSC::JIT::privateCompilePutByIdTransition):
  • wtf/Platform.h:
Location:
trunk/JavaScriptCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r39206 r39226  
     12008-12-11  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Remove CTI_ARGUMENTS mode, use va_start implementation on Windows,
     6        unifying JIT callback (cti_*) argument access on OS X & Windows
     7
     8        No performance impact.
     9
     10        * interpreter/Interpreter.h:
     11        * jit/JIT.cpp:
     12        (JSC::JIT::privateCompileCTIMachineTrampolines):
     13        * jit/JIT.h:
     14        * jit/JITInlineMethods.h:
     15        (JSC::JIT::emitCTICall):
     16        * jit/JITPropertyAccess.cpp:
     17        (JSC::JIT::privateCompilePutByIdTransition):
     18        * wtf/Platform.h:
     19
    1202008-12-11  Holger Freyther  <zecke@selfish.org>
    221
  • trunk/JavaScriptCore/interpreter/Interpreter.h

    r39161 r39226  
    5555#if ENABLE(JIT)
    5656
    57 #if USE(CTI_ARGUMENT)
    58 #define CTI_ARGS void** args
    59 #define ARGS (args)
    60 #else
    6157#define CTI_ARGS void* args, ...
    6258#define ARGS (reinterpret_cast<void**>(vl_args) - 1)
    63 #endif
    64 
    65 #if USE(FAST_CALL_CTI_ARGUMENT)
    66 
    67 #if COMPILER(MSVC)
    68 #define SFX_CALL __fastcall
    69 #elif COMPILER(GCC)
    70 #define SFX_CALL  __attribute__ ((fastcall))
    71 #else
    72 #error Need to support fastcall calling convention in this compiler
    73 #endif
    74 
    75 #else
    76 
    77 #if COMPILER(MSVC)
    78 #define SFX_CALL __cdecl
    79 #else
    8059#define SFX_CALL
    81 #endif
    82 
    83 #endif
    8460
    8561    typedef uint64_t VoidPtrPair;
  • trunk/JavaScriptCore/jit/JIT.cpp

    r39197 r39226  
    7676".globl " SYMBOL_STRING(ctiVMThrowTrampoline) "\n"
    7777SYMBOL_STRING(ctiVMThrowTrampoline) ":" "\n"
    78 #if USE(CTI_ARGUMENT)
    79 #if USE(FAST_CALL_CTI_ARGUMENT)
    80     "movl %esp, %ecx" "\n"
    81 #else
    82     "movl %esp, 0(%esp)" "\n"
    83 #endif
    84     "call " SYMBOL_STRING(_ZN3JSC11Interpreter12cti_vm_throwEPPv) "\n"
    85 #else
    8678    "call " SYMBOL_STRING(_ZN3JSC11Interpreter12cti_vm_throwEPvz) "\n"
    87 #endif
    8879    "addl $0x20, %esp" "\n"
    8980    "popl %ebx" "\n"
     
    20422033    JmpSrc hasCodeBlock1 = __ jne();
    20432034    __ popl_r(X86::ebx);
    2044     restoreArgumentReference();
    20452035    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    20462036    JmpSrc callJSFunction1 = __ call();
     
    20562046    emitPutCTIArg(X86::ebx, 4);
    20572047    emitPutCTIArg(X86::eax, 12);
    2058     restoreArgumentReference();
    20592048    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    20602049    JmpSrc callArityCheck1 = __ call();
     
    20692058    __ popl_r(X86::ebx);
    20702059    emitPutCTIArg(X86::ebx, 4);
    2071     restoreArgumentReference();
    20722060    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    20732061    JmpSrc callDontLazyLinkCall = __ call();
     
    20842072    JmpSrc hasCodeBlock2 = __ jne();
    20852073    __ popl_r(X86::ebx);
    2086     restoreArgumentReference();
    20872074    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    20882075    JmpSrc callJSFunction2 = __ call();
     
    20982085    emitPutCTIArg(X86::ebx, 4);
    20992086    emitPutCTIArg(X86::eax, 12);
    2100     restoreArgumentReference();
    21012087    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    21022088    JmpSrc callArityCheck2 = __ call();
     
    21112097    __ popl_r(X86::ebx);
    21122098    emitPutCTIArg(X86::ebx, 4);
    2113     restoreArgumentReference();
    21142099    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    21152100    JmpSrc callLazyLinkCall = __ call();
     
    21262111    JmpSrc hasCodeBlock3 = __ jne();
    21272112    __ popl_r(X86::ebx);
    2128     restoreArgumentReference();
    21292113    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    21302114    JmpSrc callJSFunction3 = __ call();
     
    21402124    emitPutCTIArg(X86::ebx, 4);
    21412125    emitPutCTIArg(X86::eax, 12);
    2142     restoreArgumentReference();
    21432126    emitPutCTIParam(X86::edi, CTI_ARGS_callFrame);
    21442127    JmpSrc callArityCheck3 = __ call();
  • trunk/JavaScriptCore/jit/JIT.h

    r39197 r39226  
    277277        static const int repatchGetByIdDefaultOffset = 256;
    278278
    279 #if USE(FAST_CALL_CTI_ARGUMENT)
    280         static const int ctiArgumentInitSize = 2;
    281 #elif USE(CTI_ARGUMENT)
    282         static const int ctiArgumentInitSize = 4;
    283 #else
    284         static const int ctiArgumentInitSize = 0;
    285 #endif
    286279        // These architecture specific value are used to enable repatching - see comment on op_put_by_id.
    287280        static const int repatchOffsetPutByIdStructure = 7;
     
    292285        static const int repatchOffsetGetByIdPropertyMapOffset = 22;
    293286#if ENABLE(OPCODE_SAMPLING)
    294         static const int repatchOffsetGetByIdSlowCaseCall = 27 + 4 + ctiArgumentInitSize;
     287        static const int repatchOffsetGetByIdSlowCaseCall = 27 + 4;
    295288#else
    296         static const int repatchOffsetGetByIdSlowCaseCall = 17 + 4 + ctiArgumentInitSize;
     289        static const int repatchOffsetGetByIdSlowCaseCall = 17 + 4;
    297290#endif
    298291        static const int repatchOffsetOpCallCall = 6;
     
    458451        void emitTagAsBoolImmediate(RegisterID reg);
    459452
    460         void restoreArgumentReference();
    461         void restoreArgumentReferenceForTrampoline();
    462 
    463453        JmpSrc emitNakedCall(unsigned bytecodeIndex, RegisterID);
    464454        JmpSrc emitNakedCall(unsigned bytecodeIndex, void* function);
  • trunk/JavaScriptCore/jit/JITInlineMethods.h

    r39121 r39226  
    202202}
    203203
    204 ALWAYS_INLINE void JIT::restoreArgumentReference()
    205 {
    206 #if USE(CTI_ARGUMENT)
    207 #if USE(FAST_CALL_CTI_ARGUMENT)
    208     __ movl_rr(X86::esp, X86::ecx);
    209 #else
    210     __ movl_rm(X86::esp, 0, X86::esp);
    211 #endif
    212 #endif
    213 }
    214 
    215 ALWAYS_INLINE void JIT::restoreArgumentReferenceForTrampoline()
    216 {
    217 #if USE(CTI_ARGUMENT) && USE(FAST_CALL_CTI_ARGUMENT)
    218     __ movl_rr(X86::esp, X86::ecx);
    219     __ addl_i32r(4, X86::ecx);
    220 #endif
    221 }
    222 
    223 
    224204ALWAYS_INLINE JmpSrc JIT::emitCTICall(unsigned bytecodeIndex, CTIHelper_j helper)
    225205{
     
    227207    store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot());
    228208#endif
    229     restoreArgumentReference();
    230209    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
    231210    JmpSrc ctiCall = call();
     
    244223    store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot());
    245224#endif
    246     restoreArgumentReference();
    247225    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
    248226    JmpSrc ctiCall = call();
     
    261239    store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot());
    262240#endif
    263     restoreArgumentReference();
    264241    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
    265242    JmpSrc ctiCall = call();
     
    278255    store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot());
    279256#endif
    280     restoreArgumentReference();
    281257    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
    282258    JmpSrc ctiCall = call();
     
    295271    store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot());
    296272#endif
    297     restoreArgumentReference();
    298273    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
    299274    JmpSrc ctiCall = call();
     
    312287    store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot());
    313288#endif
    314     restoreArgumentReference();
    315289    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
    316290    JmpSrc ctiCall = call();
     
    329303    store32(Imm32(m_interpreter->sampler()->encodeSample(m_codeBlock->instructions().begin() + bytecodeIndex, true)), m_interpreter->sampler()->sampleSlot());
    330304#endif
    331     restoreArgumentReference();
    332305    emitPutCTIParam(callFrameRegister, CTI_ARGS_callFrame);
    333306    JmpSrc ctiCall = call();
  • trunk/JavaScriptCore/jit/JITPropertyAccess.cpp

    r39123 r39226  
    282282        for (unsigned i = 0; i < failureCases.size(); ++i)
    283283            __ link(failureCases[i], __ label());
    284         restoreArgumentReferenceForTrampoline();
    285284        failureJump = __ jmp();
    286285    }
  • trunk/JavaScriptCore/wtf/Platform.h

    r39206 r39226  
    456456#endif
    457457
    458 /* Use "fastcall" calling convention on MSVC */
    459 #if COMPILER(MSVC)
    460 #define WTF_USE_FAST_CALL_CTI_ARGUMENT 1
    461 #define WTF_USE_CTI_ARGUMENT 1
    462 #endif
    463 
    464458#if !PLATFORM(QT)
    465459#define WTF_USE_FONT_FAST_PATH 1
Note: See TracChangeset for help on using the changeset viewer.