Add column number and call timing support to LegacyProfiler.
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Jan 2014 01:34:54 +0000 (01:34 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Jan 2014 01:34:54 +0000 (01:34 +0000)
commitd35ef09e3d1557162ab5fb683282cd7a04f8b8f6
tree6019e2589d46ba305c1f2a2ee9b3dc2d3ddbb018
parent45fac45ce105f16b398faf3a42d794515db17641
Add column number and call timing support to LegacyProfiler.

https://bugs.webkit.org/show_bug.cgi?id=127764

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
* profiler/CallIdentifier.h:
(JSC::CallIdentifier::CallIdentifier):
(JSC::CallIdentifier::functionName):
(JSC::CallIdentifier::url):
(JSC::CallIdentifier::lineNumber):
(JSC::CallIdentifier::columnNumber):
(JSC::CallIdentifier::operator==):
(JSC::CallIdentifier::operator!=):
(JSC::CallIdentifier::Hash::hash):
(WTF::HashTraits<JSC::CallIdentifier>::constructDeletedValue):
(WTF::HashTraits<JSC::CallIdentifier>::isDeletedValue):
* profiler/LegacyProfiler.cpp:
(JSC::LegacyProfiler::willExecute):
(JSC::LegacyProfiler::didExecute):
(JSC::LegacyProfiler::exceptionUnwind):
(JSC::LegacyProfiler::createCallIdentifier):
(JSC::createCallIdentifierFromFunctionImp):
* profiler/LegacyProfiler.h:
* profiler/Profile.cpp:
(JSC::Profile::Profile):
* profiler/Profile.h:
(JSC::Profile::uid):
(JSC::Profile::idleTime):
(JSC::Profile::setIdleTime):
* profiler/ProfileGenerator.cpp:
(JSC::AddParentForConsoleStartFunctor::operator()):
(JSC::ProfileGenerator::addParentForConsoleStart):
(JSC::ProfileGenerator::willExecute):
(JSC::ProfileGenerator::didExecute):
(JSC::ProfileGenerator::stopProfiling):
(JSC::ProfileGenerator::removeProfileStart):
(JSC::ProfileGenerator::removeProfileEnd):
* profiler/ProfileNode.cpp:
(JSC::ProfileNode::ProfileNode):
(JSC::ProfileNode::stopProfiling):
(JSC::ProfileNode::endAndRecordCall):
(JSC::ProfileNode::startTimer):
(JSC::ProfileNode::debugPrintData):
* profiler/ProfileNode.h:
(JSC::ProfileNode::Call::Call):
(JSC::ProfileNode::Call::startTime):
(JSC::ProfileNode::Call::setStartTime):
(JSC::ProfileNode::Call::totalTime):
(JSC::ProfileNode::Call::setTotalTime):
(JSC::ProfileNode::id):
(JSC::ProfileNode::functionName):
(JSC::ProfileNode::url):
(JSC::ProfileNode::lineNumber):
(JSC::ProfileNode::columnNumber):
(JSC::ProfileNode::calls):
(JSC::ProfileNode::lastCall):
(JSC::ProfileNode::numberOfCalls):

Source/WebCore:

* bindings/js/ScriptProfile.cpp:
(WebCore::ScriptProfile::idleTime):
(WebCore::buildInspectorObjectFor):
(WebCore::ScriptProfile::buildInspectorObject):
* bindings/js/ScriptProfile.h:
* inspector/InspectorHeapProfilerAgent.cpp:
(WebCore::InspectorHeapProfilerAgent::createSnapshotHeader):
* inspector/InspectorProfilerAgent.cpp:
(WebCore::InspectorProfilerAgent::createSnapshotHeader):
(WebCore::InspectorProfilerAgent::getCPUProfile):
* inspector/ScriptProfileNode.idl:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::appendProfile):
* inspector/protocol/Profiler.json:

LayoutTests:

Update test and results to include column numbers.

