Commit 944b8621 authored by kmccullough@apple.com's avatar kmccullough@apple.com

JavaScriptCore:

2008-05-14  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Sam.

        <rdar://problem/5770054> JavaScript profiler (10928)
        - Rename FunctionCallProfile to ProfileNode.

        * GNUmakefile.am:
        * JavaScriptCore.exp:
        * JavaScriptCore.pri:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * JavaScriptCoreSources.bkl:
        * profiler/FunctionCallProfile.cpp: Removed.
        * profiler/FunctionCallProfile.h: Removed.
        * profiler/Profile.cpp:
        (KJS::Profile::Profile):
        (KJS::Profile::willExecute):
        * profiler/Profile.h:
        (KJS::Profile::callTree):
        * profiler/ProfileNode.cpp: Copied from profiler/FunctionCallProfile.cpp.
        (KJS::ProfileNode::ProfileNode):
        (KJS::ProfileNode::willExecute):
        (KJS::ProfileNode::didExecute):
        (KJS::ProfileNode::addChild):
        (KJS::ProfileNode::findChild):
        (KJS::ProfileNode::stopProfiling):
        (KJS::ProfileNode::selfTime):
        (KJS::ProfileNode::printDataInspectorStyle):
        (KJS::ProfileNode::printDataSampleStyle):
        (KJS::ProfileNode::endAndRecordCall):
        * profiler/ProfileNode.h: Copied from profiler/FunctionCallProfile.h.
        (KJS::ProfileNode::create):
        (KJS::ProfileNode::children):
        * profiler/Profiler.cpp:

WebCore:

2008-05-14  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Sam.

        <rdar://problem/5770054> JavaScript profiler (10928)
        - Rename FunctionCallProfile to ProfileNode

        * ForwardingHeaders/profiler/FunctionCallProfile.h: Removed.
        * ForwardingHeaders/profiler/ProfileNode.h: Copied from ForwardingHeaders/profiler/FunctionCallProfile.h.
        * GNUmakefile.am:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * WebCoreSources.bkl:
        * page/JavaScriptFunctionCallProfile.cpp: Removed.
        * page/JavaScriptFunctionCallProfile.h: Removed.
        * page/JavaScriptProfile.cpp:
        * page/JavaScriptProfileNode.cpp: Copied from page/JavaScriptFunctionCallProfile.cpp.
        (WebCore::ProfileNodeCache):
        (WebCore::getFunctionName):
        (WebCore::getTotalTime):
        (WebCore::getSelfTime):
        (WebCore::getNumberOfCalls):
        (WebCore::getChildren):
        (WebCore::finalize):
        (WebCore::ProfileNodeClass):
        (WebCore::toJS):
        * page/JavaScriptProfileNode.h: Copied from page/JavaScriptFunctionCallProfile.h.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 7c100313
