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


Ignore:
Timestamp:
Oct 13, 2008, 5:20:49 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-13 Cameron Zwarich <[email protected]>

Reviewed by Geoff Garen.

Bug 21541: Move RegisterFile growth check to callee
<https://bugs.webkit.org/show_bug.cgi?id=21541>

Move the RegisterFile growth check to the callee in the common case,
where some of the information is known statically at JIT time. There is
still a check in the caller in the case where the caller provides too
few arguments.

This is a 2.1% speedup on the V8 benchmark, including a 5.1% speedup on
the Richards benchmark, a 4.1% speedup on the DeltaBlue benchmark, and a
1.4% speedup on the Earley-Boyer benchmark. It is also a 0.5% speedup on
SunSpider.

  • VM/CTI.cpp: (JSC::CTI::privateCompile):
  • VM/Machine.cpp: (JSC::Machine::cti_register_file_check): (JSC::Machine::cti_op_call_JSFunction): (JSC::Machine::cti_op_construct_JSConstruct):
  • VM/Machine.h:
  • VM/RegisterFile.h:
  • masm/X86Assembler.h: (JSC::X86Assembler::): (JSC::X86Assembler::cmpl_mr): (JSC::X86Assembler::emitUnlinkedJg):
File:
1 edited

Legend:

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

    r37500 r37570  
    26162616    emitPutToCallFrameHeader(X86::ecx, RegisterFile::ReturnPC);
    26172617
     2618    X86Assembler::JmpSrc slowRegisterFileCheck;
     2619    X86Assembler::JmpDst afterRegisterFileCheck;
     2620    if (m_codeBlock->codeType == FunctionCode) {
     2621        emitGetCTIParam(CTI_ARGS_registerFile, X86::eax);
     2622        m_jit.leal_mr(m_codeBlock->numCalleeRegisters * sizeof(Register), X86::edi, X86::edx);
     2623        m_jit.cmpl_mr(OBJECT_OFFSET(RegisterFile, m_end), X86::eax, X86::edx);
     2624        slowRegisterFileCheck = m_jit.emitUnlinkedJg();
     2625        afterRegisterFileCheck = m_jit.label();
     2626    }
     2627
    26182628    privateCompileMainPass();
    26192629    privateCompileLinkPass();
    26202630    privateCompileSlowCases();
     2631
     2632    if (m_codeBlock->codeType == FunctionCode) {
     2633        m_jit.link(slowRegisterFileCheck, m_jit.label());
     2634        emitCall(0, Machine::cti_register_file_check);
     2635        X86Assembler::JmpSrc backToBody = m_jit.emitUnlinkedJmp();
     2636        m_jit.link(backToBody, afterRegisterFileCheck);
     2637    }
    26212638
    26222639    ASSERT(m_jmpTable.isEmpty());
Note: See TracChangeset for help on using the changeset viewer.