1. 20 May, 2008 3 commits
    • timothy@apple.com's avatar
      Rename sortFileName{Ascending,Descending} to · 21176464
      timothy@apple.com authored
      sortFunctionName{Ascending,Descending}.
      
      Reviewed by Kevin McCullough.
      
      * JavaScriptCore.exp:
      * kjs/config.h:
      * profiler/Profile.h:
      * profiler/ProfileNode.cpp:
      (KJS::functionNameDescendingComparator):
      (KJS::ProfileNode::sortFunctionNameDescending):
      (KJS::functionNameAscendingComparator):
      (KJS::ProfileNode::sortFunctionNameAscending):
      * profiler/ProfileNode.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33935 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      21176464
    • timothy@apple.com's avatar
      Make the profiler use higher than millisecond resolution time-stamps. · 7de48b2e
      timothy@apple.com authored
      Reviewed by Kevin McCullough.
      
      * kjs/DateMath.cpp:
      (KJS::getCurrentUTCTime): Call getCurrentUTCTimeWithMicroseconds and
      floor the result.
      (KJS::getCurrentUTCTimeWithMicroseconds): Copied from the previous
      implementation of getCurrentUTCTime without the floor call.
      * kjs/DateMath.h: Addded getCurrentUTCTimeWithMicroseconds.
      * profiler/ProfileNode.cpp:
      (KJS::ProfileNode::ProfileNode): Use getCurrentUTCTimeWithMicroseconds.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33930 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7de48b2e
    • timothy@apple.com's avatar
      Fixes a bug in the profiler where call and apply would show up · e4f53f8a
      timothy@apple.com authored
      and double the time spent in a function. We don't want to show call
      and apply at all in the profiles. This change excludes them.
      
      Reviewed by Kevin McCullough.
      
      * profiler/ProfileNode.cpp:
      (KJS::ProfileNode::stopProfiling): Remove a second for loop and
      calculate self time in the existing loop.
      * profiler/Profiler.cpp:
      (KJS::shouldExcludeFunction): Helper inline function that returns
      true in the current function in an InternalFunctionImp and it is
      has the functionName call or apply.
      (KJS::Profiler::willExecute): Call shouldExcludeFunction and return
      early if if returns true.
      (KJS::Profiler::didExecute): Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33928 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e4f53f8a
  2. 19 May, 2008 5 commits
  3. 16 May, 2008 2 commits
    • kmccullough@apple.com's avatar
      JavaScriptCore: · 58b3de1e
      kmccullough@apple.com authored
      2008-05-16  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Tim.
      
              <rdar://problem/5770054> JavaScript profiler (10928)
              Implement sorting for the profiler.
              I chose to sort the profileNodes in place since there is no reason they
              need to retain their original order.
      
              * JavaScriptCore.exp: Export the symbols.
              * profiler/Profile.h: Add the different ways a profile can be sorted.
              (KJS::Profile::sortTotalTimeDescending):
              (KJS::Profile::sortTotalTimeAscending):
              (KJS::Profile::sortSelfTimeDescending):
              (KJS::Profile::sortSelfTimeAscending):
              (KJS::Profile::sortCallsDescending):
              (KJS::Profile::sortCallsAscending):
              * profiler/ProfileNode.cpp: Implement those ways.
              (KJS::totalTimeDescendingComparator):
              (KJS::ProfileNode::sortTotalTimeDescending):
              (KJS::totalTimeAscendingComparator):
              (KJS::ProfileNode::sortTotalTimeAscending):
              (KJS::selfTimeDescendingComparator):
              (KJS::ProfileNode::sortSelfTimeDescending):
              (KJS::selfTimeAscendingComparator):
              (KJS::ProfileNode::sortSelfTimeAscending):
              (KJS::callsDescendingComparator):
              (KJS::ProfileNode::sortCallsDescending):
              (KJS::callsAscendingComparator):
              (KJS::ProfileNode::sortCallsAscending):
              * profiler/ProfileNode.h: No longer use a Deque since it cannot be
              sorted by std::sort and there was no reason not to use a Vector.  I
              previously had though I would do prepending but am not.
              (KJS::ProfileNode::selfTime):
              (KJS::ProfileNode::totalPercent):
              (KJS::ProfileNode::selfPercent):
              (KJS::ProfileNode::children):
              * profiler/Profiler.cpp: Removed these functions as they can be called
              directoy on the Profile object after getting the Vector of them.
              (KJS::getStackNames):
              * profiler/Profiler.h:
      
      WebCore:
      
      2008-05-16  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Tim.
      
              <rdar://problem/5770054> JavaScript profiler (10928)
              Use a Vector instead of a Deque since we don't use the extra capabilities
              of the Deque.
      
              * page/JavaScriptProfileNode.cpp:
              (WebCore::getChildren):
              (WebCore::toJS):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33532 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      58b3de1e
    • hausmann@webkit.org's avatar
      2008-05-15 Ariya Hidayat <ariya.hidayat@trolltech.com> · f9804cef
      hausmann@webkit.org authored
              Reviewed by Simon.
      
              Since WebKitGtk is fully using autotools now, clean-up the .pro/.pri files
              from gtk-port.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33518 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f9804cef
  4. 15 May, 2008 3 commits
    • kmccullough@apple.com's avatar
      2008-05-15 Kevin McCullough <kmccullough@apple.com> · 9773812b
      kmccullough@apple.com authored
              - Build fix.
      
              * JavaScriptCore.exp:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9773812b
    • kmccullough@apple.com's avatar
      2008-05-15 Kevin McCullough <kmccullough@apple.com> · 47fff420
      kmccullough@apple.com authored
              Reviewed by Tim.
      
              <rdar://problem/5770054> JavaScript profiler (10928)
              - Cache some values to save on computing them repetitively. This will be
              a big savings when we sort since we won't have to walk the tree for
              every comparison!
              - We cache these values when we end profiling because otherwise we won't
              know which profile to get the totalTime for the whole profile from without
              retaining a reference to the head profile or looking up the profile from
              the list of all profiles.
              - Also it's safe to assume we won't be asked for these values while we
              are still profiling since the WebInspector only get's profileNodes from
              profiles that are in the allProfiles() list and a profile is only added
              to that list after it has finished and these values will no longer
              change.
      
              * JavaScriptCore.exp:
              * profiler/ProfileNode.cpp:
              (KJS::ProfileNode::ProfileNode):
              (KJS::ProfileNode::stopProfiling):
              (KJS::ProfileNode::printDataInspectorStyle):
              (KJS::ProfileNode::printDataSampleStyle):
              (KJS::ProfileNode::endAndRecordCall):
              * profiler/ProfileNode.h:
              (KJS::ProfileNode::totalTime):
              (KJS::ProfileNode::selfTime):
              (KJS::ProfileNode::totalPercent):
              (KJS::ProfileNode::selfPercent):
              * profiler/Profiler.cpp:
              (KJS::Profiler::stopProfiling):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      47fff420
    • hausmann@webkit.org's avatar
      Simon Hausmann <shausman@trolltech.com> · 9eb28ab6
      hausmann@webkit.org authored
      Fix compilation when compiling with MSVC and wchar_t support.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33485 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9eb28ab6
  5. 14 May, 2008 7 commits
    • kmccullough@apple.com's avatar
      2008-05-14 Kevin McCullough <kmccullough@apple.com> · d670c2ab
      kmccullough@apple.com authored
              Reviewed by Tim.
      
              <rdar://problem/5770054> JavaScript profiler (10928)
              - Turn on the profiler.
      
              * kjs/config.h:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33475 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d670c2ab
    • kmccullough@apple.com's avatar
      JavaScriptCore: · 83025713
      kmccullough@apple.com authored
      2008-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Tim.
      
              <rdar://problem/5770054> JavaScript profiler (10928)
              - Expose the new profiler functions to the WebInspector.
      
              * JavaScriptCore.exp:
      
      WebCore:
      
      2008-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by Tim.
      
              <rdar://problem/5770054> JavaScript profiler (10928)
              - Expose the new Profiler functions to the WebInspector.
      
              * page/JavaScriptProfileNode.cpp:
              (WebCore::getTotalPercent):
              (WebCore::getSelfPercent):
              (WebCore::ProfileNodeClass):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33474 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      83025713
    • kmccullough@apple.com's avatar
      2008-05-14 Kevin McCullough <kmccullough@apple.com> · f9b1267a
      kmccullough@apple.com authored
              Giving credit where credit is due.
      
              * ChangeLog:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33471 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f9b1267a
    • kmccullough@apple.com's avatar
      2008-05-14 Kevin McCullough <kmccullough@apple.com> · a8ce9b97
      kmccullough@apple.com authored
              Reviewed by Geoff and Sam.
      
              <rdar://problem/5770054> JavaScript profiler (10928)
              Add the ability to get percentages of total and self time for displaying
              in the WebInspector.
      
              * profiler/Profile.h:
              (KJS::Profile::totalProfileTime):
              * profiler/ProfileNode.cpp:
              (KJS::ProfileNode::totalPercent):
              (KJS::ProfileNode::selfPercent):
              * profiler/ProfileNode.h:
              * profiler/Profiler.h:
              (KJS::Profiler::currentProfile):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a8ce9b97
    • kmccullough@apple.com's avatar
      JavaScriptCore: · 944b8621
      kmccullough@apple.com authored
      2008-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              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  <kmccullough@apple.com>
      
              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.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33466 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      944b8621
    • kmccullough@apple.com's avatar
      JavaScriptCore: · 6101f799
      kmccullough@apple.com authored
      2008-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by John.
      
              <rdar://problem/5770054> JavaScript profiler (10928)
              - Have each FunctionCallProfile be able to return it's total and self time.
      
              * JavaScriptCore.exp:
              * profiler/FunctionCallProfile.cpp:
              (KJS::FunctionCallProfile::selfTime):
              * profiler/FunctionCallProfile.h:
              (KJS::FunctionCallProfile::totalTime):
      
      WebCore:
      
      2008-05-14  Kevin McCullough  <kmccullough@apple.com>
      
              Reviewed by John.
      
              -<rdar://problem/5770054> JavaScript profiler (10928)
              Use the FunctionCallProfile's new total and self time functions.
      
              * page/JavaScriptFunctionCallProfile.cpp:
              (WebCore::getTotalTime):
              (WebCore::getSelfTime):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33464 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6101f799
    • ap@webkit.org's avatar
      Reviewed by Darin. · 53901ad3
      ap@webkit.org authored
              <rdar://problem/5934376> REGRESSION: A script fails because of a straw BOM character in it.
      
              <https://bugs.webkit.org/show_bug.cgi?id=4931>
              Unicode format characters (Cf) should be removed from JavaScript source
      
              Of all Cf characters, we are only removing BOM, because this is what Firefox trunk has
              settled upon, after extensive discussion and investigation.
      
              Based on Darin's work on this bug.
      
              Test: fast/js/removing-Cf-characters.html
      
              * kjs/lexer.cpp:
              (KJS::Lexer::setCode): Tweak formatting. Use a call to shift(4) to read in the
              first characters, instead of having special case code here.
              (KJS::Lexer::shift): Add a loop when reading a character to skip BOM characters.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      53901ad3
  6. 13 May, 2008 6 commits
  7. 12 May, 2008 3 commits
  8. 10 May, 2008 2 commits
  9. 09 May, 2008 2 commits
    • beidson@apple.com's avatar
      Build Fix · 6b7eb849
      beidson@apple.com authored
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6b7eb849
    • kmccullough@apple.com's avatar
      2008-05-09 Kevin McCullough <kmccullough@apple.com> · 320e01ec
      kmccullough@apple.com authored
              Reviewed by Tim.
      
              -<rdar://problem/5770054> JavaScript profiler (10928)
              -Add Profile class so that all profiles can be stored and retrieved by
              the WebInspector when that time comes.
      
              * JavaScriptCore.exp: Export the new function signatures.
              * JavaScriptCore.xcodeproj/project.pbxproj: Add the new files to the
              project
              * profiler/Profile.cpp: Added. This class represents a single run of the
              profiler.
              (KJS::Profile::Profile):
              (KJS::Profile::willExecute):
              (KJS::Profile::didExecute):
              (KJS::Profile::printDataInspectorStyle):
              (KJS::functionNameCountPairComparator):
              (KJS::Profile::printDataSampleStyle):
              * profiler/Profile.h: Added. Ditto
              (KJS::Profile::stopProfiling):
              * profiler/Profiler.cpp: Now the profiler keeps track of many profiles
              but only runs one at a time.
              (KJS::Profiler::startProfiling):
              (KJS::Profiler::stopProfiling):
              (KJS::Profiler::willExecute):
              (KJS::Profiler::didExecute):
              (KJS::Profiler::printDataInspectorStyle):
              (KJS::Profiler::printDataSampleStyle):
              * profiler/Profiler.h: Ditto.
              (KJS::Profiler::~Profiler):
              (KJS::Profiler::allProfiles):
              (KJS::Profiler::clearProfiles):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@33007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      320e01ec
  10. 08 May, 2008 1 commit
  11. 07 May, 2008 2 commits
  12. 05 May, 2008 1 commit
  13. 02 May, 2008 3 commits
    • ap@webkit.org's avatar
      Reviewed by Geoffrey Garen. · 7f250f84
      ap@webkit.org authored
              Get rid of static data in nodes.cpp (well, at least of non-debug one).
      
              No measurable change on SunSpider.
      
              * kjs/InitializeThreading.cpp:
              (KJS::initializeThreadingOnce):
              * kjs/nodes.cpp:
              (KJS::newTrackedObjects):
              (KJS::trackedObjectExtraRefCounts):
              (KJS::initializeNodesThreading):
              (KJS::ParserRefCounted::ParserRefCounted):
              (KJS::ParserRefCounted::ref):
              (KJS::ParserRefCounted::deref):
              (KJS::ParserRefCounted::refcount):
              (KJS::ParserRefCounted::deleteNewObjects):
              * kjs/nodes.h:
              Made newTrackedObjects and trackedObjectExtraRefCounts per-thread.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32822 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7f250f84
    • ap@webkit.org's avatar
      Reviewed by Darin. · 6b40fecd
      ap@webkit.org authored
              Move call stack depth counter to global object.
      
              * kjs/ExecState.h: (KJS::ExecState::functionCallDepth): Added a recursion depth counter to
              per-thread data.
              * kjs/JSGlobalObject.cpp: (KJS::JSGlobalObject::init): Initialize PerThreadData.functionCallDepth.
              * kjs/JSGlobalObject.h: (KJS::JSGlobalObject::perThreadData): Made the result non-const.
      
              * kjs/object.cpp:
              (KJS::throwStackSizeExceededError): Moved throwError to a separate function, since it is now
              the only thing in JSObject::call that needs a PIC branch.
              (KJS::JSObject::call): Use a per-thread variable instead of local static for recursion depth
              tracking.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32819 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6b40fecd
    • ap@webkit.org's avatar
      Reviewed by Darin. · 3d4a5419
      ap@webkit.org authored
              Make JavaScriptGlue and JavaScriptCore API functions implicitly call initializeThreading
              for the sake of non-WebKit clients.
      
      JavaScriptCore:
              * API/JSBase.cpp:
              (JSGarbageCollect):
              * API/JSContextRef.cpp:
              (JSGlobalContextCreate):
              These are the JavaScriptCore API bottlenecks. There are a few other JSStringRef
              and JSClassRef functions that can be called earlier, but they do not do anything that
              requires initializeThreading.
      
              * kjs/InitializeThreading.cpp:
              (KJS::doInitializeThreading):
              (KJS::initializeThreading):
              On Darwin, make the initialization happen under pthread_once, since there is no guarantee
              that non-WebKit clients won't try to call this function re-entrantly.
      
              * kjs/InitializeThreading.h:
              * wtf/Threading.h:
              Spell out initializeThreading contract.
      
              * wtf/ThreadingPthreads.cpp: (WTF::isMainThread): Make sure that results are correct on
              Darwin, even if threading was initialized from a secondary thread.
      
      JavaScriptGlue:
              * JavaScriptGlue.cpp:
              (JSRunCreate):
              (JSCollect):
              (JSCreateJSArrayFromCFArray):
              (JSLockInterpreter):
              These are all possible JavaScriptGlue entry points.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32808 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3d4a5419