Ignore:
Timestamp:
Apr 21, 2008, 4:13:27 PM (17 years ago)
Author:
[email protected]
Message:

2008-04-21 Kevin McCullough <[email protected]>

Reviewed by Adam.

<rdar://problem/5770054> JavaScript profiler (10928)

  • When stop profiling is called we need to stop the timers on all the functions that are still running.
  • profiler/FunctionCallProfile.cpp: (KJS::FunctionCallProfile::didExecute): (KJS::FunctionCallProfile::stopProfiling):
  • profiler/FunctionCallProfile.h:
  • profiler/Profiler.cpp: (KJS::Profiler::stopProfiling):
File:
1 edited

Legend:

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

    r32228 r32354  
    6161
    6262        m_timeSum += getCurrentUTCTime() - m_startTime;
     63        m_startTime = 0.0;
    6364
    6465        // FIXME: We may need something with higher resolution than ms as some functions will take 0ms.
     
    9596
    9697    return 0;
     98}
     99
     100void FunctionCallProfile::stopProfiling()
     101{
     102    if (m_startTime)
     103        m_timeSum += getCurrentUTCTime() - m_startTime;
     104
     105    StackIterator endOfChildren = m_children.end();
     106    for (StackIterator it = m_children.begin(); it != endOfChildren; ++it)
     107        (*it)->stopProfiling();
    97108}
    98109
Note: See TracChangeset for help on using the changeset viewer.