Ignore:
Timestamp:
Sep 5, 2008, 10:52:39 AM (17 years ago)
Author:
[email protected]
Message:

2008-09-05 Kevin McCullough <[email protected]>

Reviewed by Sam and Alexey.

Make the profiler work with a null exec state. This will allow other
applications start the profiler to get DTrace probes going without
needing a WebView.

  • ChangeLog:
  • profiler/ProfileGenerator.cpp: (KJS::ProfileGenerator::ProfileGenerator): (KJS::ProfileGenerator::willExecute): (KJS::ProfileGenerator::didExecute):
  • profiler/Profiler.cpp: (KJS::Profiler::startProfiling): (KJS::Profiler::stopProfiling): (KJS::dispatchFunctionToProfiles):
File:
1 edited

Legend:

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

    r36068 r36113  
    5959void Profiler::startProfiling(ExecState* exec, const UString& title)
    6060{
    61     ASSERT_ARG(exec, exec);
    62 
    6361    // Check if we currently have a Profile for this global ExecState and title.
    6462    // If so return early and don't create a new Profile.
    65     ExecState* globalExec = exec->lexicalGlobalObject()->globalExec();
     63    ExecState* globalExec = exec ? exec->lexicalGlobalObject()->globalExec() : 0;
     64
    6665    for (size_t i = 0; i < m_currentProfiles.size(); ++i) {
    6766        ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
     
    7776PassRefPtr<Profile> Profiler::stopProfiling(ExecState* exec, const UString& title)
    7877{
    79     ExecState* globalExec = exec->lexicalGlobalObject()->globalExec();
     78    ExecState* globalExec = exec ? exec->lexicalGlobalObject()->globalExec() : 0;
    8079    for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
    8180        ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
     
    9897{
    9998    for (size_t i = 0; i < profiles.size(); ++i) {
    100         if (profiles[i]->profileGroup() == currentProfileTargetGroup)
     99        if (profiles[i]->profileGroup() == currentProfileTargetGroup || !profiles[i]->originatingGlobalExec())
    101100            (profiles[i].get()->*function)(callIdentifier);
    102101    }
Note: See TracChangeset for help on using the changeset viewer.