Changeset 34957 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jul 2, 2008, 10:40:29 AM (17 years ago)
Author:
[email protected]
Message:

2008-07-02 Kevin McCullough <[email protected]>

Reviewed by Dan.

Broke CallIdentifier out into its own file. I did this because it's
going to grow a lot soon and I wanted this to be a separate patch.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • profiler/CallIdentifier.h: Added. (KJS::CallIdentifier::CallIdentifier): (KJS::CallIdentifier::operator==): (KJS::CallIdentifier::operator!=): (KJS::CallIdentifier::operator const char* ): (KJS::CallIdentifier::toString):
  • profiler/ProfileNode.h:
Location:
trunk/JavaScriptCore
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r34954 r34957  
     12008-07-02  Kevin McCullough  <[email protected]>
     2
     3        Reviewed by Dan.
     4
     5        Broke CallIdentifier out into its own file. I did this because it's
     6        going to grow a lot soon and I wanted this to be a separate patch.
     7
     8        * JavaScriptCore.xcodeproj/project.pbxproj:
     9        * profiler/CallIdentifier.h: Added.
     10        (KJS::CallIdentifier::CallIdentifier):
     11        (KJS::CallIdentifier::operator==):
     12        (KJS::CallIdentifier::operator!=):
     13        (KJS::CallIdentifier::operator const char* ):
     14        (KJS::CallIdentifier::toString):
     15        * profiler/ProfileNode.h:
     16
    1172008-07-02  Simon Hausmann  <[email protected]>
    218
  • trunk/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

    r34937 r34957  
    8787                95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */; };
    8888                95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */; };
     89                95E3BC050E1AE68200B2D1C1 /* CallIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
    8990                A72700900DAC6BBC00E548D7 /* JSNotAnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72700780DAC605600E548D7 /* JSNotAnObject.cpp */; };
    9091                A72701B60DADE94900E548D7 /* ExceptionHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A72701B40DADE94900E548D7 /* ExceptionHelpers.cpp */; };
     
    577578                95AB83550DA43B4400BC83F3 /* ProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfileNode.h; path = profiler/ProfileNode.h; sourceTree = "<group>"; };
    578579                95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRetainPtr.h; sourceTree = "<group>"; };
     580                95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CallIdentifier.h; path = profiler/CallIdentifier.h; sourceTree = "<group>"; };
    579581                A72700770DAC605600E548D7 /* JSNotAnObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSNotAnObject.h; sourceTree = "<group>"; };
    580582                A72700780DAC605600E548D7 /* JSNotAnObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSNotAnObject.cpp; sourceTree = "<group>"; };
     
    12061208                        isa = PBXGroup;
    12071209                        children = (
     1210                                95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */,
    12081211                                95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */,
    12091212                                95AB83550DA43B4400BC83F3 /* ProfileNode.h */,
     
    14191422                                BC02E98D0E183E38000F9297 /* ErrorInstance.h in Headers */,
    14201423                                BC1166020E1997B4008066DD /* DateInstance.h in Headers */,
     1424                                95E3BC050E1AE68200B2D1C1 /* CallIdentifier.h in Headers */,
    14211425                                BC11667B0E199C05008066DD /* InternalFunction.h in Headers */,
    14221426                                BC1167DA0E19BCC9008066DD /* JSCell.h in Headers */,
  • trunk/JavaScriptCore/profiler/Profile.cpp

    r34800 r34957  
    9999        currentNode = next;
    100100
    101     if (currentNode->callIdentifier().name != "profile")
     101    if (currentNode->callIdentifier().m_name != "profile")
    102102        return;
    103103
     
    118118        currentNode = next;
    119119
    120     if (currentNode->callIdentifier().name != "profileEnd")
     120    if (currentNode->callIdentifier().m_name != "profileEnd")
    121121        return;
    122122
  • trunk/JavaScriptCore/profiler/ProfileNode.h

    r34778 r34957  
    3030#define ProfileNode_h
    3131
    32 #include <kjs/ustring.h>
     32#include "CallIdentifier.h"
     33
    3334#include <wtf/Vector.h>
    3435#include <wtf/RefCounted.h>
     
    4142    typedef Vector<RefPtr<ProfileNode> >::const_iterator StackIterator;
    4243    typedef HashCountedSet<UString::Rep*> FunctionCallHashCount;
    43 
    44     struct CallIdentifier {
    45         UString name;
    46         UString url;
    47         unsigned lineNumber;
    48        
    49         CallIdentifier(UString name, UString url, int lineNumber)
    50             : name(name)
    51             , url(url)
    52             , lineNumber(lineNumber)
    53         {
    54         }
    55 
    56         CallIdentifier(const CallIdentifier& ci)
    57             : name(ci.name)
    58             , url(ci.url)
    59             , lineNumber(ci.lineNumber)
    60         {
    61         }
    62 
    63         inline bool operator==(const CallIdentifier& ci) const { return ci.lineNumber == lineNumber && ci.name == name && ci.url == url; }
    64         inline bool operator!=(const CallIdentifier& ci) const { return !(*this == ci); }
    65 
    66 #ifndef NDEBUG
    67         operator const char* () const { return name.UTF8String().c_str(); }
    68         const char* toString() const { return *this; }
    69 #endif
    70     };
    7144
    7245    class ProfileNode : public RefCounted<ProfileNode> {
     
    8558        ProfileNode* nextSibling() const { return m_nextSibling; }
    8659        void setNextSibling(ProfileNode* nextSibling) { m_nextSibling = nextSibling; }
    87         UString functionName() const { return m_callIdentifier.name; }
    88         UString url() const { return m_callIdentifier.url; }
    89         unsigned lineNumber() const { return m_callIdentifier.lineNumber; }
     60        UString functionName() const { return m_callIdentifier.m_name; }
     61        UString url() const { return m_callIdentifier.m_url; }
     62        unsigned lineNumber() const { return m_callIdentifier.m_lineNumber; }
    9063
    9164        double startTime() const { return m_startTime; }
Note: See TracChangeset for help on using the changeset viewer.