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/ProfileGenerator.cpp

    r36068 r36113  
    4646
    4747ProfileGenerator::ProfileGenerator(const UString& title, ExecState* originatingExec, unsigned uid)
    48     : m_originatingGlobalExec(originatingExec->lexicalGlobalObject()->globalExec())
    49     , m_profileGroup(originatingExec->lexicalGlobalObject()->profileGroup())
    50 
     48    : m_originatingGlobalExec(originatingExec ? originatingExec->lexicalGlobalObject()->globalExec() : 0)
     49    , m_profileGroup(originatingExec ? originatingExec->lexicalGlobalObject()->profileGroup() : 0)
    5150{
    5251    m_profile = Profile::create(title, uid);
    5352    m_currentNode = m_head = m_profile->head();
    54 
    55     addParentForConsoleStart(originatingExec);
     53    if (originatingExec)
     54        addParentForConsoleStart(originatingExec);
    5655}
    5756
     
    8180    }
    8281
     82    if (!m_originatingGlobalExec)
     83        return;
     84
    8385    ASSERT_ARG(m_currentNode, m_currentNode);
    8486    m_currentNode = m_currentNode->willExecute(callIdentifier);
     
    9294        JAVASCRIPTCORE_PROFILE_DID_EXECUTE(m_profileGroup, const_cast<char*>(name.c_str()), const_cast<char*>(url.c_str()), callIdentifier.m_lineNumber);
    9395    }
     96
     97    if (!m_originatingGlobalExec)
     98        return;
    9499
    95100    ASSERT_ARG(m_currentNode, m_currentNode);
Note: See TracChangeset for help on using the changeset viewer.