2008-05-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
<rdar://problem/5770054> JavaScript profiler (10928)
- Rename FunctionCallProfile to ProfileNode.
* GNUmakefile.am:
* JavaScriptCore.exp:
* JavaScriptCore.pri:
* JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
* JavaScriptCore.xcodeproj/project.pbxproj:
* JavaScriptCoreSources.bkl:
* profiler/FunctionCallProfile.cpp: Removed.
* profiler/FunctionCallProfile.h: Removed.
* profiler/Profile.cpp:
(KJS::Profile::Profile):
(KJS::Profile::willExecute):
* profiler/Profile.h:
(KJS::Profile::callTree):
* profiler/ProfileNode.cpp: Copied from profiler/FunctionCallProfile.cpp.
(KJS::ProfileNode::ProfileNode):
(KJS::ProfileNode::willExecute):
(KJS::ProfileNode::didExecute):
(KJS::ProfileNode::addChild):
(KJS::ProfileNode::findChild):
(KJS::ProfileNode::stopProfiling):
(KJS::ProfileNode::selfTime):
(KJS::ProfileNode::printDataInspectorStyle):
(KJS::ProfileNode::printDataSampleStyle):
(KJS::ProfileNode::endAndRecordCall):
* profiler/ProfileNode.h: Copied from profiler/FunctionCallProfile.h.
(KJS::ProfileNode::create):
(KJS::ProfileNode::children):
* profiler/Profiler.cpp:
2008-05-14 Kevin McCullough <kmccullough@apple.com> 2008-05-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by John. Reviewed by John.
......
...@@ -43,7 +43,7 @@ javascriptcore_sources += \ ...@@ -43,7 +43,7 @@ javascriptcore_sources += \
JavaScriptCore/pcre/pcre_tables.cpp \ JavaScriptCore/pcre/pcre_tables.cpp \
JavaScriptCore/pcre/pcre_ucp_searchfuncs.cpp \ JavaScriptCore/pcre/pcre_ucp_searchfuncs.cpp \
JavaScriptCore/pcre/pcre_xclass.cpp \ JavaScriptCore/pcre/pcre_xclass.cpp \
JavaScriptCore/profiler/FunctionCallProfile.cpp \ JavaScriptCore/profiler/ProfileNode.cpp \
JavaScriptCore/profiler/Profile.cpp \ JavaScriptCore/profiler/Profile.cpp \
JavaScriptCore/profiler/Profiler.cpp \ JavaScriptCore/profiler/Profiler.cpp \
JavaScriptCore/wtf/Assertions.cpp \ JavaScriptCore/wtf/Assertions.cpp \
......
...@@ -219,7 +219,7 @@ __ZN3WTF15ThreadConditionC1Ev ...@@ -219,7 +219,7 @@ __ZN3WTF15ThreadConditionC1Ev
__ZN3WTF15ThreadConditionD1Ev __ZN3WTF15ThreadConditionD1Ev
__ZN3WTF16callOnMainThreadEPFvPvES0_ __ZN3WTF16callOnMainThreadEPFvPvES0_
__ZN3WTF16fastZeroedMallocEm __ZN3WTF16fastZeroedMallocEm
__ZN3WTF19initializeThreadingEv __ZN3WTF19initializeThreadingEv
__ZN3WTF23waitForThreadCompletionEjPPv __ZN3WTF23waitForThreadCompletionEjPPv
__ZN3WTF28setMainThreadCallbacksPausedEb __ZN3WTF28setMainThreadCallbacksPausedEb
__ZN3WTF32atomicallyInitializedStaticMutexE __ZN3WTF32atomicallyInitializedStaticMutexE
...@@ -233,6 +233,7 @@ __ZN3WTF8Collator18setOrderLowerFirstEb ...@@ -233,6 +233,7 @@ __ZN3WTF8Collator18setOrderLowerFirstEb
__ZN3WTF8CollatorC1EPKc __ZN3WTF8CollatorC1EPKc
__ZN3WTF8CollatorD1Ev __ZN3WTF8CollatorD1Ev
__ZN3WTF8fastFreeEPv __ZN3WTF8fastFreeEPv
__ZNK3KJS11ProfileNode8selfTimeEv
__ZNK3KJS11PropertyMap3getERKNS_10IdentifierE __ZNK3KJS11PropertyMap3getERKNS_10IdentifierE
__ZNK3KJS12DateInstance7getTimeERdRi __ZNK3KJS12DateInstance7getTimeERdRi
__ZNK3KJS13ArrayInstance7getItemEj __ZNK3KJS13ArrayInstance7getItemEj
...@@ -240,7 +241,6 @@ __ZNK3KJS14JSGlobalObject14isDynamicScopeEv ...@@ -240,7 +241,6 @@ __ZNK3KJS14JSGlobalObject14isDynamicScopeEv
__ZNK3KJS14JSGlobalObject14toGlobalObjectEPNS_9ExecStateE __ZNK3KJS14JSGlobalObject14toGlobalObjectEPNS_9ExecStateE
__ZNK3KJS16JSVariableObject16isVariableObjectEv __ZNK3KJS16JSVariableObject16isVariableObjectEv
__ZNK3KJS16JSVariableObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj __ZNK3KJS16JSVariableObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj
__ZNK3KJS19FunctionCallProfile8selfTimeEv
__ZNK3KJS19InternalFunctionImp14implementsCallEv __ZNK3KJS19InternalFunctionImp14implementsCallEv
__ZNK3KJS19InternalFunctionImp21implementsHasInstanceEv __ZNK3KJS19InternalFunctionImp21implementsHasInstanceEv
__ZNK3KJS4List8getSliceEiRS0_ __ZNK3KJS4List8getSliceEiRS0_
......
...@@ -98,7 +98,7 @@ SOURCES += \ ...@@ -98,7 +98,7 @@ SOURCES += \
kjs/string_object.cpp \ kjs/string_object.cpp \
kjs/ustring.cpp \ kjs/ustring.cpp \
kjs/value.cpp \ kjs/value.cpp \
profiler/FunctionCallProfile.cpp \ profiler/ProfileNode.cpp \
profiler/Profile.cpp \ profiler/Profile.cpp \
profiler/Profiler.cpp \ profiler/Profiler.cpp \
wtf/FastMalloc.cpp wtf/FastMalloc.cpp
......
...@@ -882,11 +882,11 @@ ...@@ -882,11 +882,11 @@
Name="Profiler" Name="Profiler"
> >
<File <File
RelativePath="..\..\profiler\FunctionCallProfile.cpp" RelativePath="..\..\profiler\ProfileNode.cpp"
> >
</File> </File>
<File <File
RelativePath="..\..\profiler\FunctionCallProfile.h" RelativePath="..\..\profiler\ProfileNode.h"
> >
</File> </File>
<File <File
......
...@@ -191,8 +191,8 @@ ...@@ -191,8 +191,8 @@
958D85830DC93230008ABF27 /* StrHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 958D85820DC93230008ABF27 /* StrHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; 958D85830DC93230008ABF27 /* StrHash.h in Headers */ = {isa = PBXBuildFile; fileRef = 958D85820DC93230008ABF27 /* StrHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */; }; 95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */; };
95AB83480DA432EB00BC83F3 /* Profiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB832F0DA42CAD00BC83F3 /* Profiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 95AB83480DA432EB00BC83F3 /* Profiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB832F0DA42CAD00BC83F3 /* Profiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
95AB83560DA43C3000BC83F3 /* FunctionCallProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB83540DA43B4400BC83F3 /* FunctionCallProfile.cpp */; }; 95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */; };
95AB83570DA43C3000BC83F3 /* FunctionCallProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB83550DA43B4400BC83F3 /* FunctionCallProfile.h */; settings = {ATTRIBUTES = (Private, ); }; }; 95AB83570DA43C3000BC83F3 /* ProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB83550DA43B4400BC83F3 /* ProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
95C18D490C90E82600E72F73 /* JSRetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; 95C18D490C90E82600E72F73 /* JSRetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
A8E894320CD0602400367179 /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; }; A8E894320CD0602400367179 /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; };
A8E894340CD0603F00367179 /* JSGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894330CD0603F00367179 /* JSGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; }; A8E894340CD0603F00367179 /* JSGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894330CD0603F00367179 /* JSGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
...@@ -502,8 +502,8 @@ ...@@ -502,8 +502,8 @@
958D85820DC93230008ABF27 /* StrHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StrHash.h; sourceTree = "<group>"; }; 958D85820DC93230008ABF27 /* StrHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StrHash.h; sourceTree = "<group>"; };
95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Profiler.cpp; path = profiler/Profiler.cpp; sourceTree = "<group>"; }; 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Profiler.cpp; path = profiler/Profiler.cpp; sourceTree = "<group>"; };
95AB832F0DA42CAD00BC83F3 /* Profiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Profiler.h; path = profiler/Profiler.h; sourceTree = "<group>"; }; 95AB832F0DA42CAD00BC83F3 /* Profiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Profiler.h; path = profiler/Profiler.h; sourceTree = "<group>"; };
95AB83540DA43B4400BC83F3 /* FunctionCallProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FunctionCallProfile.cpp; path = profiler/FunctionCallProfile.cpp; sourceTree = "<group>"; }; 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProfileNode.cpp; path = profiler/ProfileNode.cpp; sourceTree = "<group>"; };
95AB83550DA43B4400BC83F3 /* FunctionCallProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionCallProfile.h; path = profiler/FunctionCallProfile.h; sourceTree = "<group>"; }; 95AB83550DA43B4400BC83F3 /* ProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfileNode.h; path = profiler/ProfileNode.h; sourceTree = "<group>"; };
95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRetainPtr.h; sourceTree = "<group>"; }; 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRetainPtr.h; sourceTree = "<group>"; };
A785E3030D9341AB00953772 /* ExecStateInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecStateInlines.h; sourceTree = "<group>"; }; A785E3030D9341AB00953772 /* ExecStateInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecStateInlines.h; sourceTree = "<group>"; };
A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackObjectFunctions.h; sourceTree = "<group>"; }; A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCallbackObjectFunctions.h; sourceTree = "<group>"; };
...@@ -976,8 +976,8 @@ ...@@ -976,8 +976,8 @@
95AB831A0DA42C6900BC83F3 /* profiler */ = { 95AB831A0DA42C6900BC83F3 /* profiler */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
95AB83540DA43B4400BC83F3 /* FunctionCallProfile.cpp */, 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */,
95AB83550DA43B4400BC83F3 /* FunctionCallProfile.h */, 95AB83550DA43B4400BC83F3 /* ProfileNode.h */,
95742F630DD11F5A000917FB /* Profile.cpp */, 95742F630DD11F5A000917FB /* Profile.cpp */,
95742F640DD11F5A000917FB /* Profile.h */, 95742F640DD11F5A000917FB /* Profile.h */,
95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */, 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */,
...@@ -1149,7 +1149,7 @@ ...@@ -1149,7 +1149,7 @@
E1A862AB0D7EBB7D001EC6AA /* Collator.h in Headers */, E1A862AB0D7EBB7D001EC6AA /* Collator.h in Headers */,
E17863400D9BEC0000D74E75 /* InitializeThreading.h in Headers */, E17863400D9BEC0000D74E75 /* InitializeThreading.h in Headers */,
95AB83480DA432EB00BC83F3 /* Profiler.h in Headers */, 95AB83480DA432EB00BC83F3 /* Profiler.h in Headers */,
95AB83570DA43C3000BC83F3 /* FunctionCallProfile.h in Headers */, 95AB83570DA43C3000BC83F3 /* ProfileNode.h in Headers */,
E1B7C8BE0DA3A3360074B0DC /* ThreadSpecific.h in Headers */, E1B7C8BE0DA3A3360074B0DC /* ThreadSpecific.h in Headers */,
06D358B20DAADA93003B174E /* MainThread.h in Headers */, 06D358B20DAADA93003B174E /* MainThread.h in Headers */,
958D85830DC93230008ABF27 /* StrHash.h in Headers */, 958D85830DC93230008ABF27 /* StrHash.h in Headers */,
...@@ -1409,7 +1409,7 @@ ...@@ -1409,7 +1409,7 @@
E1A862D60D7F2B5C001EC6AA /* CollatorDefault.cpp in Sources */, E1A862D60D7F2B5C001EC6AA /* CollatorDefault.cpp in Sources */,
E178636D0D9BEEC300D74E75 /* InitializeThreading.cpp in Sources */, E178636D0D9BEEC300D74E75 /* InitializeThreading.cpp in Sources */,
95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */, 95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */,
95AB83560DA43C3000BC83F3 /* FunctionCallProfile.cpp in Sources */, 95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
06D358B30DAADAA4003B174E /* MainThread.cpp in Sources */, 06D358B30DAADAA4003B174E /* MainThread.cpp in Sources */,
06D358B40DAADAAA003B174E /* MainThreadMac.mm in Sources */, 06D358B40DAADAAA003B174E /* MainThreadMac.mm in Sources */,
95742F650DD11F5A000917FB /* Profile.cpp in Sources */, 95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
......
...@@ -95,7 +95,7 @@ Source files for JSCore. ...@@ -95,7 +95,7 @@ Source files for JSCore.
pcre/pcre_xclass.cpp pcre/pcre_xclass.cpp
</set> </set>
<set append="1" var="PROFILER_SOURCES"> <set append="1" var="PROFILER_SOURCES">
profiler/FunctionCallProfile.cpp profiler/ProfileNode.cpp
profiler/Profile.cpp profiler/Profile.cpp
profiler/Profiler.cpp profiler/Profiler.cpp
</set> </set>
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#include "config.h" #include "config.h"
#include "Profile.h" #include "Profile.h"
#include "FunctionCallProfile.h" #include "ProfileNode.h"
#include "JSGlobalObject.h" #include "JSGlobalObject.h"
#include "ExecState.h" #include "ExecState.h"
#include "function.h" #include "function.h"
...@@ -42,13 +42,13 @@ Profile::Profile(const UString& title) ...@@ -42,13 +42,13 @@ Profile::Profile(const UString& title)
{ {
// FIXME: When multi-threading is supported this will be a vector and calls // 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. // into the profiler will need to know which thread it is executing on.
m_callTree = FunctionCallProfile::create("Thread_1"); m_callTree = ProfileNode::create("Thread_1");
} }
void Profile::willExecute(const Vector<UString>& callStackNames) void Profile::willExecute(const Vector<UString>& callStackNames)
{ {
RefPtr<FunctionCallProfile> callTreeInsertionPoint; RefPtr<ProfileNode> callTreeInsertionPoint;
RefPtr<FunctionCallProfile> foundNameInTree = m_callTree; RefPtr<ProfileNode> foundNameInTree = m_callTree;
NameIterator callStackLocation = callStackNames.begin(); NameIterator callStackLocation = callStackNames.begin();
while (callStackLocation != callStackNames.end() && foundNameInTree) { while (callStackLocation != callStackNames.end() && foundNameInTree) {
...@@ -59,8 +59,8 @@ void Profile::willExecute(const Vector<UString>& callStackNames) ...@@ -59,8 +59,8 @@ void Profile::willExecute(const Vector<UString>& callStackNames)
if (!foundNameInTree) { // Insert remains of the stack into the call tree. if (!foundNameInTree) { // Insert remains of the stack into the call tree.
--callStackLocation; --callStackLocation;
for (RefPtr<FunctionCallProfile> next; callStackLocation != callStackNames.end(); ++callStackLocation) { for (RefPtr<ProfileNode> next; callStackLocation != callStackNames.end(); ++callStackLocation) {
next = FunctionCallProfile::create(*callStackLocation); next = ProfileNode::create(*callStackLocation);
callTreeInsertionPoint->addChild(next); callTreeInsertionPoint->addChild(next);
callTreeInsertionPoint = next; callTreeInsertionPoint = next;
} }
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
#ifndef Profile_h #ifndef Profile_h
#define Profile_h #define Profile_h
#include "FunctionCallProfile.h" #include "ProfileNode.h"
#include <wtf/RefCounted.h> #include <wtf/RefCounted.h>
#include <wtf/RefPtr.h> #include <wtf/RefPtr.h>
...@@ -45,7 +45,7 @@ namespace KJS { ...@@ -45,7 +45,7 @@ namespace KJS {
void stopProfiling() { m_callTree->stopProfiling(); }; void stopProfiling() { m_callTree->stopProfiling(); };
const UString& title() const { return m_title; }; const UString& title() const { return m_title; };
FunctionCallProfile* callTree() const { return m_callTree.get(); }; ProfileNode* callTree() const { return m_callTree.get(); };
void printDataInspectorStyle() const; void printDataInspectorStyle() const;
void printDataSampleStyle() const; void printDataSampleStyle() const;
...@@ -57,7 +57,7 @@ namespace KJS { ...@@ -57,7 +57,7 @@ namespace KJS {
void insertStackNamesInTree(const Vector<UString>& callStackNames); void insertStackNamesInTree(const Vector<UString>& callStackNames);
RefPtr<FunctionCallProfile> m_callTree; RefPtr<ProfileNode> m_callTree;
}; };
} // namespace KJS } // namespace KJS
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
*/ */
#include "config.h" #include "config.h"
#include "FunctionCallProfile.h" #include "ProfileNode.h"
#include "Profiler.h" #include "Profiler.h"
#include "DateMath.h" #include "DateMath.h"
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
namespace KJS { namespace KJS {
FunctionCallProfile::FunctionCallProfile(const UString& name) ProfileNode::ProfileNode(const UString& name)
: m_functionName(name) : m_functionName(name)
, m_timeSum(0) , m_timeSum(0)
, m_numberOfCalls(0) , m_numberOfCalls(0)
...@@ -44,12 +44,12 @@ FunctionCallProfile::FunctionCallProfile(const UString& name) ...@@ -44,12 +44,12 @@ FunctionCallProfile::FunctionCallProfile(const UString& name)
m_startTime = getCurrentUTCTime(); m_startTime = getCurrentUTCTime();
} }
void FunctionCallProfile::willExecute() void ProfileNode::willExecute()
{ {
m_startTime = getCurrentUTCTime(); m_startTime = getCurrentUTCTime();
} }
void FunctionCallProfile::didExecute(Vector<UString> stackNames, unsigned int stackIndex) void ProfileNode::didExecute(Vector<UString> stackNames, unsigned int stackIndex)
{ {
if (stackIndex && stackIndex == stackNames.size()) { if (stackIndex && stackIndex == stackNames.size()) {
ASSERT(stackNames[stackIndex - 1] == m_functionName); ASSERT(stackNames[stackIndex - 1] == m_functionName);
...@@ -65,11 +65,11 @@ void FunctionCallProfile::didExecute(Vector<UString> stackNames, unsigned int st ...@@ -65,11 +65,11 @@ void FunctionCallProfile::didExecute(Vector<UString> stackNames, unsigned int st
} }
} }
void FunctionCallProfile::addChild(PassRefPtr<FunctionCallProfile> prpChild) void ProfileNode::addChild(PassRefPtr<ProfileNode> prpChild)
{ {
ASSERT(prpChild); ASSERT(prpChild);
RefPtr<FunctionCallProfile> child = prpChild; RefPtr<ProfileNode> child = prpChild;
for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) { for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) {
if ((*currentChild)->functionName() == child->functionName()) if ((*currentChild)->functionName() == child->functionName())
return; return;
...@@ -78,7 +78,7 @@ void FunctionCallProfile::addChild(PassRefPtr<FunctionCallProfile> prpChild) ...@@ -78,7 +78,7 @@ void FunctionCallProfile::addChild(PassRefPtr<FunctionCallProfile> prpChild)
m_children.append(child.release()); m_children.append(child.release());
} }
FunctionCallProfile* FunctionCallProfile::findChild(const UString& name) ProfileNode* ProfileNode::findChild(const UString& name)
{ {
for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) { for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) {
if ((*currentChild)->functionName() == name) if ((*currentChild)->functionName() == name)
...@@ -88,7 +88,7 @@ FunctionCallProfile* FunctionCallProfile::findChild(const UString& name) ...@@ -88,7 +88,7 @@ FunctionCallProfile* FunctionCallProfile::findChild(const UString& name)
return 0; return 0;
} }
void FunctionCallProfile::stopProfiling() void ProfileNode::stopProfiling()
{ {
if (m_startTime) if (m_startTime)
endAndRecordCall(); endAndRecordCall();
...@@ -98,7 +98,7 @@ void FunctionCallProfile::stopProfiling() ...@@ -98,7 +98,7 @@ void FunctionCallProfile::stopProfiling()
(*it)->stopProfiling(); (*it)->stopProfiling();
} }
double FunctionCallProfile::selfTime() const double ProfileNode::selfTime() const
{ {
double sumChildrenTime = 0.0; double sumChildrenTime = 0.0;
...@@ -110,7 +110,7 @@ double FunctionCallProfile::selfTime() const ...@@ -110,7 +110,7 @@ double FunctionCallProfile::selfTime() const
return m_timeSum - sumChildrenTime; return m_timeSum - sumChildrenTime;
} }
void FunctionCallProfile::printDataInspectorStyle(int indentLevel) const void ProfileNode::printDataInspectorStyle(int indentLevel) const
{ {
// Print function names // Print function names
if (indentLevel) { if (indentLevel) {
...@@ -129,7 +129,7 @@ void FunctionCallProfile::printDataInspectorStyle(int indentLevel) const ...@@ -129,7 +129,7 @@ void FunctionCallProfile::printDataInspectorStyle(int indentLevel) const
} }
// print the profiled data in a format that matches the tool sample's output. // print the profiled data in a format that matches the tool sample's output.
double FunctionCallProfile::printDataSampleStyle(int indentLevel, FunctionCallHashCount& countedFunctions) const double ProfileNode::printDataSampleStyle(int indentLevel, FunctionCallHashCount& countedFunctions) const
{ {
printf(" "); printf(" ");
...@@ -166,7 +166,7 @@ double FunctionCallProfile::printDataSampleStyle(int indentLevel, FunctionCallHa ...@@ -166,7 +166,7 @@ double FunctionCallProfile::printDataSampleStyle(int indentLevel, FunctionCallHa
return m_timeSum; return m_timeSum;
} }
void FunctionCallProfile::endAndRecordCall() void ProfileNode::endAndRecordCall()
{ {
m_timeSum += getCurrentUTCTime() - m_startTime; m_timeSum += getCurrentUTCTime() - m_startTime;
m_startTime = 0.0; m_startTime = 0.0;
......
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifndef FunctionCallProfile_h #ifndef ProfileNode_h
#define FunctionCallProfile_h #define ProfileNode_h
#include <kjs/ustring.h> #include <kjs/ustring.h>
#include <wtf/Deque.h> #include <wtf/Deque.h>
...@@ -37,20 +37,20 @@ ...@@ -37,20 +37,20 @@
namespace KJS { namespace KJS {
class FunctionCallProfile; class ProfileNode;
typedef Deque<RefPtr<FunctionCallProfile> >::const_iterator StackIterator; typedef Deque<RefPtr<ProfileNode> >::const_iterator StackIterator;
typedef HashCountedSet<UString::Rep*> FunctionCallHashCount; typedef HashCountedSet<UString::Rep*> FunctionCallHashCount;
class FunctionCallProfile : public RefCounted<FunctionCallProfile> { class ProfileNode : public RefCounted<ProfileNode> {
public: public:
static PassRefPtr<FunctionCallProfile> create(const UString& name) { return adoptRef(new FunctionCallProfile(name)); } static PassRefPtr<ProfileNode> create(const UString& name) { return adoptRef(new ProfileNode(name)); }
void willExecute(); void willExecute();
void didExecute(Vector<UString> stackNames, unsigned int stackIndex); void didExecute(Vector<UString> stackNames, unsigned int stackIndex);
void addChild(PassRefPtr<FunctionCallProfile> prpChild); void addChild(PassRefPtr<ProfileNode> prpChild);
FunctionCallProfile* findChild(const UString& name); ProfileNode* findChild(const UString& name);
void stopProfiling(); void stopProfiling();
...@@ -58,13 +58,13 @@ namespace KJS { ...@@ -58,13 +58,13 @@ namespace KJS {
double totalTime() const { return m_timeSum; } double totalTime() const { return m_timeSum; }
double selfTime() const; double selfTime() const;
unsigned numberOfCalls() const { return m_numberOfCalls; } unsigned numberOfCalls() const { return m_numberOfCalls; }
const Deque<RefPtr<FunctionCallProfile> >& children() { return m_children; } const Deque<RefPtr<ProfileNode> >& children() { return m_children; }
void printDataInspectorStyle(int indentLevel) const; void printDataInspectorStyle(int indentLevel) const;
double printDataSampleStyle(int indentLevel, FunctionCallHashCount&) const; double printDataSampleStyle(int indentLevel, FunctionCallHashCount&) const;
private: private:
FunctionCallProfile(const UString& name); ProfileNode(const UString& name);
void endAndRecordCall(); void endAndRecordCall();
...@@ -73,9 +73,9 @@ namespace KJS { ...@@ -73,9 +73,9 @@ namespace KJS {
double m_startTime; double m_startTime;
unsigned m_numberOfCalls; unsigned m_numberOfCalls;
Deque<RefPtr<FunctionCallProfile> > m_children; Deque<RefPtr<ProfileNode> > m_children;
}; };
} // namespace KJS } // namespace KJS
#endif // FunctionCallProfile_h #endif // ProfileNode_h
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include "ExecState.h" #include "ExecState.h"
#include "function.h" #include "function.h"
#include "FunctionCallProfile.h" #include "ProfileNode.h"
#include "JSGlobalObject.h" #include "JSGlobalObject.h"
#include "Profile.h" #include "Profile.h"
......
2008-05-14 Kevin McCullough <kmccullough@apple.com>
Reviewed by Sam.
<rdar://problem/5770054> JavaScript profiler (10928)
- Rename FunctionCallProfile to ProfileNode
* ForwardingHeaders/profiler/FunctionCallProfile.h: Removed.
* ForwardingHeaders/profiler/ProfileNode.h: Copied from ForwardingHeaders/profiler/FunctionCallProfile.h.
* GNUmakefile.am:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* WebCoreSources.bkl:
* page/JavaScriptFunctionCallProfile.cpp: Removed.
* page/JavaScriptFunctionCallProfile.h: Removed.
* page/JavaScriptProfile.cpp:
* page/JavaScriptProfileNode.cpp: Copied from page/JavaScriptFunctionCallProfile.cpp.
(WebCore::ProfileNodeCache):
(WebCore::getFunctionName):
(WebCore::getTotalTime):
(WebCore::getSelfTime):
(WebCore::getNumberOfCalls):
(WebCore::getChildren):
(WebCore::finalize):
(WebCore::ProfileNodeClass):
(WebCore::toJS):
* page/JavaScriptProfileNode.h: Copied from page/JavaScriptFunctionCallProfile.h.
2008-05-13 Beth Dakin <bdakin@apple.com> 2008-05-13 Beth Dakin <bdakin@apple.com>
Reviewed by Brady. Reviewed by Brady.