Changeset 33943 in webkit


Ignore:
Timestamp:
May 20, 2008 2:29:08 PM (16 years ago)
Author:
kmccullough@apple.com
Message:

2008-05-20 Kevin McCullough <kmccullough@apple.com>

Reviewed by Tim.

<rdar://problem/5770054> JavaScript profiler (10928)
Removed only profiler-internal use of currentProfile since that concept
is changing.

  • profiler/Profile.h: Now stopProfiling takes a time and bool as arguments. The time is used to calculate %s from and the bool tells if this node is the head node and should be the one calculating the time. (KJS::Profile::stopProfiling):
  • profiler/ProfileNode.cpp: Ditto. (KJS::ProfileNode::stopProfiling):
  • profiler/ProfileNode.h: Ditto.
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r33942 r33943  
     12008-05-20  Kevin McCullough  <kmccullough@apple.com>
     2
     3        Reviewed by Tim.
     4
     5        <rdar://problem/5770054> JavaScript profiler (10928)
     6        Removed only profiler-internal use of currentProfile since that concept
     7        is changing.
     8
     9        * profiler/Profile.h: Now stopProfiling takes a time and bool as
     10        arguments.  The time is used to calculate %s from and the bool tells
     11        if this node is the head node and should be the one calculating the time.
     12        (KJS::Profile::stopProfiling):
     13        * profiler/ProfileNode.cpp: Ditto.
     14        (KJS::ProfileNode::stopProfiling):
     15        * profiler/ProfileNode.h: Ditto.
     16
    1172008-05-20  Kevin McCullough  <kmccullough@apple.com>
    218
  • trunk/JavaScriptCore/profiler/Profile.h

    r33941 r33943  
    4444        void didExecute(const Vector<CallIdentifier>& CallIdentifier);
    4545
    46         void stopProfiling() { m_callTree->stopProfiling(); };
     46        void stopProfiling() { m_callTree->stopProfiling(0, true); };
    4747        const UString& title() const { return m_title; };
    4848        ProfileNode* callTree() const { return m_callTree.get(); };
  • trunk/JavaScriptCore/profiler/ProfileNode.cpp

    r33941 r33943  
    9393}
    9494
    95 void ProfileNode::stopProfiling()
     95void ProfileNode::stopProfiling(double totalProfileTime, bool headProfileNode)
    9696{
    9797    if (m_startTime)
     
    9999
    100100    ASSERT(m_selfTime == 0.0);
     101
     102    if (headProfileNode)
     103        totalProfileTime = m_totalTime;
    101104
    102105    // Calculate Self time and the percentages once we stop profiling.
    103106    StackIterator endOfChildren = m_children.end();
    104107    for (StackIterator currentChild = m_children.begin(); currentChild != endOfChildren; ++currentChild) {
    105         (*currentChild)->stopProfiling();
     108        (*currentChild)->stopProfiling(totalProfileTime);
    106109        m_selfTime += (*currentChild)->totalTime();
    107110    }
     
    110113    m_selfTime = m_totalTime - m_selfTime;
    111114
    112     m_totalPercent = (m_totalTime / Profiler::profiler()->currentProfile()->totalTime()) * 100.0;
    113     m_selfPercent = (selfTime() / Profiler::profiler()->currentProfile()->totalTime()) * 100.0;
     115    m_totalPercent = (m_totalTime / totalProfileTime) * 100.0;
     116    m_selfPercent = (m_selfTime / totalProfileTime) * 100.0;
    114117}
    115118
  • trunk/JavaScriptCore/profiler/ProfileNode.h

    r33941 r33943  
    6464        ProfileNode* findChild(const CallIdentifier& functionName);
    6565
    66         void stopProfiling();
     66        void stopProfiling(double totalProfileTime, bool headProfileNode = false);
    6767
    6868        CallIdentifier callIdentifier() const { return m_callIdentifier; }
Note: See TracChangeset for help on using the changeset viewer.