Ignore:
Timestamp:
May 20, 2008, 1:59:16 PM (17 years ago)
Author:
[email protected]
Message:

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

Reviewed by Tim.

<rdar://problem/5770054> JavaScript profiler (10928)
Split function name into 3 parts so that the Web Inspector can link it to
the resource location from whence it came.

  • kjs/ustring.cpp: Implemented operator> for UStrings (KJS::operator>):
  • kjs/ustring.h:
  • profiler/Profile.cpp: (KJS::Profile::Profile): Initialize all 3 values. (KJS::Profile::willExecute): Use CallIdentifier struct. (KJS::Profile::didExecute): Ditto.
  • profiler/Profile.h: Ditto and remove unused function.
  • profiler/ProfileNode.cpp: (KJS::ProfileNode::ProfileNode): Use CallIdentifier struct. (KJS::ProfileNode::willExecute): Ditto and fix an issue where we restarted the m_startTime even though it was already started. (KJS::ProfileNode::didExecute): Ditto. (KJS::ProfileNode::findChild): Ditto. (KJS::functionNameDescendingComparator): Ditto and use new comparator. (KJS::functionNameAscendingComparator): Ditto. (KJS::ProfileNode::printDataInspectorStyle): Use CallIdentifier struct. (KJS::ProfileNode::printDataSampleStyle): Ditto.
  • profiler/ProfileNode.h: (KJS::CallIdentifier::CallIdentifier): Describe the CallIdentifier struct (KJS::CallIdentifier::operator== ): (KJS::ProfileNode::create): Use the CallIdentifier struct. (KJS::ProfileNode::callIdentifier): (KJS::ProfileNode::functionName): Now only return the function name, not the url and line number too. (KJS::ProfileNode::url): (KJS::ProfileNode::lineNumber):
  • profiler/Profiler.cpp: Use the CallIdentifier struct. (KJS::Profiler::startProfiling): (KJS::Profiler::willExecute): (KJS::Profiler::didExecute): (KJS::getCallIdentifiers): (KJS::getCallIdentifierFromFunctionImp):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ustring.cpp

    r33374 r33941  
    12741274}
    12751275
    1276 int compare(const UString& s1, const UString& s2)
     1276bool operator>(const UString& s1, const UString& s2)
    12771277{
    12781278  const int l1 = s1.size();
     
    12871287    l++;
    12881288  }
     1289  if (l < lmin)
     1290    return (c1[0] > c2[0]);
     1291
     1292  return (l1 > l2);
     1293}
     1294
     1295int compare(const UString& s1, const UString& s2)
     1296{
     1297  const int l1 = s1.size();
     1298  const int l2 = s2.size();
     1299  const int lmin = l1 < l2 ? l1 : l2;
     1300  const UChar *c1 = s1.data();
     1301  const UChar *c2 = s2.data();
     1302  int l = 0;
     1303  while (l < lmin && *c1 == *c2) {
     1304    c1++;
     1305    c2++;
     1306    l++;
     1307  }
    12891308
    12901309  if (l < lmin)
Note: See TracChangeset for help on using the changeset viewer.