Changeset 33943 in webkit
- Timestamp:
- May 20, 2008 2:29:08 PM (16 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r33942 r33943 1 2008-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 1 17 2008-05-20 Kevin McCullough <kmccullough@apple.com> 2 18 -
trunk/JavaScriptCore/profiler/Profile.h
r33941 r33943 44 44 void didExecute(const Vector<CallIdentifier>& CallIdentifier); 45 45 46 void stopProfiling() { m_callTree->stopProfiling( ); };46 void stopProfiling() { m_callTree->stopProfiling(0, true); }; 47 47 const UString& title() const { return m_title; }; 48 48 ProfileNode* callTree() const { return m_callTree.get(); }; -
trunk/JavaScriptCore/profiler/ProfileNode.cpp
r33941 r33943 93 93 } 94 94 95 void ProfileNode::stopProfiling( )95 void ProfileNode::stopProfiling(double totalProfileTime, bool headProfileNode) 96 96 { 97 97 if (m_startTime) … … 99 99 100 100 ASSERT(m_selfTime == 0.0); 101 102 if (headProfileNode) 103 totalProfileTime = m_totalTime; 101 104 102 105 // Calculate Self time and the percentages once we stop profiling. 103 106 StackIterator endOfChildren = m_children.end(); 104 107 for (StackIterator currentChild = m_children.begin(); currentChild != endOfChildren; ++currentChild) { 105 (*currentChild)->stopProfiling( );108 (*currentChild)->stopProfiling(totalProfileTime); 106 109 m_selfTime += (*currentChild)->totalTime(); 107 110 } … … 110 113 m_selfTime = m_totalTime - m_selfTime; 111 114 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; 114 117 } 115 118 -
trunk/JavaScriptCore/profiler/ProfileNode.h
r33941 r33943 64 64 ProfileNode* findChild(const CallIdentifier& functionName); 65 65 66 void stopProfiling( );66 void stopProfiling(double totalProfileTime, bool headProfileNode = false); 67 67 68 68 CallIdentifier callIdentifier() const { return m_callIdentifier; }
Note: See TracChangeset
for help on using the changeset viewer.