Changeset 35039 in webkit


Ignore:
Timestamp:
Jul 7, 2008 11:12:09 AM (16 years ago)
Author:
kmccullough@apple.com
Message:

JavaScriptCore:

2008-07-07 Kevin McCullough <kmccullough@apple.com>

Reviewed by Darin.

When the profiler is running it gathers information and creates a
Profile. After it finishes the Profile can be sorted and have other
data refinements run over it. Both of these were done in the same class
before. Now I split the gathering operations into a new class called
ProfileGenerator.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • profiler/Profile.cpp: Removed code related to the gather stage of a Profile's creation. (KJS::Profile::create): (KJS::Profile::Profile):
  • profiler/Profile.h: Ditto. (KJS::Profile::title): (KJS::Profile::callTree): (KJS::Profile::setHead):
  • profiler/ProfileGenerator.cpp: Added. This is the class that will handle the stage of creating a Profile. Once the Profile is finished being created, this class goes away. (KJS::ProfileGenerator::create): (KJS::ProfileGenerator::ProfileGenerator): (KJS::ProfileGenerator::title): (KJS::ProfileGenerator::willExecute): (KJS::ProfileGenerator::didExecute): (KJS::ProfileGenerator::stopProfiling): (KJS::ProfileGenerator::didFinishAllExecution): (KJS::ProfileGenerator::removeProfileStart): (KJS::ProfileGenerator::removeProfileEnd):
  • profiler/ProfileGenerator.h: Added. (KJS::ProfileGenerator::profile): (KJS::ProfileGenerator::originatingGlobalExec): (KJS::ProfileGenerator::pageGroupIdentifier): (KJS::ProfileGenerator::client): (KJS::ProfileGenerator::stoppedProfiling):
  • profiler/Profiler.cpp: Now operates with the ProfileGenerator instead of the Profile. (KJS::Profiler::startProfiling): (KJS::Profiler::stopProfiling): (KJS::Profiler::didFinishAllExecution): It is here that the Profile is handed off to its client and the Profile Generator is no longer needed. (KJS::dispatchFunctionToProfiles): (KJS::Profiler::willExecute): (KJS::Profiler::didExecute):
  • profiler/Profiler.h: Cleaned up the includes and subsequently the forward declarations. Also use the new ProfileGenerator. (KJS::ProfilerClient::~ProfilerClient): (KJS::Profiler::currentProfiles):
  • profiler/TreeProfile.cpp: Use Profile's new interface. (KJS::TreeProfile::create): (KJS::TreeProfile::TreeProfile):
  • profiler/TreeProfile.h:

WebCore:

2008-07-07 Kevin McCullough <kmccullough@apple.com>

Reviewed by Darin.

Because profiler.h no longer #includes profile.h we need to explicitly
include it in console.cpp.

  • page/Console.cpp:
