2008-06-05 Kevin McCullough <kmccullough@apple.com>
authorkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jun 2008 00:33:28 +0000 (00:33 +0000)
committerkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Jun 2008 00:33:28 +0000 (00:33 +0000)
        Reviewed by Jon.

        - Name changes.

        * JavaScriptCore.exp:
        * profiler/Profile.cpp:
        (KJS::Profile::Profile):
        (KJS::Profile::stopProfiling):
        (KJS::Profile::didExecute):
        (KJS::Profile::forEach):
        (KJS::Profile::debugPrintData):
        (KJS::Profile::debugPrintDataSampleStyle):
        * profiler/Profile.h:
        (KJS::Profile::callTree):
        (KJS::Profile::totalTime):
        (KJS::Profile::sortTotalTimeDescending):
        (KJS::Profile::sortTotalTimeAscending):
        (KJS::Profile::sortSelfTimeDescending):
        (KJS::Profile::sortSelfTimeAscending):
        (KJS::Profile::sortCallsDescending):
        (KJS::Profile::sortCallsAscending):
        (KJS::Profile::sortFunctionNameDescending):
        (KJS::Profile::sortFunctionNameAscending):
        (KJS::Profile::focus):
        (KJS::Profile::exclude):
        (KJS::Profile::restoreAll):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34392 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/profiler/Profile.cpp
JavaScriptCore/profiler/Profile.h

index 8ed08d7040a3f346bfa65a20ee0ec00bf494e5e0..479cd3ec83abd10f456f401a03114a8a2c4b52ab 100644 (file)
@@ -1,3 +1,32 @@
+2008-06-05  Kevin McCullough  <kmccullough@apple.com>
+
+        Reviewed by Jon.
+
+        - Name changes.
+
+        * JavaScriptCore.exp:
+        * profiler/Profile.cpp:
+        (KJS::Profile::Profile):
+        (KJS::Profile::stopProfiling):
+        (KJS::Profile::didExecute):
+        (KJS::Profile::forEach):
+        (KJS::Profile::debugPrintData):
+        (KJS::Profile::debugPrintDataSampleStyle):
+        * profiler/Profile.h:
+        (KJS::Profile::callTree):
+        (KJS::Profile::totalTime):
+        (KJS::Profile::sortTotalTimeDescending):
+        (KJS::Profile::sortTotalTimeAscending):
+        (KJS::Profile::sortSelfTimeDescending):
+        (KJS::Profile::sortSelfTimeAscending):
+        (KJS::Profile::sortCallsDescending):
+        (KJS::Profile::sortCallsAscending):
+        (KJS::Profile::sortFunctionNameDescending):
+        (KJS::Profile::sortFunctionNameAscending):
+        (KJS::Profile::focus):
+        (KJS::Profile::exclude):
+        (KJS::Profile::restoreAll):
+
 2008-06-05  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Stephanie Lewis.
index 1d2cec302bfc65e8035c6b6346668834f2658589..cf5ce5281098523a85a113a8c4d5f65889fab4b7 100644 (file)
@@ -88,7 +88,7 @@ __ZN3KJS6strtodEPKcPPc
 __ZN3KJS7CStringaSERKS0_
 __ZN3KJS7CStringD1Ev
 __ZN3KJS7Machine13dumpCallFrameEPKNS_9CodeBlockEPNS_14ScopeChainNodeEPNS_12RegisterFileEPKNS_8RegisterE
-__ZN3KJS7Profile4sortEPFvPNS_11ProfileNodeEE
+__ZN3KJS7Profile7forEachEPFvPNS_11ProfileNodeEE
 __ZN3KJS7UString3Rep11computeHashEPKti
 __ZN3KJS7UString3Rep4nullE
 __ZN3KJS7UString3Rep7destroyEv
