Ignore:
Timestamp:
May 23, 2008, 12:12:31 PM (17 years ago)
Author:
[email protected]
Message:

2008-05-23 Geoffrey Garen <[email protected]>

Rolled out r34085 because it measured as a 7.6% performance regression.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/profiler/Profiler.cpp

    r34085 r34086  
    9999}
    100100
     101static inline bool shouldExcludeFunction(ExecState* exec, JSObject* calledFunction)
     102{
     103    if (!calledFunction->inherits(&InternalFunctionImp::info))
     104        return false;
     105    // Don't record a call for function.call and function.apply.
     106    if (static_cast<InternalFunctionImp*>(calledFunction)->functionName() == exec->propertyNames().call)
     107        return true;
     108    if (static_cast<InternalFunctionImp*>(calledFunction)->functionName() == exec->propertyNames().apply)
     109        return true;
     110    return false;
     111}
     112
    101113static inline void dispatchFunctionToProfiles(const Vector<RefPtr<Profile> >& profiles, Profile::ProfileFunction function, const CallIdentifier& callIdentifier, unsigned currentPageGroupIdentifier)
    102114{
     
    108120void Profiler::willExecute(ExecState* exec, JSObject* calledFunction)
    109121{
    110     ASSERT(!m_currentProfiles.isEmpty());
     122    if (m_currentProfiles.isEmpty())
     123        return;
     124
     125    if (shouldExcludeFunction(exec, calledFunction))
     126        return;
    111127
    112128    dispatchFunctionToProfiles(m_currentProfiles, &Profile::willExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier());
     
    115131void Profiler::willExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber)
    116132{
    117     ASSERT(!m_currentProfiles.isEmpty());
     133    if (m_currentProfiles.isEmpty())
     134        return;
    118135
    119136    CallIdentifier callIdentifier = createCallIdentifier(sourceURL, startingLineNumber);
     
    124141void Profiler::didExecute(ExecState* exec, JSObject* calledFunction)
    125142{
    126     ASSERT(!m_currentProfiles.isEmpty());
     143    if (m_currentProfiles.isEmpty())
     144        return;
     145
     146    if (shouldExcludeFunction(exec, calledFunction))
     147        return;
    127148
    128149    dispatchFunctionToProfiles(m_currentProfiles, &Profile::didExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier());
     
    131152void Profiler::didExecute(ExecState* exec, const UString& sourceURL, int startingLineNumber)
    132153{
    133     ASSERT(!m_currentProfiles.isEmpty());
     154    if (m_currentProfiles.isEmpty())
     155        return;
    134156
    135157    dispatchFunctionToProfiles(m_currentProfiles, &Profile::didExecute, createCallIdentifier(sourceURL, startingLineNumber), exec->lexicalGlobalObject()->pageGroupIdentifier());
Note: See TracChangeset for help on using the changeset viewer.