Changeset 35756 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Aug 14, 2008, 11:11:20 AM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2008-08-14 Kevin McCullough <[email protected]>

Reviewed by Tim.

<rdar://problem/6115819> Notify of profile in console

  • Profiles now have a unique ID so that they can be linked to the console message that announces that a profile completed.
  • profiler/HeavyProfile.cpp: (KJS::HeavyProfile::HeavyProfile):
  • profiler/Profile.cpp: (KJS::Profile::create): (KJS::Profile::Profile):
  • profiler/Profile.h: (KJS::Profile::uid):
  • profiler/ProfileGenerator.cpp: (KJS::ProfileGenerator::create): (KJS::ProfileGenerator::ProfileGenerator):
  • profiler/ProfileGenerator.h:
  • profiler/Profiler.cpp: (KJS::Profiler::startProfiling):
  • profiler/TreeProfile.cpp: (KJS::TreeProfile::create): (KJS::TreeProfile::TreeProfile):
  • profiler/TreeProfile.h:

WebCore:

2008-08-14 Kevin McCullough <[email protected]>

Reviewed by Tim.

<rdar://problem/6115819> Notify of profile in console

  • page/InspectorController.cpp: (WebCore::InspectorController::addProfile): (WebCore::InspectorController::addProfileMessageToConsole): Called by addProfile this is the function that adds a message to the console that a profile finished.
  • page/InspectorController.h:
  • page/JavaScriptProfile.cpp: Expose the profiler's unique ID to match the console log to the profile in the web inspector. (WebCore::getUniqueIdCallback): (WebCore::ProfileClass):
  • page/inspector/ProfilesPanel.js: Created a map of all the profiles by Id to bring up the requested profile. Also select and reveal the profile in the profile panel. And created displayTitleForProfileLink() which formats a title taking into account if it's user initiated or if there are multiples. Lasty, I put the user initiated profile in a variable.
  • page/inspector/inspector.js: Make the profile title be a clickable link that will take the user to the identified profile. Also expose the count of user initiated profiles so they can be displayed in the console with the correct count.
Location:
trunk/JavaScriptCore
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r35750 r35756  
     12008-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
    1272008-08-13  Geoffrey Garen  <[email protected]>
    228
  • trunk/JavaScriptCore/profiler/HeavyProfile.cpp

    r35102 r35756  
    3232
    3333HeavyProfile::HeavyProfile(TreeProfile* treeProfile)
    34     : Profile(treeProfile->title())
     34    : Profile(treeProfile->title(), treeProfile->uid())
    3535{
    3636    m_treeProfile = treeProfile;
  • trunk/JavaScriptCore/profiler/Profile.cpp

    r35077 r35756  
    3333namespace KJS {
    3434
    35 PassRefPtr<Profile> Profile::create(const UString& title)
     35PassRefPtr<Profile> Profile::create(const UString& title, unsigned uid)
    3636{
    37     return TreeProfile::create(title);
     37    return TreeProfile::create(title, uid);
    3838}
    3939
    40 Profile::Profile(const UString& title)
     40Profile::Profile(const UString& title, unsigned uid)
    4141    : m_title(title)
     42    , m_uid(uid)
    4243{
    4344    // FIXME: When multi-threading is supported this will be a vector and calls
  • trunk/JavaScriptCore/profiler/Profile.h

    r35102 r35756  
    3838    class Profile : public RefCounted<Profile> {
    3939    public:
    40         static PassRefPtr<Profile> create(const UString& title);
     40        static PassRefPtr<Profile> create(const UString& title, unsigned uid);
    4141        virtual ~Profile();
    4242
     
    4545        void setHead(PassRefPtr<ProfileNode> head) { m_head = head; }
    4646        double totalTime() const { return m_head->totalTime(); }
     47        unsigned int uid() const { return m_uid; }
    4748
    4849        void forEach(void (ProfileNode::*)());
     
    6970
    7071    protected:
    71         Profile(const UString& title);
     72        Profile(const UString& title, unsigned uid);
    7273
    7374    private:
     
    7778        UString m_title;
    7879        RefPtr<ProfileNode> m_head;
     80        unsigned int m_uid;
    7981    };
    8082
  • trunk/JavaScriptCore/profiler/ProfileGenerator.cpp

    r35184 r35756  
    3434static const char* NonJSExecution = "(idle)";
    3535
    36 PassRefPtr<ProfileGenerator> ProfileGenerator::create(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* client)
     36PassRefPtr<ProfileGenerator> ProfileGenerator::create(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* client, unsigned uid)
    3737{
    38     return adoptRef(new ProfileGenerator(title, originatingGlobalExec, profileGroup, client));
     38    return adoptRef(new ProfileGenerator(title, originatingGlobalExec, profileGroup, client, uid));
    3939}
    4040
    41 ProfileGenerator::ProfileGenerator(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* client)
     41ProfileGenerator::ProfileGenerator(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient* client, unsigned uid)
    4242    : m_originatingGlobalExec(originatingGlobalExec)
    4343    , m_profileGroup(profileGroup)
     
    4646    , m_stoppedCallDepth(0)
    4747{
    48     m_profile = Profile::create(title);
     48    m_profile = Profile::create(title, uid);
    4949    m_currentNode = m_head = m_profile->head();
    5050}
  • trunk/JavaScriptCore/profiler/ProfileGenerator.h

    r35184 r35756  
    4242    class ProfileGenerator : public RefCounted<ProfileGenerator>  {
    4343    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);
    4545
    4646        // Members
     
    6363
    6464    private:
    65         ProfileGenerator(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient*);
     65        ProfileGenerator(const UString& title, ExecState* originatingGlobalExec, unsigned profileGroup, ProfilerClient*, unsigned uid);
    6666
    6767        void removeProfileStart();
  • trunk/JavaScriptCore/profiler/Profiler.cpp

    r35184 r35756  
    4242static const char* GlobalCodeExecution = "(program)";
    4343static const char* AnonymousFunction = "(anonymous function)";
     44static unsigned ProfilesUID = 0;
    4445
    4546static CallIdentifier createCallIdentifier(JSObject*);
     
    7172
    7273    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);
    7475    m_currentProfiles.append(profileGenerator);
    7576}
  • trunk/JavaScriptCore/profiler/TreeProfile.cpp

    r35077 r35756  
    3131namespace KJS {
    3232
    33 PassRefPtr<TreeProfile> TreeProfile::create(const UString& title)
     33PassRefPtr<TreeProfile> TreeProfile::create(const UString& title, unsigned uid)
    3434{
    35     return adoptRef(new TreeProfile(title));
     35    return adoptRef(new TreeProfile(title, uid));
    3636}
    3737
    38 TreeProfile::TreeProfile(const UString& title)
    39     : Profile(title)
     38TreeProfile::TreeProfile(const UString& title, unsigned uid)
     39    : Profile(title, uid)
    4040{
    4141}
  • trunk/JavaScriptCore/profiler/TreeProfile.h

    r35077 r35756  
    3838    class TreeProfile : public Profile {
    3939    public:
    40         static PassRefPtr<TreeProfile> create(const UString& title);
     40        static PassRefPtr<TreeProfile> create(const UString& title, unsigned uid);
    4141
    4242        virtual Profile* heavyProfile();
     
    4444
    4545    private:
    46         TreeProfile(const UString& title);
     46        TreeProfile(const UString& title, unsigned uid);
    4747        RefPtr<HeavyProfile> m_heavyProfile;
    4848    };
Note: See TracChangeset for help on using the changeset viewer.