Ignore:
Timestamp:
May 23, 2008, 1:56:21 AM (17 years ago)
Author:
[email protected]
Message:

<rdar://problem/5951561> Turn on JavaScript Profiler

Reviewed by Kevin McCullough

Flipped the switch on the profiler, rearranged how we
signal the the profiler is active so that calls aren't
needed in the general case.

Also fixed the entry point for Machine::execute(FunctionBodyNode..)
to correctly indicate function exit.

Results in a 0.7-1.0% regression in SunSpider :-(

File:
1 edited

Legend:

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

    r34054 r34065  
    4040namespace KJS {
    4141
    42 static Profiler* sharedProfiler = 0;
    4342static const char* GlobalCodeExecution = "(program)";
    4443static const char* AnonymousFunction = "(anonymous function)";
     
    4847static CallIdentifier createCallIdentifierFromFunctionImp(FunctionImp*);
    4948
     49Profiler* Profiler::s_sharedProfiler = 0;
     50Profiler* Profiler::s_sharedEnabledProfilerReference = 0;
     51
    5052Profiler* Profiler::profiler()
    5153{
    52     if (!sharedProfiler)
    53         sharedProfiler = new Profiler;
    54     return sharedProfiler;
    55 }
    56 
     54    if (!s_sharedProfiler)
     55        s_sharedProfiler = new Profiler();
     56    return s_sharedProfiler;
     57}   
     58   
    5759Profile* Profiler::findProfile(ExecState* exec, const UString& title) const
    5860{
     
    7476        if (m_currentProfiles[i]->originatingGlobalExec() == globalExec && m_currentProfiles[i]->title() == title)
    7577            return;
    76 
     78    s_sharedEnabledProfilerReference = this;
    7779    RefPtr<Profile> profile = Profile::create(title, globalExec, exec->lexicalGlobalObject()->pageGroupIdentifier());
    7880    m_currentProfiles.append(profile);
     
    8890            PassRefPtr<Profile> prpProfile = m_currentProfiles[i].release();
    8991            m_currentProfiles.remove(i);
     92            if (!m_currentProfiles.size())
     93                s_sharedEnabledProfilerReference = 0;
    9094            return prpProfile;
    9195        }
Note: See TracChangeset for help on using the changeset viewer.