Changeset 33581 in webkit for trunk/JavaScriptCore/profiler/ProfileNode.cpp
- Timestamp:
- May 19, 2008, 3:15:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/ProfileNode.cpp
r33532 r33581 53 53 } 54 54 55 void ProfileNode::didExecute(Vector<UString> stackNames, unsigned int stackIndex) 56 { 57 if (stackIndex && stackIndex == stackNames.size()) { 58 ASSERT(stackNames[stackIndex - 1] == m_functionName); 59 endAndRecordCall(); 60 return;61 }62 63 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end() && stackIndex < stackNames.size(); ++currentChild) {64 if ((*currentChild)->functionName() == stackNames[stackIndex]) {65 (*currentChild)->didExecute(stackNames, ++stackIndex);55 // We start at the end of stackNames and work our way forwards since the names are in 56 // the reverse order of how the ProfileNode tree is created (e.g. the leaf node is at 57 // index 0 and the top of the stack is at index stackNames.size() - 1) 58 void ProfileNode::didExecute(const Vector<UString>& stackNames, unsigned int stackIndex) 59 { 60 for (size_t i = 0; i < m_children.size(); ++i) { 61 if (m_children[i]->functionName() == stackNames[stackIndex]) { 62 if (stackIndex) // We are not at the bottom of the stack yet 63 m_children[i]->didExecute(stackNames, stackIndex - 1); 64 else // This is the child we were looking for 65 m_children[i]->endAndRecordCall(); 66 66 return; 67 67 } … … 189 189 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) 190 190 (*currentChild)->sortCallsAscending(); 191 } 192 193 void ProfileNode::endAndRecordCall() 194 { 195 m_totalTime += getCurrentUTCTime() - m_startTime; 196 m_startTime = 0.0; 197 198 ++m_numberOfCalls; 191 199 } 192 200 … … 247 255 } 248 256 249 void ProfileNode::endAndRecordCall()250 {251 m_totalTime += getCurrentUTCTime() - m_startTime;252 m_startTime = 0.0;253 254 ++m_numberOfCalls;255 }256 257 257 } // namespace KJS
Note:
See TracChangeset
for help on using the changeset viewer.