Fixes an ASSERT in the profiler when starting multiple profiles
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jun 2008 21:44:42 +0000 (21:44 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jun 2008 21:44:42 +0000 (21:44 +0000)
commit88624d12cb8403f42a0b23dbbd7c2762fcd6e38d
treeff92648cbcdf8c994529f8c77a8f68dfde89b14e
parenta641b1f260435c5470beded38713e5caece7ae5c
    Fixes an ASSERT in the profiler when starting multiple profiles
        with the same name inside the same function/program.

        Reviewed by Kevin McCullough.

        * profiler/Profile.cpp:
        (KJS::Profile::Profile): Initialize m_stoppedCallDepth to zero.
        (KJS::Profile::stopProfiling): Set the current node to the parent,
        because we are in a call that will not get a didExecute call.
        (KJS::Profile::removeProfile): Increment m_stoppedCallDepth to
        account for didExecute not being called for profile.
        (KJS::Profile::willExecute): Increment m_stoppedCallDepth if stopped.
        (KJS::Profile::didExecute): Decrement m_stoppedCallDepth if stopped and
        greater than zero, and return early.
        * profiler/Profile.h: Added stoppedProfiling().
        * profiler/Profiler.cpp:
        (KJS::Profiler::findProfile): Removed.
        (KJS::Profiler::startProfiling): Don't return early for stopped profiles.
        (KJS::Profiler::stopProfiling): Skipp stopped profiles.
        (KJS::Profiler::didFinishAllExecution): Code clean-up.
        * profiler/Profiler.h: Removed findProfile.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34800 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/profiler/Profile.cpp
JavaScriptCore/profiler/Profile.h
JavaScriptCore/profiler/Profiler.cpp
JavaScriptCore/profiler/Profiler.h
WebCore/manual-tests/inspector/profiler-test-compare-multiple-profiles.html
WebCore/manual-tests/inspector/profiler-test-stop-then-function-call.html [new file with mode: 0644]