* fast/profiler/anonymous-event-handler-expected.txt:
* fast/profiler/anonymous-function-called-from-different-contexts-expected.txt:
* fast/profiler/anonymous-function-calls-built-in-functions-expected.txt:
* fast/profiler/anonymous-function-calls-eval-expected.txt:
* fast/profiler/anonymous-functions-with-display-names-expected.txt:
* fast/profiler/apply-expected.txt:
* fast/profiler/built-in-function-calls-anonymous-expected.txt:
* fast/profiler/built-in-function-calls-user-defined-function-expected.txt:
* fast/profiler/call-expected.txt:
* fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt:
* fast/profiler/compare-multiple-profiles-expected.txt:
* fast/profiler/constructor-expected.txt:
* fast/profiler/dead-time-expected.txt:
* fast/profiler/document-dot-write-expected.txt:
* fast/profiler/event-handler-expected.txt:
* fast/profiler/execution-context-and-eval-on-same-line-expected.txt:
* fast/profiler/inline-event-handler-expected.txt:
* fast/profiler/many-calls-in-the-same-scope-expected.txt:
* fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt:
* fast/profiler/multiple-and-different-scoped-function-calls-expected.txt:
* fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt:
* fast/profiler/multiple-frames-expected.txt:
* fast/profiler/named-functions-with-display-names-expected.txt:
* fast/profiler/nested-anonymous-functon-expected.txt:
* fast/profiler/nested-start-and-stop-profiler-expected.txt:
* fast/profiler/one-execution-context-expected.txt:
* fast/profiler/profile-calls-in-included-file-expected.txt:
* fast/profiler/profile-with-no-title-expected.txt:
* fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt:
* fast/profiler/profiling-from-a-nested-location-expected.txt:
* fast/profiler/resources/profiler-test-JS-resources.js:
(printProfileNodeWithoutTime):
* fast/profiler/simple-event-call-expected.txt:
* fast/profiler/simple-no-level-change-expected.txt:
* fast/profiler/start-and-stop-profiler-multiple-times-expected.txt:
* fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt:
* fast/profiler/stop-profiling-after-setTimeout-expected.txt:
* fast/profiler/stop-then-function-call-expected.txt:
* fast/profiler/two-execution-contexts-expected.txt:
* fast/profiler/user-defined-function-calls-built-in-functions-expected.txt:
* fast/profiler/window-dot-eval-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
60 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/profiler/anonymous-event-handler-expected.txt
LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts-expected.txt
LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions-expected.txt
LayoutTests/fast/profiler/anonymous-function-calls-eval-expected.txt
LayoutTests/fast/profiler/anonymous-functions-with-display-names-expected.txt
LayoutTests/fast/profiler/apply-expected.txt
LayoutTests/fast/profiler/built-in-function-calls-anonymous-expected.txt
LayoutTests/fast/profiler/built-in-function-calls-user-defined-function-expected.txt
LayoutTests/fast/profiler/call-expected.txt
LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt
LayoutTests/fast/profiler/compare-multiple-profiles-expected.txt
LayoutTests/fast/profiler/constructor-expected.txt
LayoutTests/fast/profiler/dead-time-expected.txt
LayoutTests/fast/profiler/document-dot-write-expected.txt
LayoutTests/fast/profiler/event-handler-expected.txt
LayoutTests/fast/profiler/execution-context-and-eval-on-same-line-expected.txt
LayoutTests/fast/profiler/inline-event-handler-expected.txt
LayoutTests/fast/profiler/many-calls-in-the-same-scope-expected.txt
LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt
LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls-expected.txt
LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt
LayoutTests/fast/profiler/multiple-frames-expected.txt
LayoutTests/fast/profiler/named-functions-with-display-names-expected.txt
LayoutTests/fast/profiler/nested-anonymous-functon-expected.txt
LayoutTests/fast/profiler/nested-start-and-stop-profiler-expected.txt
LayoutTests/fast/profiler/one-execution-context-expected.txt
LayoutTests/fast/profiler/profile-calls-in-included-file-expected.txt
LayoutTests/fast/profiler/profile-with-no-title-expected.txt
LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt
LayoutTests/fast/profiler/profiling-from-a-nested-location-expected.txt
LayoutTests/fast/profiler/resources/profiler-test-JS-resources.js
LayoutTests/fast/profiler/simple-event-call-expected.txt
LayoutTests/fast/profiler/simple-no-level-change-expected.txt
LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times-expected.txt
LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt
LayoutTests/fast/profiler/stop-profiling-after-setTimeout-expected.txt
LayoutTests/fast/profiler/stop-then-function-call-expected.txt
LayoutTests/fast/profiler/two-execution-contexts-expected.txt
LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions-expected.txt
LayoutTests/fast/profiler/window-dot-eval-expected.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/interpreter/Interpreter.cpp
Source/JavaScriptCore/profiler/CallIdentifier.h
Source/JavaScriptCore/profiler/LegacyProfiler.cpp
Source/JavaScriptCore/profiler/LegacyProfiler.h
Source/JavaScriptCore/profiler/Profile.cpp
Source/JavaScriptCore/profiler/Profile.h
Source/JavaScriptCore/profiler/ProfileGenerator.cpp
Source/JavaScriptCore/profiler/ProfileGenerator.h
Source/JavaScriptCore/profiler/ProfileNode.cpp
Source/JavaScriptCore/profiler/ProfileNode.h
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ScriptProfile.cpp
Source/WebCore/bindings/js/ScriptProfile.h
Source/WebCore/inspector/InspectorHeapProfilerAgent.cpp
Source/WebCore/inspector/InspectorProfilerAgent.cpp
Source/WebCore/inspector/ScriptProfileNode.idl
Source/WebCore/inspector/TimelineRecordFactory.cpp
Source/WebCore/inspector/protocol/Profiler.json