Changeset 60376 in webkit for trunk/JavaScriptCore/runtime


Ignore:
Timestamp:
May 28, 2010, 2:18:35 PM (15 years ago)
Author:
[email protected]
Message:

Bug 39898 - Move arity check into callee.

Reviewed by Sam Weinig.

We can reduce the size of the virtual call trampolines by moving the arity check
into the callee functions. As a following step we will be able to remove the
check for native function / codeblocks by performing translation in a lazy stub.

  • interpreter/CallFrame.h:

(JSC::ExecState::init):
(JSC::ExecState::setReturnPC):

  • jit/JIT.cpp:

(JSC::JIT::privateCompile):
(JSC::JIT::linkCall):
(JSC::JIT::linkConstruct):

  • jit/JIT.h:

(JSC::JIT::compile):

  • jit/JITOpcodes.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::privateCompileCTIMachineTrampolines):

  • jit/JITStubs.cpp:

(JSC::DEFINE_STUB_FUNCTION):

  • runtime/Executable.cpp:

(JSC::FunctionExecutable::generateJITCodeForCall):
(JSC::FunctionExecutable::generateJITCodeForConstruct):
(JSC::FunctionExecutable::reparseExceptionInfo):

  • runtime/Executable.h:

(JSC::NativeExecutable::NativeExecutable):
(JSC::FunctionExecutable::generatedJITCodeForCallWithArityCheck):
(JSC::FunctionExecutable::generatedJITCodeForConstructWithArityCheck):

Location:
trunk/JavaScriptCore/runtime
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Executable.cpp

    r59339 r60376  
    189189{
    190190    CodeBlock* codeBlock = &bytecodeForCall(exec, scopeChainNode);
    191     m_jitCodeForCall = JIT::compile(scopeChainNode->globalData, codeBlock);
     191    m_jitCodeForCall = JIT::compile(scopeChainNode->globalData, codeBlock, &m_jitCodeForCallWithArityCheck);
    192192
    193193#if !ENABLE(OPCODE_SAMPLING)
     
    200200{
    201201    CodeBlock* codeBlock = &bytecodeForConstruct(exec, scopeChainNode);
    202     m_jitCodeForConstruct = JIT::compile(scopeChainNode->globalData, codeBlock);
     202    m_jitCodeForConstruct = JIT::compile(scopeChainNode->globalData, codeBlock, &m_jitCodeForConstructWithArityCheck);
    203203
    204204#if !ENABLE(OPCODE_SAMPLING)
  • trunk/JavaScriptCore/runtime/Executable.h

    r60117 r60376  
    8787        JITCode m_jitCodeForCall;
    8888        JITCode m_jitCodeForConstruct;
     89        MacroAssemblerCodePtr m_jitCodeForCallWithArityCheck;
     90        MacroAssemblerCodePtr m_jitCodeForConstructWithArityCheck;
    8991#endif
    9092    };
     
    111113            m_jitCodeForCall = callThunk;
    112114            m_jitCodeForConstruct = constructThunk;
     115            m_jitCodeForCallWithArityCheck = callThunk.addressForCall();
     116            m_jitCodeForConstructWithArityCheck = constructThunk.addressForCall();
    113117        }
    114118
     
    408412        }
    409413
     414        MacroAssemblerCodePtr generatedJITCodeForCallWithArityCheck()
     415        {
     416            ASSERT(m_jitCodeForCall);
     417            ASSERT(m_jitCodeForCallWithArityCheck);
     418            return m_jitCodeForCallWithArityCheck;
     419        }
     420
     421        MacroAssemblerCodePtr generatedJITCodeForConstructWithArityCheck()
     422        {
     423            ASSERT(m_jitCodeForConstruct);
     424            ASSERT(m_jitCodeForConstructWithArityCheck);
     425            return m_jitCodeForConstructWithArityCheck;
     426        }
     427
    410428    private:
    411429        void generateJITCodeForCall(ExecState*, ScopeChainNode*);
Note: See TracChangeset for help on using the changeset viewer.