2008-04-18 Kevin McCullough <kmccullough@apple.com>
authorkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2008 21:49:56 +0000 (21:49 +0000)
committerkmccullough@apple.com <kmccullough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Apr 2008 21:49:56 +0000 (21:49 +0000)
commit46853f4d2aa2a0dbee712c2aacbc7ce7c5855165
treebabfff3c89a2f6b597a26942d80716f7ef097f18
parentbdadf72ff2f91f866496fad1d1f5cf8ffb9d053c
2008-04-18  Kevin McCullough  <kmccullough@apple.com>

        Reviewed by Sam and Adam.

        -<rdar://problem/5770054> JavaScript profiler (10928)
        - Cleaned up the header file and made some functions static, added
        a new, sane, printing function, and fixed a few minor bugs.

        * JavaScriptCore.exp:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * profiler/FunctionCallProfile.cpp:
        (KJS::FunctionCallProfile::didExecute): Removed assertion that time is
        > 0 because at ms resolution that may not be true and only cross-
        platform way to get time differences is in ms.
        (KJS::FunctionCallProfile::printDataInspectorStyle): Added a new
        printing function for dumping data in a sane style.
        (KJS::FunctionCallProfile::printDataSampleStyle): Fixed a bug where we
        displayed too much precision when printing our floats. Also added logic
        to make sure we don't display 0 because that doesn't make sense for a
        sampling profile.
        * profiler/FunctionCallProfile.h:
        * profiler/Profiler.cpp: Moved functions that could be static into the
        implementation, and chaned the ASSERTs to early returns.  I did this
        because console.profile() is a JS function and so was being profiled
        but asserting because the profiler had not been started! In the future
        I would like to put the ASSERTs back and not profile the calls to
        console.profile() and console.profileEnd().
        (KJS::Profiler::willExecute):
        (KJS::Profiler::didExecute):
        (KJS::getStackNames): Fixed a bug where the wrong ExecState was being
        used.
        (KJS::getFunctionName):
        (KJS::Profiler::printDataInspectorStyle):
        * profiler/Profiler.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32228 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.exp
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/profiler/FunctionCallProfile.cpp
JavaScriptCore/profiler/FunctionCallProfile.h
JavaScriptCore/profiler/Profiler.cpp
JavaScriptCore/profiler/Profiler.h