Changeset 33532 in webkit for trunk/JavaScriptCore/profiler/ProfileNode.cpp
- Timestamp:
- May 16, 2008, 3:23:09 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/profiler/ProfileNode.cpp
r33507 r33532 111 111 } 112 112 113 #pragma mark Sorting methods 114 115 static inline bool totalTimeDescendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) 116 { 117 return a->totalTime() > b->totalTime(); 118 } 119 120 void ProfileNode::sortTotalTimeDescending() 121 { 122 std::sort(m_children.begin(), m_children.end(), totalTimeDescendingComparator); 123 124 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) 125 (*currentChild)->sortTotalTimeDescending(); 126 } 127 128 static inline bool totalTimeAscendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) 129 { 130 return a->totalTime() < b->totalTime(); 131 } 132 133 void ProfileNode::sortTotalTimeAscending() 134 { 135 std::sort(m_children.begin(), m_children.end(), totalTimeAscendingComparator); 136 137 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) 138 (*currentChild)->sortTotalTimeAscending(); 139 } 140 141 static inline bool selfTimeDescendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) 142 { 143 return a->selfTime() > b->selfTime(); 144 } 145 146 void ProfileNode::sortSelfTimeDescending() 147 { 148 std::sort(m_children.begin(), m_children.end(), selfTimeDescendingComparator); 149 150 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) 151 (*currentChild)->sortSelfTimeDescending(); 152 } 153 154 static inline bool selfTimeAscendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) 155 { 156 return a->selfTime() < b->selfTime(); 157 } 158 159 void ProfileNode::sortSelfTimeAscending() 160 { 161 std::sort(m_children.begin(), m_children.end(), selfTimeAscendingComparator); 162 163 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) 164 (*currentChild)->sortSelfTimeAscending(); 165 } 166 167 static inline bool callsDescendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) 168 { 169 return a->numberOfCalls() > b->numberOfCalls(); 170 } 171 172 void ProfileNode::sortCallsDescending() 173 { 174 std::sort(m_children.begin(), m_children.end(), callsDescendingComparator); 175 176 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) 177 (*currentChild)->sortCallsDescending(); 178 } 179 180 static inline bool callsAscendingComparator(const RefPtr<ProfileNode>& a, const RefPtr<ProfileNode>& b) 181 { 182 return a->numberOfCalls() < b->numberOfCalls(); 183 } 184 185 void ProfileNode::sortCallsAscending() 186 { 187 std::sort(m_children.begin(), m_children.end(), callsAscendingComparator); 188 189 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) 190 (*currentChild)->sortCallsAscending(); 191 } 192 113 193 void ProfileNode::printDataInspectorStyle(int indentLevel) const 114 194 {
Note:
See TracChangeset
for help on using the changeset viewer.