Changeset 35756 in webkit for trunk/JavaScriptCore
- Timestamp:
- Aug 14, 2008, 11:11:20 AM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r35750 r35756 1 2008-08-14 Kevin McCullough <[email protected]> 2 3 Reviewed by Tim. 4 5 <rdar://problem/6115819> Notify of profile in console 6 - Profiles now have a unique ID so that they can be linked to the 7 console message that announces that a profile completed. 8 9 * profiler/HeavyProfile.cpp: 10 (KJS::HeavyProfile::HeavyProfile): 11 * profiler/Profile.cpp: 12 (KJS::Profile::create): 13 (KJS::Profile::Profile): 14 * profiler/Profile.h: 15 (KJS::Profile::uid): 16 * profiler/ProfileGenerator.cpp: 17 (KJS::ProfileGenerator::create): 18 (KJS::ProfileGenerator::ProfileGenerator): 19 * profiler/ProfileGenerator.h: 20 * profiler/Profiler.cpp: 21 (KJS::Profiler::startProfiling): 22 * profiler/TreeProfile.cpp: 23 (KJS::TreeProfile::create): 24 (KJS::TreeProfile::TreeProfile): 25 * profiler/TreeProfile.h: 26 1 27 2008-08-13 Geoffrey Garen <[email protected]> 2 28 -
trunk/JavaScriptCore/profiler/HeavyProfile.cpp
r35102 r35756 32 32 33 33 HeavyProfile::HeavyProfile(TreeProfile* treeProfile) 34 : Profile(treeProfile->title() )34 : Profile(treeProfile->title(), treeProfile->uid()) 35 35 { 36 36 m_treeProfile = treeProfile; -
trunk/JavaScriptCore/profiler/Profile.cpp
r35077 r35756 33 33 namespace KJS { 34 34 35 PassRefPtr<Profile> Profile::create(const UString& title )35 PassRefPtr<Profile> Profile::create(const UString& title, unsigned uid) 36 36 { 37 return TreeProfile::create(title );37 return TreeProfile::create(title, uid); 38 38 } 39 39 40 Profile::Profile(const UString& title )40 Profile::Profile(const UString& title, unsigned uid) 41 41 : m_title(title) 42 , m_uid(uid) 42 43 { 43 44 // FIXME: When multi-threading is supported this will be a vector and calls -
trunk/JavaScriptCore/profiler/Profile.h
r35102 r35756 38 38 class Profile : public RefCounted<Profile> { 39 39 public: 40 static PassRefPtr<Profile> create(const UString& title );40 static PassRefPtr<Profile> create(const UString& title, unsigned uid); 41 41 virtual ~Profile(); 42 42 … … 45 45 void setHead(PassRefPtr<ProfileNode> head) { m_head = head; } 46 46 double totalTime() const { return m_head->totalTime(); } 47 unsigned int uid() const { return m_uid; } 47 48 48 49 void forEach(void (ProfileNode::*)()); … … 69 70 70 71 protected: 71 Profile(const UString& title );72 Profile(const UString& title, unsigned uid); 72 73 73 74 private: … … 77 78 UString m_title; 78 79 RefPtr<ProfileNode> m_head; 80 unsigned int m_uid; 79 81 }; 80 82 -
trunk/JavaScriptCore/profiler/ProfileGenerator.cpp
r35184 r35756 34 34 static const char* NonJSExecution = "(idle)"; 35 35 36 PassRefPtr<ProfileGenerator> ProfileGenerator::create(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* client )36 PassRefPtr<ProfileGenerator> ProfileGenerator::create(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* client, unsigned uid) 37 37 { 38 return adoptRef(new ProfileGenerator(title, originatingGlobalExec, profileGroup, client ));38 return adoptRef(new ProfileGenerator(title, originatingGlobalExec, profileGroup, client, uid)); 39 39 } 40 40 41 ProfileGenerator::ProfileGenerator(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* client )41 ProfileGenerator::ProfileGenerator(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* client, unsigned uid) 42 42 : m_originatingGlobalExec(originatingGlobalExec) 43 43 , m_profileGroup(profileGroup) … … 46 46 , m_stoppedCallDepth(0) 47 47 { 48 m_profile = Profile::create(title );48 m_profile = Profile::create(title, uid); 49 49 m_currentNode = m_head = m_profile->head(); 50 50 } -
trunk/JavaScriptCore/profiler/ProfileGenerator.h
r35184 r35756 42 42 class ProfileGenerator : public RefCounted<ProfileGenerator> { 43 43 public: 44 static PassRefPtr<ProfileGenerator> create(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* );44 static PassRefPtr<ProfileGenerator> create(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient*, unsigned uid); 45 45 46 46 // Members … … 63 63 64 64 private: 65 ProfileGenerator(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* );65 ProfileGenerator(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient*, unsigned uid); 66 66 67 67 void removeProfileStart(); -
trunk/JavaScriptCore/profiler/Profiler.cpp
r35184 r35756 42 42 static const char* GlobalCodeExecution = "(program)"; 43 43 static const char* AnonymousFunction = "(anonymous function)"; 44 static unsigned ProfilesUID = 0; 44 45 45 46 static CallIdentifier createCallIdentifier(JSObject*); … … 71 72 72 73 s_sharedEnabledProfilerReference = this; 73 RefPtr<ProfileGenerator> profileGenerator = ProfileGenerator::create(title, globalExec, exec->lexicalGlobalObject()->profileGroup(), client );74 RefPtr<ProfileGenerator> profileGenerator = ProfileGenerator::create(title, globalExec, exec->lexicalGlobalObject()->profileGroup(), client, ++ProfilesUID); 74 75 m_currentProfiles.append(profileGenerator); 75 76 } -
trunk/JavaScriptCore/profiler/TreeProfile.cpp
r35077 r35756 31 31 namespace KJS { 32 32 33 PassRefPtr<TreeProfile> TreeProfile::create(const UString& title )33 PassRefPtr<TreeProfile> TreeProfile::create(const UString& title, unsigned uid) 34 34 { 35 return adoptRef(new TreeProfile(title ));35 return adoptRef(new TreeProfile(title, uid)); 36 36 } 37 37 38 TreeProfile::TreeProfile(const UString& title )39 : Profile(title )38 TreeProfile::TreeProfile(const UString& title, unsigned uid) 39 : Profile(title, uid) 40 40 { 41 41 } -
trunk/JavaScriptCore/profiler/TreeProfile.h
r35077 r35756 38 38 class TreeProfile : public Profile { 39 39 public: 40 static PassRefPtr<TreeProfile> create(const UString& title );40 static PassRefPtr<TreeProfile> create(const UString& title, unsigned uid); 41 41 42 42 virtual Profile* heavyProfile(); … … 44 44 45 45 private: 46 TreeProfile(const UString& title );46 TreeProfile(const UString& title, unsigned uid); 47 47 RefPtr<HeavyProfile> m_heavyProfile; 48 48 };
Note:
See TracChangeset
for help on using the changeset viewer.