Changeset 32693 in webkit for trunk/JavaScriptCore/profiler/FunctionCallProfile.cpp
- Timestamp:
- Apr 29, 2008, 11:09:04 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/FunctionCallProfile.cpp
r32354 r32693 40 40 : m_functionName(name) 41 41 , m_timeSum(0) 42 , m_numberOfCalls(0) 42 43 { 43 44 m_startTime = getCurrentUTCTime(); … … 57 58 void FunctionCallProfile::didExecute(Vector<UString> stackNames, unsigned int stackIndex) 58 59 { 59 if (stackIndex == stackNames.size()) {60 if (stackIndex && stackIndex == stackNames.size()) { 60 61 ASSERT(stackNames[stackIndex - 1] == m_functionName); 61 62 m_timeSum += getCurrentUTCTime() - m_startTime; 63 m_startTime = 0.0; 64 65 // FIXME: We may need something with higher resolution than ms as some functions will take 0ms. 62 endAndRecordCall(); 66 63 return; 67 64 } … … 101 98 { 102 99 if (m_startTime) 103 m_timeSum += getCurrentUTCTime() - m_startTime;100 endAndRecordCall(); 104 101 105 102 StackIterator endOfChildren = m_children.end(); … … 160 157 } 161 158 159 void FunctionCallProfile::endAndRecordCall() 160 { 161 m_timeSum += getCurrentUTCTime() - m_startTime; 162 m_startTime = 0.0; 163 164 ++m_numberOfCalls; 165 } 166 162 167 } // namespace KJS
Note:
See TracChangeset
for help on using the changeset viewer.