Changeset 37138 in webkit for trunk/JavaScriptCore/VM/CTI.cpp


Ignore:
Timestamp:
Sep 30, 2008, 11:16:18 PM (17 years ago)
Author:
[email protected]
Message:

Improve performance of CTI on windows.

Reviewed by Geoff Garen

Currently on platforms where the compiler doesn't allow us to safely
index relative to the address of a parameter we need to actually
provide a pointer to CTI runtime call arguments. This patch improves
performance in this case by making the CTI logic for restoring this
parameter much less conservative by only resetting it before we actually
make a call, rather than between each and every SF bytecode we generate
code for.

This results in a 3.6% on the v8 benchmark when compiled with MSVC.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/VM/CTI.cpp

    r37086 r37138  
    293293ALWAYS_INLINE X86Assembler::JmpSrc CTI::emitCall(unsigned opcodeIndex, X86::RegisterID r)
    294294{
     295    m_jit.emitRestoreArgumentReference();
    295296    X86Assembler::JmpSrc call = m_jit.emitCall(r);
    296297    m_calls.append(CallRecord(call, opcodeIndex));
     
    305306    m_jit.movl_i32m(1, &inCalledCode);
    306307#endif
     308    m_jit.emitRestoreArgumentReference();
    307309    X86Assembler::JmpSrc call = m_jit.emitCall();
    308310    m_calls.append(CallRecord(call, helper, opcodeIndex));
     
    320322    m_jit.movl_i32m(1, &inCalledCode);
    321323#endif
     324    m_jit.emitRestoreArgumentReference();
    322325    X86Assembler::JmpSrc call = m_jit.emitCall();
    323326    m_calls.append(CallRecord(call, helper, opcodeIndex));
     
    335338    m_jit.movl_i32m(1, &inCalledCode);
    336339#endif
     340    m_jit.emitRestoreArgumentReference();
    337341    X86Assembler::JmpSrc call = m_jit.emitCall();
    338342    m_calls.append(CallRecord(call, helper, opcodeIndex));
     
    350354    m_jit.movl_i32m(1, &inCalledCode);
    351355#endif
     356    m_jit.emitRestoreArgumentReference();
    352357    X86Assembler::JmpSrc call = m_jit.emitCall();
    353358    m_calls.append(CallRecord(call, helper, opcodeIndex));
     
    365370    m_jit.movl_i32m(1, &inCalledCode);
    366371#endif
     372    m_jit.emitRestoreArgumentReference();
    367373    X86Assembler::JmpSrc call = m_jit.emitCall();
    368374    m_calls.append(CallRecord(call, helper, opcodeIndex));
     
    508514        emitGetPutArg(instruction[i + 2].u.operand, 0, X86::ecx);
    509515        emitCall(i, Machine::cti_op_call_eval);
    510         m_jit.emitRestoreArgumentReference();
    511516
    512517        emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r
     
    850855
    851856        ASSERT_WITH_MESSAGE(m_machine->isOpcode(instruction[i].u.opcode), "privateCompileMainPass gone bad @ %d", i);
    852         m_jit.emitRestoreArgumentReference();
    853857        switch (m_machine->getOpcodeID(instruction[i].u.opcode)) {
    854858        case op_mov: {
     
    20222026    for (Vector<SlowCaseEntry>::iterator iter = m_slowCases.begin(); iter != m_slowCases.end(); ++iter) {
    20232027        unsigned i = iter->to;
    2024         m_jit.emitRestoreArgumentReference();
    20252028        switch (m_machine->getOpcodeID(instruction[i].u.opcode)) {
    20262029        case op_add: {
     
    24712474        case op_construct: {
    24722475            m_jit.link(iter->from, m_jit.label());
    2473             m_jit.emitRestoreArgumentReference();
    24742476
    24752477            // We jump to this slow case if the ctiCode for the codeBlock has not yet been generated; compile it now.
Note: See TracChangeset for help on using the changeset viewer.