index 12dea44d6a20176733426a2eceaeb37326e2fe73..6705ba23fbba36ba9ececc8053a5fac105e4904e 100644 (file)
@@ -45,15 +45,15 @@ Profile::Profile(const UString& title, ExecState* originatingGlobalExec, unsigne
 {
     // FIXME: When multi-threading is supported this will be a vector and calls
     // into the profiler will need to know which thread it is executing on.
-    m_headNode = ProfileNode::create(CallIdentifier("Thread_1", 0, 0), 0, 0);
-    m_currentNode = m_headNode;
+    m_head = ProfileNode::create(CallIdentifier("Thread_1", 0, 0), 0, 0);
+    m_currentNode = m_head;
 }
 
 void Profile::stopProfiling()
 {
     m_currentNode = 0;
     m_originatingGlobalExec = 0;
-    m_headNode->stopProfiling();
+    m_head->stopProfiling();
     m_depth = 0;
 }
 
@@ -73,12 +73,12 @@ void Profile::didExecute(const CallIdentifier& callIdentifier)
     // In case the profiler started recording calls in the middle of a stack frame,
     // when returning up the stack it needs to insert the calls it missed on the
     // way down.
-    if (m_currentNode == m_headNode) {
-        m_currentNode = ProfileNode::create(callIdentifier, m_headNode.get(), m_headNode.get());
-        m_currentNode->setStartTime(m_headNode->startTime());
+    if (m_currentNode == m_head) {
+        m_currentNode = ProfileNode::create(callIdentifier, m_head.get(), m_head.get());
+        m_currentNode->setStartTime(m_head->startTime());
         m_currentNode->didExecute();
-        m_headNode->insertNode(m_currentNode.release());
-        m_currentNode = m_headNode;
+        m_head->insertNode(m_currentNode.release());
+        m_currentNode = m_head;
         return;
     }
 
@@ -86,16 +86,16 @@ void Profile::didExecute(const CallIdentifier& callIdentifier)
     --m_depth;
 }
 
-void Profile::sort(SortFunction function) {
+void Profile::forEach(UnaryFunction function) {
 
-    ProfileNode* currentNode = m_headNode->firstChild();
+    ProfileNode* currentNode = m_head->firstChild();
     for (ProfileNode* nextNode = currentNode; nextNode; nextNode = nextNode->firstChild())
         currentNode = nextNode;
 
-    ProfileNode* endNode = m_headNode->traverseNextNode();
+    ProfileNode* endNode = m_head->traverseNextNode();
     while (currentNode && currentNode != endNode) {
-    function(currentNode);
-    currentNode = currentNode->traverseNextNode();
+        function(currentNode);
+        currentNode = currentNode->traverseNextNode();
     } 
 }
 
@@ -103,7 +103,7 @@ void Profile::sort(SortFunction function) {
 void Profile::debugPrintData() const
 {
     printf("Call graph:\n");
-    m_headNode->debugPrintData(0);
+    m_head->debugPrintData(0);
 }
 
 typedef pair<UString::Rep*, unsigned> NameCountPair;
@@ -119,7 +119,7 @@ void Profile::debugPrintDataSampleStyle() const
 
     FunctionCallHashCount countedFunctions;
     printf("Call graph:\n");
-    m_headNode->debugPrintDataSampleStyle(0, countedFunctions);
+    m_head->debugPrintDataSampleStyle(0, countedFunctions);
 
     printf("\nTotal number in stack:\n");
     NameCountPairVector sortedFunctions(countedFunctions.size());
index ddd26456d69723b84c6bbe2aeb5e7f3568fa0bc8..40654ca0e43287c3812064bb6a7bea3efba94a72 100644 (file)
@@ -33,7 +33,7 @@
 namespace KJS {
 
     class ExecState;
-    typedef void (*SortFunction)(ProfileNode*);
+    typedef void (*UnaryFunction)(ProfileNode*);
 
     class Profile : public RefCounted<Profile> {
     public:
@@ -44,26 +44,26 @@ namespace KJS {
         void stopProfiling();
 
         const UString& title() const { return m_title; };
-        ProfileNode* callTree() const { return m_headNode.get(); };
+        ProfileNode* callTree() const { return m_head.get(); };
 
-        double totalTime() const { return m_headNode->totalTime(); }
+        double totalTime() const { return m_head->totalTime(); }
 
         ExecState* originatingGlobalExec() const { return m_originatingGlobalExec; }
         unsigned pageGroupIdentifier() const { return m_pageGroupIdentifier; }
 
-        void sort(SortFunction);
-        void sortTotalTimeDescending() { sort(ProfileNode::sortTotalTimeDescending); }
-        void sortTotalTimeAscending() { sort(ProfileNode::sortTotalTimeAscending); }
-        void sortSelfTimeDescending() { sort(ProfileNode::sortSelfTimeDescending); }
-        void sortSelfTimeAscending() { sort(ProfileNode::sortSelfTimeAscending); }
-        void sortCallsDescending() { sort(ProfileNode::sortCallsDescending); }
-        void sortCallsAscending() { sort(ProfileNode::sortCallsAscending); }
-        void sortFunctionNameDescending() { sort(ProfileNode::sortFunctionNameDescending); }
-        void sortFunctionNameAscending() { sort(ProfileNode::sortFunctionNameAscending); }
+        void forEach(UnaryFunction);
+        void sortTotalTimeDescending() { forEach(ProfileNode::sortTotalTimeDescending); }
+        void sortTotalTimeAscending() { forEach(ProfileNode::sortTotalTimeAscending); }
+        void sortSelfTimeDescending() { forEach(ProfileNode::sortSelfTimeDescending); }
+        void sortSelfTimeAscending() { forEach(ProfileNode::sortSelfTimeAscending); }
+        void sortCallsDescending() { forEach(ProfileNode::sortCallsDescending); }
+        void sortCallsAscending() { forEach(ProfileNode::sortCallsAscending); }
+        void sortFunctionNameDescending() { forEach(ProfileNode::sortFunctionNameDescending); }
+        void sortFunctionNameAscending() { forEach(ProfileNode::sortFunctionNameAscending); }
 
-        void focus(const ProfileNode* profileNode) { if (!profileNode) return; m_headNode->focus(profileNode->callIdentifier()); }
-        void exclude(const ProfileNode* profileNode) { if (!profileNode) return; m_headNode->exclude(profileNode->callIdentifier()); }
-        void restoreAll() { m_headNode->restoreAll(); }
+        void focus(const ProfileNode* profileNode) { if (!profileNode) return; m_head->focus(profileNode->callIdentifier()); }
+        void exclude(const ProfileNode* profileNode) { if (!profileNode) return; m_head->exclude(profileNode->callIdentifier()); }
+        void restoreAll() { m_head->restoreAll(); }
 
 #ifndef NDEBUG
         void debugPrintData() const;
@@ -78,7 +78,7 @@ namespace KJS {
         UString m_title;
         ExecState* m_originatingGlobalExec;
         unsigned m_pageGroupIdentifier;
-        RefPtr<ProfileNode> m_headNode;
+        RefPtr<ProfileNode> m_head;
         RefPtr<ProfileNode> m_currentNode;
         
         unsigned m_depth;