Changeset 33466 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
May 14, 2008, 5:25:48 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

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

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 <[email protected]>

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.
Location:
trunk/JavaScriptCore
Files:
10 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r33464 r33466  
     12008-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
    1372008-05-14  Kevin McCullough  <[email protected]>
    238
  • trunk/JavaScriptCore/GNUmakefile.am

    r33025 r33466  
    4444        JavaScriptCore/pcre/pcre_ucp_searchfuncs.cpp \
    4545        JavaScriptCore/pcre/pcre_xclass.cpp \
    46         JavaScriptCore/profiler/FunctionCallProfile.cpp \
     46        JavaScriptCore/profiler/ProfileNode.cpp \
    4747        JavaScriptCore/profiler/Profile.cpp \
    4848        JavaScriptCore/profiler/Profiler.cpp \
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r33464 r33466  
    220220__ZN3WTF16callOnMainThreadEPFvPvES0_
    221221__ZN3WTF16fastZeroedMallocEm
    222 __ZN3WTF19initializeThreadingEv
     222__ZN3WTF19initializeThreadingEv 
    223223__ZN3WTF23waitForThreadCompletionEjPPv
    224224__ZN3WTF28setMainThreadCallbacksPausedEb
     
    234234__ZN3WTF8CollatorD1Ev
    235235__ZN3WTF8fastFreeEPv
     236__ZNK3KJS11ProfileNode8selfTimeEv
    236237__ZNK3KJS11PropertyMap3getERKNS_10IdentifierE
    237238__ZNK3KJS12DateInstance7getTimeERdRi
     
    241242__ZNK3KJS16JSVariableObject16isVariableObjectEv
    242243__ZNK3KJS16JSVariableObject21getPropertyAttributesEPNS_9ExecStateERKNS_10IdentifierERj
    243 __ZNK3KJS19FunctionCallProfile8selfTimeEv
    244244__ZNK3KJS19InternalFunctionImp14implementsCallEv
    245245__ZNK3KJS19InternalFunctionImp21implementsHasInstanceEv
  • trunk/JavaScriptCore/JavaScriptCore.pri

    r33026 r33466  
    9999    kjs/ustring.cpp \
    100100    kjs/value.cpp \
    101     profiler/FunctionCallProfile.cpp \
     101    profiler/ProfileNode.cpp \
    102102    profiler/Profile.cpp \
    103103    profiler/Profiler.cpp \
  • trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj

    r33012 r33466  
    883883                        >
    884884                        <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"
    890890                                >
    891891                        </File>
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r33053 r33466  
    192192                95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */; };
    193193                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, ); }; };
    196196                95C18D490C90E82600E72F73 /* JSRetainPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
    197197                A8E894320CD0602400367179 /* JSCallbackObjectFunctions.h in Headers */ = {isa = PBXBuildFile; fileRef = A8E894310CD0602400367179 /* JSCallbackObjectFunctions.h */; };
     
    503503                95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Profiler.cpp; path = profiler/Profiler.cpp; sourceTree = "<group>"; };
    504504                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>"; };
    507507                95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRetainPtr.h; sourceTree = "<group>"; };
    508508                A785E3030D9341AB00953772 /* ExecStateInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExecStateInlines.h; sourceTree = "<group>"; };
     
    977977                        isa = PBXGroup;
    978978                        children = (
    979                                 95AB83540DA43B4400BC83F3 /* FunctionCallProfile.cpp */,
    980                                 95AB83550DA43B4400BC83F3 /* FunctionCallProfile.h */,
     979                                95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */,
     980                                95AB83550DA43B4400BC83F3 /* ProfileNode.h */,
    981981                                95742F630DD11F5A000917FB /* Profile.cpp */,
    982982                                95742F640DD11F5A000917FB /* Profile.h */,
     
    11501150                                E17863400D9BEC0000D74E75 /* InitializeThreading.h in Headers */,
    11511151                                95AB83480DA432EB00BC83F3 /* Profiler.h in Headers */,
    1152                                 95AB83570DA43C3000BC83F3 /* FunctionCallProfile.h in Headers */,
     1152                                95AB83570DA43C3000BC83F3 /* ProfileNode.h in Headers */,
    11531153                                E1B7C8BE0DA3A3360074B0DC /* ThreadSpecific.h in Headers */,
    11541154                                06D358B20DAADA93003B174E /* MainThread.h in Headers */,
     
    14101410                                E178636D0D9BEEC300D74E75 /* InitializeThreading.cpp in Sources */,
    14111411                                95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */,
    1412                                 95AB83560DA43C3000BC83F3 /* FunctionCallProfile.cpp in Sources */,
     1412                                95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
    14131413                                06D358B30DAADAA4003B174E /* MainThread.cpp in Sources */,
    14141414                                06D358B40DAADAAA003B174E /* MainThreadMac.mm in Sources */,
  • trunk/JavaScriptCore/JavaScriptCoreSources.bkl

    r33026 r33466  
    9696    </set>
    9797    <set append="1" var="PROFILER_SOURCES">
    98         profiler/FunctionCallProfile.cpp
     98        profiler/ProfileNode.cpp
    9999        profiler/Profile.cpp
    100100        profiler/Profiler.cpp
  • trunk/JavaScriptCore/profiler/Profile.cpp

    r33382 r33466  
    2727#include "Profile.h"
    2828
    29 #include "FunctionCallProfile.h"
     29#include "ProfileNode.h"
    3030#include "JSGlobalObject.h"
    3131#include "ExecState.h"
     
    4343    // FIXME: When multi-threading is supported this will be a vector and calls
    4444    // 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");
    4646}
    4747
    4848void Profile::willExecute(const Vector<UString>& callStackNames)
    4949{
    50     RefPtr<FunctionCallProfile> callTreeInsertionPoint;
    51     RefPtr<FunctionCallProfile> foundNameInTree = m_callTree;
     50    RefPtr<ProfileNode> callTreeInsertionPoint;
     51    RefPtr<ProfileNode> foundNameInTree = m_callTree;
    5252    NameIterator callStackLocation = callStackNames.begin();
    5353
     
    6060    if (!foundNameInTree) {   // Insert remains of the stack into the call tree.
    6161        --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);
    6464            callTreeInsertionPoint->addChild(next);
    6565            callTreeInsertionPoint = next;
  • trunk/JavaScriptCore/profiler/Profile.h

    r33388 r33466  
    2727#define Profile_h
    2828
    29 #include "FunctionCallProfile.h"
     29#include "ProfileNode.h"
    3030#include <wtf/RefCounted.h>
    3131#include <wtf/RefPtr.h>
     
    4646        void stopProfiling() { m_callTree->stopProfiling(); };
    4747        const UString& title() const { return m_title; };
    48         FunctionCallProfile* callTree() const { return m_callTree.get(); };
     48        ProfileNode* callTree() const { return m_callTree.get(); };
    4949
    5050        void printDataInspectorStyle() const;
     
    5858        void insertStackNamesInTree(const Vector<UString>& callStackNames);
    5959
    60         RefPtr<FunctionCallProfile> m_callTree;
     60        RefPtr<ProfileNode> m_callTree;
    6161    };
    6262
  • trunk/JavaScriptCore/profiler/ProfileNode.cpp

    r33464 r33466  
    2828
    2929#include "config.h"
    30 #include "FunctionCallProfile.h"
     30#include "ProfileNode.h"
    3131
    3232#include "Profiler.h"
     
    3737namespace KJS {
    3838
    39 FunctionCallProfile::FunctionCallProfile(const UString& name)
     39ProfileNode::ProfileNode(const UString& name)
    4040    : m_functionName(name)
    4141    , m_timeSum(0)
     
    4545}
    4646
    47 void FunctionCallProfile::willExecute()
     47void ProfileNode::willExecute()
    4848{
    4949    m_startTime = getCurrentUTCTime();
    5050}
    5151
    52 void FunctionCallProfile::didExecute(Vector<UString> stackNames, unsigned int stackIndex)
     52void ProfileNode::didExecute(Vector<UString> stackNames, unsigned int stackIndex)
    5353{
    5454    if (stackIndex && stackIndex == stackNames.size()) {
     
    6666}
    6767
    68 void FunctionCallProfile::addChild(PassRefPtr<FunctionCallProfile> prpChild)
     68void ProfileNode::addChild(PassRefPtr<ProfileNode> prpChild)
    6969{
    7070    ASSERT(prpChild);
    7171
    72     RefPtr<FunctionCallProfile> child = prpChild;
     72    RefPtr<ProfileNode> child = prpChild;
    7373    for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) {
    7474        if ((*currentChild)->functionName() == child->functionName())
     
    7979}
    8080
    81 FunctionCallProfile* FunctionCallProfile::findChild(const UString& name)
     81ProfileNode* ProfileNode::findChild(const UString& name)
    8282{
    8383    for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild) {
     
    8989}
    9090
    91 void FunctionCallProfile::stopProfiling()
     91void ProfileNode::stopProfiling()
    9292{
    9393    if (m_startTime)
     
    9999}
    100100
    101 double FunctionCallProfile::selfTime() const
     101double ProfileNode::selfTime() const
    102102{
    103103    double sumChildrenTime = 0.0;
     
    111111}
    112112
    113 void FunctionCallProfile::printDataInspectorStyle(int indentLevel) const
     113void ProfileNode::printDataInspectorStyle(int indentLevel) const
    114114{
    115115    // Print function names
     
    130130
    131131// print the profiled data in a format that matches the tool sample's output.
    132 double FunctionCallProfile::printDataSampleStyle(int indentLevel, FunctionCallHashCount& countedFunctions) const
     132double ProfileNode::printDataSampleStyle(int indentLevel, FunctionCallHashCount& countedFunctions) const
    133133{
    134134    printf("    ");
     
    167167}
    168168
    169 void FunctionCallProfile::endAndRecordCall()
     169void ProfileNode::endAndRecordCall()
    170170{
    171171    m_timeSum += getCurrentUTCTime() - m_startTime;
  • trunk/JavaScriptCore/profiler/ProfileNode.h

    r33464 r33466  
    2727 */
    2828
    29 #ifndef FunctionCallProfile_h
    30 #define FunctionCallProfile_h
     29#ifndef ProfileNode_h
     30#define ProfileNode_h
    3131
    3232#include <kjs/ustring.h>
     
    3838namespace KJS {
    3939
    40     class FunctionCallProfile;
     40    class ProfileNode;
    4141
    42     typedef Deque<RefPtr<FunctionCallProfile> >::const_iterator StackIterator;
     42    typedef Deque<RefPtr<ProfileNode> >::const_iterator StackIterator;
    4343    typedef HashCountedSet<UString::Rep*> FunctionCallHashCount;
    4444
    45     class FunctionCallProfile : public RefCounted<FunctionCallProfile> {
     45    class ProfileNode : public RefCounted<ProfileNode> {
    4646    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)); }
    4848
    4949        void willExecute();
    5050        void didExecute(Vector<UString> stackNames, unsigned int stackIndex);
    5151
    52         void addChild(PassRefPtr<FunctionCallProfile> prpChild);
    53         FunctionCallProfile* findChild(const UString& name);
     52        void addChild(PassRefPtr<ProfileNode> prpChild);
     53        ProfileNode* findChild(const UString& name);
    5454
    5555        void stopProfiling();
     
    5959        double selfTime() const;
    6060        unsigned numberOfCalls() const { return m_numberOfCalls; }
    61         const Deque<RefPtr<FunctionCallProfile> >& children() { return m_children; }
     61        const Deque<RefPtr<ProfileNode> >& children() { return m_children; }
    6262
    6363        void printDataInspectorStyle(int indentLevel) const;
     
    6565
    6666    private:
    67         FunctionCallProfile(const UString& name);
     67        ProfileNode(const UString& name);
    6868
    6969        void endAndRecordCall();
     
    7474        unsigned m_numberOfCalls;
    7575
    76         Deque<RefPtr<FunctionCallProfile> > m_children;
     76        Deque<RefPtr<ProfileNode> > m_children;
    7777    };
    7878
    7979} // namespace KJS
    8080
    81 #endif // FunctionCallProfile_h
     81#endif // ProfileNode_h
  • trunk/JavaScriptCore/profiler/Profiler.cpp

    r33382 r33466  
    3232#include "ExecState.h"
    3333#include "function.h"
    34 #include "FunctionCallProfile.h"
     34#include "ProfileNode.h"
    3535#include "JSGlobalObject.h"
    3636#include "Profile.h"
Note: See TracChangeset for help on using the changeset viewer.