Location:
trunk
Files:
2 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r35037 r35039  
     12008-07-07  Kevin McCullough  <kmccullough@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        When the profiler is running it gathers information and creates a
     6        Profile.  After it finishes the Profile can be sorted and have other
     7        data refinements run over it.  Both of these were done in the same class
     8        before.  Now I split the gathering operations into a new class called
     9        ProfileGenerator.
     10
     11        * JavaScriptCore.xcodeproj/project.pbxproj:
     12        * profiler/Profile.cpp: Removed code related to the gather stage of a
     13        Profile's creation. 
     14        (KJS::Profile::create):
     15        (KJS::Profile::Profile):
     16        * profiler/Profile.h: Ditto.
     17        (KJS::Profile::title):
     18        (KJS::Profile::callTree):
     19        (KJS::Profile::setHead):
     20        * profiler/ProfileGenerator.cpp: Added. This is the class that will
     21        handle the stage of creating a Profile.  Once the Profile is finished
     22        being created, this class goes away.
     23        (KJS::ProfileGenerator::create):
     24        (KJS::ProfileGenerator::ProfileGenerator):
     25        (KJS::ProfileGenerator::title):
     26        (KJS::ProfileGenerator::willExecute):
     27        (KJS::ProfileGenerator::didExecute):
     28        (KJS::ProfileGenerator::stopProfiling):
     29        (KJS::ProfileGenerator::didFinishAllExecution):
     30        (KJS::ProfileGenerator::removeProfileStart):
     31        (KJS::ProfileGenerator::removeProfileEnd):
     32        * profiler/ProfileGenerator.h: Added.
     33        (KJS::ProfileGenerator::profile):
     34        (KJS::ProfileGenerator::originatingGlobalExec):
     35        (KJS::ProfileGenerator::pageGroupIdentifier):
     36        (KJS::ProfileGenerator::client):
     37        (KJS::ProfileGenerator::stoppedProfiling):
     38        * profiler/Profiler.cpp: Now operates with the ProfileGenerator instead
     39        of the Profile.
     40        (KJS::Profiler::startProfiling):
     41        (KJS::Profiler::stopProfiling):
     42        (KJS::Profiler::didFinishAllExecution): It is here that the Profile is
     43        handed off to its client and the Profile Generator is no longer needed.
     44        (KJS::dispatchFunctionToProfiles):
     45        (KJS::Profiler::willExecute):
     46        (KJS::Profiler::didExecute):
     47        * profiler/Profiler.h: Cleaned up the includes and subsequently the
     48        forward declarations.  Also use the new ProfileGenerator.
     49        (KJS::ProfilerClient::~ProfilerClient):
     50        (KJS::Profiler::currentProfiles):
     51        * profiler/TreeProfile.cpp: Use Profile's new interface.
     52        (KJS::TreeProfile::create):
     53        (KJS::TreeProfile::TreeProfile):
     54        * profiler/TreeProfile.h:
     55
    1562008-07-07  Sam Weinig  <sam@webkit.org>
    257
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r35022 r35039  
    9292                95CD41B30E1BF6560085358E /* TreeProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95CD41B10E1BF6560085358E /* TreeProfile.cpp */; };
    9393                95CD41B40E1BF6560085358E /* TreeProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95CD41B20E1BF6560085358E /* TreeProfile.h */; };
     94                95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */; };
     95                95CD45770E1C4FDD0085358E /* ProfileGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 95CD45750E1C4FDD0085358E /* ProfileGenerator.h */; settings = {ATTRIBUTES = (); }; };
    9496                95E3BC050E1AE68200B2D1C1 /* CallIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
    9597                A72700900DAC6BBC00E548D7 /* JSNotAnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72700780DAC605600E548D7 /* JSNotAnObject.cpp */; };
     
    593595                95CD41B10E1BF6560085358E /* TreeProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TreeProfile.cpp; path = profiler/TreeProfile.cpp; sourceTree = "<group>"; };
    594596                95CD41B20E1BF6560085358E /* TreeProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TreeProfile.h; path = profiler/TreeProfile.h; sourceTree = "<group>"; };
     597                95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProfileGenerator.cpp; path = profiler/ProfileGenerator.cpp; sourceTree = "<group>"; };
     598                95CD45750E1C4FDD0085358E /* ProfileGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfileGenerator.h; path = profiler/ProfileGenerator.h; sourceTree = "<group>"; };
    595599                95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CallIdentifier.h; path = profiler/CallIdentifier.h; sourceTree = "<group>"; };
    596600                A72700770DAC605600E548D7 /* JSNotAnObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNotAnObject.h; sourceTree = "<group>"; };
     
    12561260                        isa = PBXGroup;
    12571261                        children = (
     1262                                95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */,
     1263                                95742F630DD11F5A000917FB /* Profile.cpp */,
     1264                                95742F640DD11F5A000917FB /* Profile.h */,
     1265                                95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */,
     1266                                95CD45750E1C4FDD0085358E /* ProfileGenerator.h */,
     1267                                95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */,
     1268                                95AB83550DA43B4400BC83F3 /* ProfileNode.h */,
     1269                                95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */,
     1270                                95AB832F0DA42CAD00BC83F3 /* Profiler.h */,
    12581271                                95CD41B10E1BF6560085358E /* TreeProfile.cpp */,
    12591272                                95CD41B20E1BF6560085358E /* TreeProfile.h */,
    1260                                 95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */,
    1261                                 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */,
    1262                                 95AB83550DA43B4400BC83F3 /* ProfileNode.h */,
    1263                                 95742F630DD11F5A000917FB /* Profile.cpp */,
    1264                                 95742F640DD11F5A000917FB /* Profile.h */,
    1265                                 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */,
    1266                                 95AB832F0DA42CAD00BC83F3 /* Profiler.h */,
    12671273                        );
    12681274                        name = profiler;
     
    14761482                                BC7F8FB90E19D1C3008632C0 /* JSNumberCell.h in Headers */,
    14771483                                95CD41B40E1BF6560085358E /* TreeProfile.h in Headers */,
     1484                                95CD45770E1C4FDD0085358E /* ProfileGenerator.h in Headers */,
    14781485                                5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
    14791486                                5D53727E0E1C55EC0021E549 /* TracingDtrace.h in Headers */,
     
    17861793                                E18E3A590DF9278C00D90B34 /* JSGlobalData.cpp in Sources */,
    17871794                                95CD41B30E1BF6560085358E /* TreeProfile.cpp in Sources */,
     1795                                95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
    17881796                        );
    17891797                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/JavaScriptCore/profiler/Profile.cpp

    r35037 r35039  
    2727#include "Profile.h"
    2828
    29 #include "ExecState.h"
    30 #include "JSFunction.h"
    31 #include "JSGlobalObject.h"
     29//#include "ExecState.h"
     30//#include "JSFunction.h"
     31//#include "JSGlobalObject.h"
    3232#include "ProfileNode.h"
    3333#include "TreeProfile.h"
     
    3636namespace KJS {
    3737
    38 static const char* NonJSExecution = "(idle)";
    39 
    40 PassRefPtr<Profile> Profile::create(const UString& title, ExecState* originatingGlobalExec, unsigned pageGroupIdentifier, ProfilerClient* client)
     38PassRefPtr<Profile> Profile::create(const UString& title)
    4139{
    42     return TreeProfile::create(title, originatingGlobalExec, pageGroupIdentifier, client);
     40    return TreeProfile::create(title);
    4341}
    4442
    45 Profile::Profile(const UString& title, ExecState* originatingGlobalExec, unsigned pageGroupIdentifier, ProfilerClient* client)
     43Profile::Profile(const UString& title)
    4644    : m_title(title)
    47     , m_originatingGlobalExec(originatingGlobalExec)
    48     , m_pageGroupIdentifier(pageGroupIdentifier)
    49     , m_stoppedCallDepth(0)
    50     , m_client(client)
    51     , m_stoppedProfiling(false)
    5245{
    5346    // FIXME: When multi-threading is supported this will be a vector and calls
    5447    // into the profiler will need to know which thread it is executing on.
    5548    m_head = ProfileNode::create(CallIdentifier("Thread_1", 0, 0), 0, 0);
    56     m_currentNode = m_head;
    5749}
    5850
    5951Profile::~Profile()
    6052{
    61 }
    62 
    63 void Profile::stopProfiling()
    64 {
    65     forEach(&ProfileNode::stopProfiling);
    66     removeProfileStart();
    67     removeProfileEnd();
    68 
    69     ASSERT(m_currentNode);
    70 
    71     // Set the current node to the parent, because we are in a call that
    72     // will not get didExecute call.
    73     m_currentNode = m_currentNode->parent();
    74 
    75     m_stoppedProfiling = true;
    76 }
    77 
    78 bool Profile::didFinishAllExecution()
    79 {
    80     if (!m_stoppedProfiling)
    81         return false;
    82 
    83     if (double headSelfTime = m_head->selfTime()) {
    84         RefPtr<ProfileNode> idleNode = ProfileNode::create(CallIdentifier(NonJSExecution, 0, 0), m_head.get(), m_head.get());
    85 
    86         idleNode->setTotalTime(headSelfTime);
    87         idleNode->setSelfTime(headSelfTime);
    88         idleNode->setVisible(true);
    89 
    90         m_head->setSelfTime(0.0);
    91         m_head->addChild(idleNode.release());
    92     }
    93 
    94     m_currentNode = 0;
    95     m_originatingGlobalExec = 0;
    96     return true;
    97 }
    98 
    99 // The console.profile that started this profile will be the first child.
    100 void Profile::removeProfileStart()
    101 {
    102     ProfileNode* currentNode = 0;
    103     for (ProfileNode* next = m_head.get(); next; next = next->firstChild())
    104         currentNode = next;
    105 
    106     if (currentNode->callIdentifier().m_name != "profile")
    107         return;
    108 
    109     // Increment m_stoppedCallDepth to account for didExecute not being called for console.profile.
    110     ++m_stoppedCallDepth;
    111 
    112     // Attribute the time of the node aobut to be removed to the self time of its parent
    113     currentNode->parent()->setSelfTime(currentNode->parent()->selfTime() + currentNode->totalTime());
    114 
    115     ASSERT(currentNode->callIdentifier() == (currentNode->parent()->children()[0])->callIdentifier());
    116     currentNode->parent()->removeChild(0);
    117 }
    118 
    119 // The console.profileEnd that stopped this profile will be the last child.
    120 void Profile::removeProfileEnd()
    121 {
    122     ProfileNode* currentNode = 0;
    123     for (ProfileNode* next = m_head.get(); next; next = next->lastChild())
    124         currentNode = next;
    125 
    126     if (currentNode->callIdentifier().m_name != "profileEnd")
    127         return;
    128 
    129     // Attribute the time of the node aobut to be removed to the self time of its parent
    130     currentNode->parent()->setSelfTime(currentNode->parent()->selfTime() + currentNode->totalTime());
    131 
    132     ASSERT(currentNode->callIdentifier() == (currentNode->parent()->children()[currentNode->parent()->children().size() - 1])->callIdentifier());
    133     currentNode->parent()->removeChild(currentNode->parent()->children().size() - 1);
    134 }
    135 
    136 void Profile::willExecute(const CallIdentifier& callIdentifier)
    137 {
    138     if (m_stoppedProfiling) {
    139         ++m_stoppedCallDepth;
    140         return;
    141     }
    142 
    143     ASSERT(m_currentNode);
    144     m_currentNode = m_currentNode->willExecute(callIdentifier);
    145 }
    146 
    147 void Profile::didExecute(const CallIdentifier& callIdentifier)
    148 {
    149     if (!m_currentNode)
    150         return;
    151 
    152     if (m_stoppedProfiling && m_stoppedCallDepth > 0) {
    153         --m_stoppedCallDepth;
    154         return;
    155     }
    156 
    157     if (m_currentNode == m_head) {
    158         m_currentNode = ProfileNode::create(callIdentifier, m_head.get(), m_head.get());
    159         m_currentNode->setStartTime(m_head->startTime());
    160         m_currentNode->didExecute();
    161 
    162         if (m_stoppedProfiling) {
    163             m_currentNode->setTotalTime(m_head->totalTime());
    164             m_currentNode->setSelfTime(m_head->selfTime());
    165             m_head->setSelfTime(0.0);
    166         }
    167 
    168         m_head->insertNode(m_currentNode.release());           
    169         m_currentNode = m_stoppedProfiling ? 0 : m_head;
    170 
    171         return;
    172     }
    173 
    174     // Set m_currentNode to the parent (which didExecute returns). If stopped, just set the
    175     // m_currentNode to the parent and don't call didExecute.
    176     m_currentNode = m_stoppedProfiling ? m_currentNode->parent() : m_currentNode->didExecute();
    17753}
    17854
  • trunk/JavaScriptCore/profiler/Profile.h

    r34960 r35039  
    2828
    2929#include "ProfileNode.h"
     30#include <kjs/ustring.h>
    3031#include <wtf/RefCounted.h>
    3132#include <wtf/RefPtr.h>
     
    3435
    3536    class ExecState;
    36     class ProfilerClient;
    3737
    3838    class Profile : public RefCounted<Profile> {
    3939    public:
    40         static PassRefPtr<Profile> create(const UString& title, ExecState* originatingGlobalExec, unsigned pageGroupIdentifier, ProfilerClient*);
     40        static PassRefPtr<Profile> create(const UString& title);
    4141        virtual ~Profile();
    4242
    43         void willExecute(const CallIdentifier&);
    44         void didExecute(const CallIdentifier&);
    45         void stopProfiling();
    46         bool didFinishAllExecution();
    47 
    48         const UString& title() const { return m_title; };
    49         ProfileNode* callTree() const { return m_head.get(); };
    50 
     43        const UString& title() const { return m_title; }
     44        ProfileNode* callTree() const { return m_head.get(); }
     45        void setHead(PassRefPtr<ProfileNode> head) { m_head = head; }
    5146        double totalTime() const { return m_head->totalTime(); }
    52 
    53         ExecState* originatingGlobalExec() const { return m_originatingGlobalExec; }
    54         unsigned pageGroupIdentifier() const { return m_pageGroupIdentifier; }
    55         ProfilerClient* client() { return m_client; }
    5647
    5748        void forEach(void (ProfileNode::*)());
     
    6556        void sortFunctionNameAscending() { forEach(&ProfileNode::sortFunctionNameAscending); }
    6657
    67         void focus(const ProfileNode* profileNode);
    68         void exclude(const ProfileNode* profileNode);
     58        void focus(const ProfileNode*);
     59        void exclude(const ProfileNode*);
    6960        void restoreAll();
    70 
    71         bool stoppedProfiling() { return m_stoppedProfiling; }
    7261
    7362        virtual Profile* heavyProfile() = 0;
     
    7867        void debugPrintDataSampleStyle() const;
    7968#endif
    80         typedef void (Profile::*ProfileFunction)(const CallIdentifier& callIdentifier);
    8169
    8270    protected:
    83         Profile(const UString& title, ExecState* originatingGlobalExec, unsigned pageGroupIdentifier, ProfilerClient*);
     71        Profile(const UString& title);
    8472
    8573    private:
     
    8876
    8977        UString m_title;
    90         ExecState* m_originatingGlobalExec;
    91         unsigned m_pageGroupIdentifier;
    92         unsigned m_stoppedCallDepth;
    9378        RefPtr<ProfileNode> m_head;
    94         RefPtr<ProfileNode> m_currentNode;
    95         ProfilerClient* m_client;
    96         bool m_stoppedProfiling;
    9779    };
    9880
    9981} // namespace KJS
    10082
    101 #endif // Profiler_h
     83#endif // Profile_h
  • trunk/JavaScriptCore/profiler/Profiler.cpp

    r35037 r35039  
    3434#include "JSGlobalObject.h"
    3535#include "Profile.h"
     36#include "ProfileGenerator.h"
    3637#include "ProfileNode.h"
    3738#include <stdio.h>
     
    6465    ExecState* globalExec = exec->lexicalGlobalObject()->globalExec();
    6566    for (size_t i = 0; i < m_currentProfiles.size(); ++i) {
    66         Profile* profile = m_currentProfiles[i].get();
    67         if (!profile->stoppedProfiling() && profile->originatingGlobalExec() == globalExec && profile->title() == title)
     67        ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
     68        if (!profileGenerator->stoppedProfiling() && profileGenerator->originatingGlobalExec() == globalExec && profileGenerator->title() == title)
    6869            return;
    6970    }
    7071
    7172    s_sharedEnabledProfilerReference = this;
    72     RefPtr<Profile> profile = Profile::create(title, globalExec, exec->lexicalGlobalObject()->pageGroupIdentifier(), client);
    73     m_currentProfiles.append(profile);
     73    RefPtr<ProfileGenerator> profileGenerator = ProfileGenerator::create(title, globalExec, exec->lexicalGlobalObject()->pageGroupIdentifier(), client);
     74    m_currentProfiles.append(profileGenerator);
    7475}
    7576
     
    7879    ExecState* globalExec = exec->lexicalGlobalObject()->globalExec();
    7980    for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
    80         Profile* profile = m_currentProfiles[i].get();
    81         if (!profile->stoppedProfiling() && profile->originatingGlobalExec() == globalExec && (title.isNull() || profile->title() == title))
     81        ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
     82        if (!profileGenerator->stoppedProfiling() && profileGenerator->originatingGlobalExec() == globalExec && (title.isNull() || profileGenerator->title() == title))
    8283            m_currentProfiles[i]->stopProfiling();
    8384    }
     
    8889    ExecState* globalExec = exec->lexicalGlobalObject()->globalExec();
    8990    for (ptrdiff_t i = m_currentProfiles.size() - 1; i >= 0; --i) {
    90         Profile* profile = m_currentProfiles[i].get();
    91         if (profile->originatingGlobalExec() == globalExec && profile->didFinishAllExecution()) {
    92             PassRefPtr<Profile> prpProfile = m_currentProfiles[i].release();       
     91        ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
     92        if (profileGenerator->originatingGlobalExec() == globalExec && profileGenerator->didFinishAllExecution()) {
     93            PassRefPtr<ProfileGenerator> prpProfileGenerator = m_currentProfiles[i].release();
    9394            m_currentProfiles.remove(i);
    9495
     
    9697                s_sharedEnabledProfilerReference = 0;
    9798
    98             if (ProfilerClient* client = prpProfile->client())
    99                 client->finishedProfiling(prpProfile);
     99            if (ProfilerClient* client = prpProfileGenerator->client())
     100                client->finishedProfiling(prpProfileGenerator->profile());
    100101        }
    101102    }
    102103}
    103104
    104 static inline void dispatchFunctionToProfiles(const Vector<RefPtr<Profile> >& profiles, Profile::ProfileFunction function, const CallIdentifier& callIdentifier, unsigned currentPageGroupIdentifier)
     105static inline void dispatchFunctionToProfiles(const Vector<RefPtr<ProfileGenerator> >& profiles, ProfileGenerator::ProfileFunction function, const CallIdentifier& callIdentifier, unsigned currentPageGroupIdentifier)
    105106{
    106107    for (size_t i = 0; i < profiles.size(); ++i) {
     
    114115    ASSERT(!m_currentProfiles.isEmpty());
    115116
    116     dispatchFunctionToProfiles(m_currentProfiles, &Profile::willExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier());
     117    dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::willExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier());
    117118}
    118119
     
    123124    CallIdentifier callIdentifier = createCallIdentifier(sourceURL, startingLineNumber);
    124125
    125     dispatchFunctionToProfiles(m_currentProfiles, &Profile::willExecute, callIdentifier, exec->lexicalGlobalObject()->pageGroupIdentifier());
     126    dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::willExecute, callIdentifier, exec->lexicalGlobalObject()->pageGroupIdentifier());
    126127}
    127128
     
    130131    ASSERT(!m_currentProfiles.isEmpty());
    131132
    132     dispatchFunctionToProfiles(m_currentProfiles, &Profile::didExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier());
     133    dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(calledFunction), exec->lexicalGlobalObject()->pageGroupIdentifier());
    133134}
    134135
     
    137138    ASSERT(!m_currentProfiles.isEmpty());
    138139
    139     dispatchFunctionToProfiles(m_currentProfiles, &Profile::didExecute, createCallIdentifier(sourceURL, startingLineNumber), exec->lexicalGlobalObject()->pageGroupIdentifier());
     140    dispatchFunctionToProfiles(m_currentProfiles, &ProfileGenerator::didExecute, createCallIdentifier(sourceURL, startingLineNumber), exec->lexicalGlobalObject()->pageGroupIdentifier());
    140141}
    141142
  • trunk/JavaScriptCore/profiler/Profiler.h

    r35037 r35039  
    3030#define Profiler_h
    3131
    32 #include "Profile.h"
     32#include <wtf/PassRefPtr.h>
    3333#include <wtf/RefPtr.h>
     34#include <wtf/Vector.h>
    3435
    3536namespace KJS {
     
    3738    class ExecState;
    3839    class JSObject;
     40    class Profile;
     41    class ProfileGenerator;
     42    class UString;
     43
     44    class ProfilerClient {
     45    public:
     46        virtual void finishedProfiling(PassRefPtr<Profile>) = 0;
     47
     48    protected:
     49        virtual ~ProfilerClient() {}
     50    };
    3951
    4052    class Profiler {
     
    5668        void didExecute(ExecState*, const UString& sourceURL, int startingLineNumber);
    5769
    58         const Vector<RefPtr<Profile> >& currentProfiles() { return m_currentProfiles; };
     70        const Vector<RefPtr<ProfileGenerator> >& currentProfiles() { return m_currentProfiles; };
    5971
    6072    private:
    61         Vector<RefPtr<Profile> > m_currentProfiles;
     73        Vector<RefPtr<ProfileGenerator> > m_currentProfiles;
    6274        static Profiler* s_sharedProfiler;
    6375        static Profiler* s_sharedEnabledProfilerReference;
    64     };
    65 
    66     class ProfilerClient {
    67     public:
    68         virtual void finishedProfiling(PassRefPtr<Profile>) = 0;
    69 
    70     protected:
    71         virtual ~ProfilerClient() { }
    7276    };
    7377
  • trunk/JavaScriptCore/profiler/TreeProfile.cpp

    r35037 r35039  
    2929namespace KJS {
    3030
    31 PassRefPtr<TreeProfile> TreeProfile::create(const UString& title, ExecState* originatingGlobalExec, unsigned pageGroupIdentifier, ProfilerClient* client)
     31PassRefPtr<TreeProfile> TreeProfile::create(const UString& title)
    3232{
    33     return adoptRef(new TreeProfile(title, originatingGlobalExec, pageGroupIdentifier, client));
     33    return adoptRef(new TreeProfile(title));
    3434}
    3535
    36 TreeProfile::TreeProfile(const UString& title, ExecState* originatingGlobalExec, unsigned pageGroupIdentifier, ProfilerClient* client)
    37     : Profile(title, originatingGlobalExec, pageGroupIdentifier, client)
     36TreeProfile::TreeProfile(const UString& title)
     37    : Profile(title)
    3838{
    3939}
  • trunk/JavaScriptCore/profiler/TreeProfile.h

    r34960 r35039  
    3737    class TreeProfile : public Profile {
    3838    public:
    39         static PassRefPtr<TreeProfile> create(const UString& title, ExecState* originatingGlobalExec, unsigned pageGroupIdentifier, ProfilerClient*);
     39        static PassRefPtr<TreeProfile> create(const UString& title);
    4040
    4141        virtual Profile* heavyProfile();
     
    4343
    4444    private:
    45         TreeProfile(const UString& title, ExecState* originatingGlobalExec, unsigned pageGroupIdentifier, ProfilerClient*);
     45        TreeProfile(const UString& title);
    4646    };
    4747
  • trunk/WebCore/ChangeLog

    r35038 r35039  
     12008-07-07  Kevin McCullough  <kmccullough@apple.com>
     2
     3        Reviewed by Darin.
     4
     5        Because profiler.h no longer #includes profile.h we need to explicitly
     6        include it in console.cpp.
     7
     8        * page/Console.cpp:
     9
    1102008-07-07  Nikolas Zimmermann  <zimmermann@kde.org>
    211
  • trunk/WebCore/page/Console.cpp

    r35021 r35039  
    4242#include <kjs/interpreter.h>
    4343#include <kjs/JSObject.h>
     44#include <profiler/Profile.h>
    4445#include <stdio.h>
    4546
Note: See TracChangeset for help on using the changeset viewer.