Changeset 34962 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jul 2, 2008, 5:05:26 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r34961 r34962 1 2008-07-02 Kevin McCullough <[email protected]> 2 3 Reviewed by Darin. 4 5 -Small cleanup in preparation for implementing Bottom-up. 6 7 * profiler/CallIdentifier.h: Rename debug function to make it clear of 8 its output and intention to be debug only. 9 (KJS::CallIdentifier::operator const char* ): Implement in terms of 10 c_str. 11 (KJS::CallIdentifier::c_str): 12 * profiler/ProfileNode.cpp: Impelment findChild() which will be needed 13 by the bottom-up implementation. 14 (KJS::ProfileNode::findChild): 15 * profiler/ProfileNode.h: Added comments to make the collections of 16 functions more clear. 17 (KJS::ProfileNode::operator==): 18 (KJS::ProfileNode::c_str): 19 1 20 2008-07-02 Cameron Zwarich <[email protected]> 2 21 -
trunk/JavaScriptCore/profiler/CallIdentifier.h
r34957 r34962 55 55 56 56 #ifndef NDEBUG 57 operator const char* () const { return m_name.UTF8String().c_str(); }58 const char* toString() const { return *this; }57 operator const char* () const { return c_str(); } 58 const char* c_str() const { return m_name.UTF8String().c_str(); } 59 59 #endif 60 60 }; -
trunk/JavaScriptCore/profiler/ProfileNode.cpp
r34778 r34962 101 101 m_children.append(child.release()); 102 102 } 103 103 104 ProfileNode* ProfileNode::findChild(ProfileNode* node) const 105 { 106 for (size_t i = 0; i < m_children.size(); ++i) { 107 if (*node == m_children[i].get()) 108 return m_children[i].get(); 109 } 110 111 return 0; 112 } 113 104 114 void ProfileNode::insertNode(PassRefPtr<ProfileNode> prpNode) 105 115 { -
trunk/JavaScriptCore/profiler/ProfileNode.h
r34957 r34962 48 48 return adoptRef(new ProfileNode(callIdentifier, headNode, parentNode)); } 49 49 50 bool operator==(ProfileNode* node) { return m_callIdentifier == node->callIdentifier(); } 51 50 52 ProfileNode* willExecute(const CallIdentifier&); 51 53 ProfileNode* didExecute(); … … 53 55 void stopProfiling(); 54 56 57 // CallIdentifier members 55 58 const CallIdentifier& callIdentifier() const { return m_callIdentifier; } 56 59 ProfileNode* parent() const { return m_parent; } … … 62 65 unsigned lineNumber() const { return m_callIdentifier.m_lineNumber; } 63 66 67 // Time members 64 68 double startTime() const { return m_startTime; } 65 69 void setStartTime(double startTime) { m_startTime = startTime; } … … 79 83 void setNumberOfCalls(unsigned number) { m_numberOfCalls = number; } 80 84 85 // Children members 81 86 const Vector<RefPtr<ProfileNode> >& children() const { return m_children; } 82 87 ProfileNode* firstChild() const { return m_children.size() ? m_children.first().get() : 0; } 83 88 ProfileNode* lastChild() const { return m_children.size() ? m_children.last().get() : 0; } 89 ProfileNode* findChild(ProfileNode*) const; 84 90 void removeChild(unsigned index) { m_children.remove(index); resetChildrensSiblings(); } 85 91 void addChild(PassRefPtr<ProfileNode> prpChild); 86 92 void insertNode(PassRefPtr<ProfileNode> prpNode); 87 93 94 // Visiblity 88 95 bool visible() const { return m_visible; } 89 96 void setVisible(bool visible) { m_visible = visible; } … … 91 98 static void setTreeVisible(ProfileNode*, bool visible); 92 99 100 // Sorting 93 101 ProfileNode* traverseNextNodePostOrder() const; 94 102 ProfileNode* traverseNextNodePreOrder(bool processChildren = true) const; 95 103 96 104 void sort(bool (*)(const RefPtr<ProfileNode>&, const RefPtr<ProfileNode>&)); 97 105 void sortTotalTimeDescending() { sort(totalTimeDescendingComparator); } … … 104 112 void sortFunctionNameAscending() { sort(functionNameAscendingComparator); } 105 113 114 // Views 106 115 void calculateVisibleTotalTime(); 107 116 bool focus(const CallIdentifier&); … … 112 121 113 122 #ifndef NDEBUG 114 const char* toString() const { return m_callIdentifier; }123 const char* c_str() const { return m_callIdentifier; } 115 124 void debugPrintData(int indentLevel) const; 116 125 double debugPrintDataSampleStyle(int indentLevel, FunctionCallHashCount&) const; 117 126 #endif 127 118 128 private: 119 129 ProfileNode(const CallIdentifier&, ProfileNode* headNode, ProfileNode* parentNode);
Note:
See TracChangeset
for help on using the changeset viewer.