Changeset 33466 in webkit for trunk/JavaScriptCore
- Timestamp:
- May 14, 2008, 5:25:48 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 10 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r33464 r33466 1 2008-05-14 Kevin McCullough <[email protected]> 2 3 Reviewed by Sam. 4 5 <rdar://problem/5770054> JavaScript profiler (10928) 6 - Rename FunctionCallProfile to ProfileNode. 7 8 * GNUmakefile.am: 9 * JavaScriptCore.exp: 10 * JavaScriptCore.pri: 11 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj: 12 * JavaScriptCore.xcodeproj/project.pbxproj: 13 * JavaScriptCoreSources.bkl: 14 * profiler/FunctionCallProfile.cpp: Removed. 15 * profiler/FunctionCallProfile.h: Removed. 16 * profiler/Profile.cpp: 17 (KJS::Profile::Profile): 18 (KJS::Profile::willExecute): 19 * profiler/Profile.h: 20 (KJS::Profile::callTree): 21 * profiler/ProfileNode.cpp: Copied from profiler/FunctionCallProfile.cpp. 22 (KJS::ProfileNode::ProfileNode): 23 (KJS::ProfileNode::willExecute): 24 (KJS::ProfileNode::didExecute): 25 (KJS::ProfileNode::addChild): 26 (KJS::ProfileNode::findChild): 27 (KJS::ProfileNode::stopProfiling): 28 (KJS::ProfileNode::selfTime): 29 (KJS::ProfileNode::printDataInspectorStyle): 30 (KJS::ProfileNode::printDataSampleStyle): 31 (KJS::ProfileNode::endAndRecordCall): 32 * profiler/ProfileNode.h: Copied from profiler/FunctionCallProfile.h. 33 (KJS::ProfileNode::create): 34 (KJS::ProfileNode::children): 35 * profiler/Profiler.cpp: 36 1 37 2008-05-14 Kevin McCullough <[email protected]> 2 38 -
trunk/JavaScriptCore/GNUmakefile.am
r33025 r33466 44 44 JavaScriptCore/pcre/pcre_ucp_searchfuncs.cpp \ 45 45 JavaScriptCore/pcre/pcre_xclass.cpp \ 46 JavaScriptCore/profiler/ FunctionCallProfile.cpp \46 JavaScriptCore/profiler/ProfileNode.cpp \ 47 47 JavaScriptCore/profiler/Profile.cpp \ 48 48 JavaScriptCore/profiler/Profiler.cpp \ -
trunk/JavaScriptCore/JavaScriptCore.exp
r33464 r33466 220 220 __ZN3WTF16callOnMainThreadEPFvPvES0_ 221 221 __ZN3WTF16fastZeroedMallocEm 222 __ZN3WTF19initializeThreadingEv 222 __ZN3WTF19initializeThreadingEv 223 223 __ZN3WTF23waitForThreadCompletionEjPPv 224 224 __ZN3WTF28setMainThreadCallbacksPausedEb … … 234 234 __ZN3WTF8CollatorD1Ev 235 235 __ZN3WTF8fastFreeEPv 236 __ZNK3KJS11ProfileNode8selfTimeEv 236 237 __ZNK3KJS11PropertyMap3getERKNS_10IdentifierE 237 238 __ZNK3KJS12DateInstance7getTimeERdRi … … 241 242 __ZNK3KJS16JSVariableObject16isVariableObjectEv 242 243 __ZNK3KJS16JSVariableObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj 243 __ZNK3KJS19FunctionCallProfile8selfTimeEv244 244 __ZNK3KJS19InternalFunctionImp14implementsCallEv 245 245 __ZNK3KJS19InternalFunctionImp21implementsHasInstanceEv -
trunk/JavaScriptCore/JavaScriptCore.pri
r33026 r33466 99 99 kjs/ustring.cpp \ 100 100 kjs/value.cpp \ 101 profiler/ FunctionCallProfile.cpp \101 profiler/ProfileNode.cpp \ 102 102 profiler/Profile.cpp \ 103 103 profiler/Profiler.cpp \ -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
r33012 r33466 883 883 > 884 884 <File 885 RelativePath="..\..\profiler\ FunctionCallProfile.cpp"886 > 887 </File> 888 <File 889 RelativePath="..\..\profiler\ FunctionCallProfile.h"885 RelativePath="..\..\profiler\ProfileNode.cpp" 886 > 887 </File> 888 <File 889 RelativePath="..\..\profiler\ProfileNode.h" 890 890 > 891 891 </File> -
trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r33053 r33466 192 192 95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */; }; 193 193 95AB83480DA432EB00BC83F3 /* Profiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB832F0DA42CAD00BC83F3 /* Profiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 194 95AB83560DA43C3000BC83F3 /* FunctionCallProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB83540DA43B4400BC83F3 /* FunctionCallProfile.cpp */; };195 95AB83570DA43C3000BC83F3 /* FunctionCallProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB83550DA43B4400BC83F3 /* FunctionCallProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };194 95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */; }; 195 95AB83570DA43C3000BC83F3 /* ProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB83550DA43B4400BC83F3 /* ProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; }; 196 196 95C18D490C90E82600E72F73 /* JSRetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; }; 197 197 A8E894320CD0602400367179 /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; }; … … 503 503 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Profiler.cpp; path = profiler/Profiler.cpp; sourceTree = "<group>"; }; 504 504 95AB832F0DA42CAD00BC83F3 /* Profiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Profiler.h; path = profiler/Profiler.h; sourceTree = "<group>"; }; 505 95AB83540DA43B4400BC83F3 /* FunctionCallProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FunctionCallProfile.cpp; path = profiler/FunctionCallProfile.cpp; sourceTree = "<group>"; };506 95AB83550DA43B4400BC83F3 /* FunctionCallProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionCallProfile.h; path = profiler/FunctionCallProfile.h; sourceTree = "<group>"; };505 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProfileNode.cpp; path = profiler/ProfileNode.cpp; sourceTree = "<group>"; }; 506 95AB83550DA43B4400BC83F3 /* ProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfileNode.h; path = profiler/ProfileNode.h; sourceTree = "<group>"; }; 507 507 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRetainPtr.h; sourceTree = "<group>"; }; 508 508 A785E3030D9341AB00953772 /* ExecStateInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecStateInlines.h; sourceTree = "<group>"; }; … … 977 977 isa = PBXGroup; 978 978 children = ( 979 95AB83540DA43B4400BC83F3 /* FunctionCallProfile.cpp */,980 95AB83550DA43B4400BC83F3 /* FunctionCallProfile.h */,979 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */, 980 95AB83550DA43B4400BC83F3 /* ProfileNode.h */, 981 981 95742F630DD11F5A000917FB /* Profile.cpp */, 982 982 95742F640DD11F5A000917FB /* Profile.h */, … … 1150 1150 E17863400D9BEC0000D74E75 /* InitializeThreading.h in Headers */, 1151 1151 95AB83480DA432EB00BC83F3 /* Profiler.h in Headers */, 1152 95AB83570DA43C3000BC83F3 /* FunctionCallProfile.h in Headers */,1152 95AB83570DA43C3000BC83F3 /* ProfileNode.h in Headers */, 1153 1153 E1B7C8BE0DA3A3360074B0DC /* ThreadSpecific.h in Headers */, 1154 1154 06D358B20DAADA93003B174E /* MainThread.h in Headers */, … … 1410 1410 E178636D0D9BEEC300D74E75 /* InitializeThreading.cpp in Sources */, 1411 1411 95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */, 1412 95AB83560DA43C3000BC83F3 /* FunctionCallProfile.cpp in Sources */,1412 95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */, 1413 1413 06D358B30DAADAA4003B174E /* MainThread.cpp in Sources */, 1414 1414 06D358B40DAADAAA003B174E /* MainThreadMac.mm in Sources */, -
trunk/JavaScriptCore/JavaScriptCoreSources.bkl
r33026 r33466 96 96 </set> 97 97 <set append="1" var="PROFILER_SOURCES"> 98 profiler/ FunctionCallProfile.cpp98 profiler/ProfileNode.cpp 99 99 profiler/Profile.cpp 100 100 profiler/Profiler.cpp -
trunk/JavaScriptCore/profiler/Profile.cpp
r33382 r33466 27 27 #include "Profile.h" 28 28 29 #include " FunctionCallProfile.h"29 #include "ProfileNode.h" 30 30 #include "JSGlobalObject.h" 31 31 #include "ExecState.h" … … 43 43 // FIXME: When multi-threading is supported this will be a vector and calls 44 44 // into the profiler will need to know which thread it is executing on. 45 m_callTree = FunctionCallProfile::create("Thread_1");45 m_callTree = ProfileNode::create("Thread_1"); 46 46 } 47 47 48 48 void Profile::willExecute(const Vector<UString>& callStackNames) 49 49 { 50 RefPtr< FunctionCallProfile> callTreeInsertionPoint;51 RefPtr< FunctionCallProfile> foundNameInTree = m_callTree;50 RefPtr<ProfileNode> callTreeInsertionPoint; 51 RefPtr<ProfileNode> foundNameInTree = m_callTree; 52 52 NameIterator callStackLocation = callStackNames.begin(); 53 53 … … 60 60 if (!foundNameInTree) { // Insert remains of the stack into the call tree. 61 61 --callStackLocation; 62 for (RefPtr< FunctionCallProfile> next; callStackLocation != callStackNames.end(); ++callStackLocation) {63 next = FunctionCallProfile::create(*callStackLocation);62 for (RefPtr<ProfileNode> next; callStackLocation != callStackNames.end(); ++callStackLocation) { 63 next = ProfileNode::create(*callStackLocation); 64 64 callTreeInsertionPoint->addChild(next); 65 65 callTreeInsertionPoint = next; -
trunk/JavaScriptCore/profiler/Profile.h
r33388 r33466 27 27 #define Profile_h 28 28 29 #include " FunctionCallProfile.h"29 #include "ProfileNode.h" 30 30 #include <wtf/RefCounted.h> 31 31 #include <wtf/RefPtr.h> … … 46 46 void stopProfiling() { m_callTree->stopProfiling(); }; 47 47 const UString& title() const { return m_title; }; 48 FunctionCallProfile* callTree() const { return m_callTree.get(); };48 ProfileNode* callTree() const { return m_callTree.get(); }; 49 49 50 50 void printDataInspectorStyle() const; … … 58 58 void insertStackNamesInTree(const Vector<UString>& callStackNames); 59 59 60 RefPtr< FunctionCallProfile> m_callTree;60 RefPtr<ProfileNode> m_callTree; 61 61 }; 62 62 -
trunk/JavaScriptCore/profiler/ProfileNode.cpp
r33464 r33466 28 28 29 29 #include "config.h" 30 #include " FunctionCallProfile.h"30 #include "ProfileNode.h" 31 31 32 32 #include "Profiler.h" … … 37 37 namespace KJS { 38 38 39 FunctionCallProfile::FunctionCallProfile(const UString& name)39 ProfileNode::ProfileNode(const UString& name) 40 40 : m_functionName(name) 41 41 , m_timeSum(0) … … 45 45 } 46 46 47 void FunctionCallProfile::willExecute()47 void ProfileNode::willExecute() 48 48 { 49 49 m_startTime = getCurrentUTCTime(); 50 50 } 51 51 52 void FunctionCallProfile::didExecute(Vector<UString> stackNames, unsigned int stackIndex)52 void ProfileNode::didExecute(Vector<UString> stackNames, unsigned int stackIndex) 53 53 { 54 54 if (stackIndex && stackIndex == stackNames.size()) { … … 66 66 } 67 67 68 void FunctionCallProfile::addChild(PassRefPtr<FunctionCallProfile> prpChild)68 void ProfileNode::addChild(PassRefPtr<ProfileNode> prpChild) 69 69 { 70 70 ASSERT(prpChild); 71 71 72 RefPtr< FunctionCallProfile> child = prpChild;72 RefPtr<ProfileNode> child = prpChild; 73 73 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) { 74 74 if ((*currentChild)->functionName() == child->functionName()) … … 79 79 } 80 80 81 FunctionCallProfile* FunctionCallProfile::findChild(const UString& name)81 ProfileNode* ProfileNode::findChild(const UString& name) 82 82 { 83 83 for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) { … … 89 89 } 90 90 91 void FunctionCallProfile::stopProfiling()91 void ProfileNode::stopProfiling() 92 92 { 93 93 if (m_startTime) … … 99 99 } 100 100 101 double FunctionCallProfile::selfTime() const101 double ProfileNode::selfTime() const 102 102 { 103 103 double sumChildrenTime = 0.0; … … 111 111 } 112 112 113 void FunctionCallProfile::printDataInspectorStyle(int indentLevel) const113 void ProfileNode::printDataInspectorStyle(int indentLevel) const 114 114 { 115 115 // Print function names … … 130 130 131 131 // print the profiled data in a format that matches the tool sample's output. 132 double FunctionCallProfile::printDataSampleStyle(int indentLevel, FunctionCallHashCount& countedFunctions) const132 double ProfileNode::printDataSampleStyle(int indentLevel, FunctionCallHashCount& countedFunctions) const 133 133 { 134 134 printf(" "); … … 167 167 } 168 168 169 void FunctionCallProfile::endAndRecordCall()169 void ProfileNode::endAndRecordCall() 170 170 { 171 171 m_timeSum += getCurrentUTCTime() - m_startTime; -
trunk/JavaScriptCore/profiler/ProfileNode.h
r33464 r33466 27 27 */ 28 28 29 #ifndef FunctionCallProfile_h30 #define FunctionCallProfile_h29 #ifndef ProfileNode_h 30 #define ProfileNode_h 31 31 32 32 #include <kjs/ustring.h> … … 38 38 namespace KJS { 39 39 40 class FunctionCallProfile;40 class ProfileNode; 41 41 42 typedef Deque<RefPtr< FunctionCallProfile> >::const_iterator StackIterator;42 typedef Deque<RefPtr<ProfileNode> >::const_iterator StackIterator; 43 43 typedef HashCountedSet<UString::Rep*> FunctionCallHashCount; 44 44 45 class FunctionCallProfile : public RefCounted<FunctionCallProfile> {45 class ProfileNode : public RefCounted<ProfileNode> { 46 46 public: 47 static PassRefPtr< FunctionCallProfile> create(const UString& name) { return adoptRef(new FunctionCallProfile(name)); }47 static PassRefPtr<ProfileNode> create(const UString& name) { return adoptRef(new ProfileNode(name)); } 48 48 49 49 void willExecute(); 50 50 void didExecute(Vector<UString> stackNames, unsigned int stackIndex); 51 51 52 void addChild(PassRefPtr< FunctionCallProfile> prpChild);53 FunctionCallProfile* findChild(const UString& name);52 void addChild(PassRefPtr<ProfileNode> prpChild); 53 ProfileNode* findChild(const UString& name); 54 54 55 55 void stopProfiling(); … … 59 59 double selfTime() const; 60 60 unsigned numberOfCalls() const { return m_numberOfCalls; } 61 const Deque<RefPtr< FunctionCallProfile> >& children() { return m_children; }61 const Deque<RefPtr<ProfileNode> >& children() { return m_children; } 62 62 63 63 void printDataInspectorStyle(int indentLevel) const; … … 65 65 66 66 private: 67 FunctionCallProfile(const UString& name);67 ProfileNode(const UString& name); 68 68 69 69 void endAndRecordCall(); … … 74 74 unsigned m_numberOfCalls; 75 75 76 Deque<RefPtr< FunctionCallProfile> > m_children;76 Deque<RefPtr<ProfileNode> > m_children; 77 77 }; 78 78 79 79 } // namespace KJS 80 80 81 #endif // FunctionCallProfile_h81 #endif // ProfileNode_h -
trunk/JavaScriptCore/profiler/Profiler.cpp
r33382 r33466 32 32 #include "ExecState.h" 33 33 #include "function.h" 34 #include " FunctionCallProfile.h"34 #include "ProfileNode.h" 35 35 #include "JSGlobalObject.h" 36 36 #include "Profile.h"
Note:
See TracChangeset
for help on using the changeset viewer.