Changeset 34060 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
May 22, 2008, 11:57:44 PM (17 years ago)
Author:
[email protected]
Message:

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

Reviewed by Adam.

Fix a bug in the profiler where time in the current function is given to
(idle).

  • profiler/Profile.cpp: (KJS::Profile::didExecute): Set the start time and then call didExecute to calculate the time spent in this function.
  • profiler/ProfileNode.cpp: Remove confusing calculations that are no longer necessary. (KJS::ProfileNode::insertNode):
  • profiler/ProfileNode.h: Expose access to the start time to allow the simpler time calculations above. (KJS::ProfileNode::startTime): (KJS::ProfileNode::setStartTime):
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r34054 r34060  
     12008-05-22  Kevin McCullough  <[email protected]>
     2
     3        Reviewed by Adam.
     4
     5        Fix a bug in the profiler where time in the current function is given to
     6        (idle).
     7
     8        * profiler/Profile.cpp:
     9        (KJS::Profile::didExecute): Set the start time and then call didExecute
     10        to calculate the time spent in this function.
     11        * profiler/ProfileNode.cpp: Remove confusing calculations that are no
     12        longer necessary.
     13        (KJS::ProfileNode::insertNode):
     14        * profiler/ProfileNode.h: Expose access to the start time to allow the
     15        simpler time calculations above.
     16        (KJS::ProfileNode::startTime):
     17        (KJS::ProfileNode::setStartTime):
     18
    1192008-05-22  Adam Roben  <[email protected]>
    220
  • trunk/JavaScriptCore/profiler/Profile.cpp

    r34043 r34060  
    6565    if (m_currentNode == m_headNode) {
    6666        m_currentNode = ProfileNode::create(callIdentifier, m_headNode.get(), m_headNode.get());
     67        m_currentNode->setStartTime(m_headNode->startTime());
     68        m_currentNode->didExecute();
    6769        m_headNode->insertNode(m_currentNode.release());
    6870        m_currentNode = m_headNode;
  • trunk/JavaScriptCore/profiler/ProfileNode.cpp

    r34048 r34060  
    105105    RefPtr<ProfileNode> node = prpNode;
    106106
    107     double sumOfChildrensTime = 0.0;
    108     for (unsigned i = 0; i < m_children.size(); ++i) {
    109         sumOfChildrensTime += m_children[i]->totalTime();
     107    for (unsigned i = 0; i < m_children.size(); ++i)
    110108        node->addChild(m_children[i].release());
    111     }
    112109
    113110    m_children.clear();
    114 
    115     node->didExecute();
    116     node->setTotalTime(sumOfChildrensTime);
    117     node->setSelfTime(0.0);
    118111    m_children.append(node.release());
    119112}
  • trunk/JavaScriptCore/profiler/ProfileNode.h

    r34043 r34060  
    7474        unsigned lineNumber() const { return m_callIdentifier.lineNumber; }
    7575
     76        double startTime() const { return m_startTime; }
     77        void setStartTime(double startTime) { m_startTime = startTime; }
    7678        double totalTime() const { return m_visibleTotalTime; }
    7779        void setTotalTime(double time) { m_actualTotalTime = time; m_visibleTotalTime = time; }
Note: See TracChangeset for help on using the changeset viewer.