Changeset 34800 in webkit for trunk/JavaScriptCore/profiler/Profile.cpp
- Timestamp:
- Jun 25, 2008, 2:44:42 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/Profile.cpp
r34778 r34800 47 47 , m_originatingGlobalExec(originatingGlobalExec) 48 48 , m_pageGroupIdentifier(pageGroupIdentifier) 49 , m_stoppedCallDepth(0) 49 50 , m_client(client) 50 51 , m_stoppedProfiling(false) … … 62 63 removeProfileEnd(); 63 64 64 // Already at the head, set m_currentNode to prevent 65 // didExecute from recording more nodes. 66 if (m_currentNode == m_head) 67 m_currentNode = 0; 65 ASSERT(m_currentNode); 66 67 // Set the current node to the parent, because we are in a call that 68 // will not get didExecute call. 69 m_currentNode = m_currentNode->parent(); 68 70 69 71 m_stoppedProfiling = true; … … 100 102 return; 101 103 104 // Increment m_stoppedCallDepth to account for didExecute not being called for console.profile. 105 ++m_stoppedCallDepth; 106 102 107 // Attribute the time of the node aobut to be removed to the self time of its parent 103 108 currentNode->parent()->setSelfTime(currentNode->parent()->selfTime() + currentNode->totalTime()); … … 125 130 void Profile::willExecute(const CallIdentifier& callIdentifier) 126 131 { 127 if (m_stoppedProfiling) 128 return; 132 if (m_stoppedProfiling) { 133 ++m_stoppedCallDepth; 134 return; 135 } 129 136 130 137 ASSERT(m_currentNode); … … 136 143 if (!m_currentNode) 137 144 return; 145 146 if (m_stoppedProfiling && m_stoppedCallDepth > 0) { 147 --m_stoppedCallDepth; 148 return; 149 } 138 150 139 151 if (m_currentNode == m_head) { … … 154 166 } 155 167 156 if (m_stoppedProfiling) { 157 m_currentNode = m_currentNode->parent(); 158 return; 159 } 160 161 m_currentNode = m_currentNode->didExecute(); 168 // Set m_currentNode to the parent (which didExecute returns). If stopped, just set the 169 // m_currentNode to the parent and don't call didExecute. 170 m_currentNode = m_stoppedProfiling ? m_currentNode->parent() : m_currentNode->didExecute(); 162 171 } 163 172
Note:
See TracChangeset
for help on using the changeset viewer.