<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[200973] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/200973">200973</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-16 15:31:13 -0700 (Mon, 16 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed rollout <a href="http://trac.webkit.org/projects/webkit/changeset/200924">r200924</a>. Caused js/regress/string-replace-generic.html to fail.

.:

* ManualTests/inspector/profiler-test-call.html: Added.
* ManualTests/inspector/profiler-test-many-calls-in-the-same-scope.html: Added.

Source/JavaScriptCore:

* API/JSProfilerPrivate.cpp: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
(JSStartProfiling):
(JSEndProfiling):
* API/JSProfilerPrivate.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::generateUnlinkedFunctionCodeBlock):
(JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
* bytecode/UnlinkedFunctionExecutable.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitCall):
(JSC::BytecodeGenerator::emitCallVarargs):
(JSC::BytecodeGenerator::emitCallVarargsInTailPosition):
(JSC::BytecodeGenerator::emitConstructVarargs):
(JSC::BytecodeGenerator::emitConstruct):
* bytecompiler/BytecodeGenerator.h:
(JSC::CallArguments::profileHookRegister):
(JSC::BytecodeGenerator::shouldEmitProfileHooks):
* bytecompiler/NodesCodegen.cpp:
(JSC::CallArguments::CallArguments):
(JSC::CallFunctionCallDotNode::emitBytecode):
(JSC::ApplyFunctionCallDotNode::emitBytecode):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter&lt;AbstractStateType&gt;::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* inspector/InjectedScriptBase.cpp:
(Inspector::InjectedScriptBase::callFunctionWithEvalEnabled):
* inspector/protocol/Timeline.json:
* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::operator()):
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_profile_will_call):
(JSC::JIT::emit_op_profile_did_call):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_profile_will_call):
(JSC::JIT::emit_op_profile_did_call):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jsc.cpp:
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:
* parser/ParserModes.h:
* profiler/CallIdentifier.h: Added.
(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):
(JSC::CallIdentifier::Hash::equal):
(JSC::CallIdentifier::hash):
(JSC::CallIdentifier::operator const char*):
(JSC::CallIdentifier::c_str):
(WTF::HashTraits&lt;JSC::CallIdentifier&gt;::constructDeletedValue):
(WTF::HashTraits&lt;JSC::CallIdentifier&gt;::isDeletedValue):
* profiler/LegacyProfiler.cpp: Added.
(JSC::LegacyProfiler::profiler):
(JSC::LegacyProfiler::startProfiling):
(JSC::LegacyProfiler::stopProfiling):
(JSC::callFunctionForProfilesWithGroup):
(JSC::LegacyProfiler::suspendProfiling):
(JSC::LegacyProfiler::unsuspendProfiling):
(JSC::LegacyProfiler::willExecute):
(JSC::LegacyProfiler::didExecute):
(JSC::LegacyProfiler::exceptionUnwind):
(JSC::LegacyProfiler::createCallIdentifier):
(JSC::createCallIdentifierFromFunctionImp):
* profiler/LegacyProfiler.h: Added.
(JSC::LegacyProfiler::currentProfiles):
* profiler/Profile.cpp: Added.
(JSC::Profile::create):
(JSC::Profile::Profile):
(JSC::Profile::~Profile):
(JSC::Profile::debugPrint):
(JSC::functionNameCountPairComparator):
(JSC::Profile::debugPrintSampleStyle):
* profiler/Profile.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
* profiler/ProfileGenerator.cpp: Added.
(JSC::ProfileGenerator::create):
(JSC::ProfileGenerator::ProfileGenerator):
(JSC::AddParentForConsoleStartFunctor::AddParentForConsoleStartFunctor):
(JSC::AddParentForConsoleStartFunctor::foundParent):
(JSC::AddParentForConsoleStartFunctor::operator()):
(JSC::ProfileGenerator::addParentForConsoleStart):
(JSC::ProfileGenerator::title):
(JSC::ProfileGenerator::beginCallEntry):
(JSC::ProfileGenerator::endCallEntry):
(JSC::ProfileGenerator::willExecute):
(JSC::ProfileGenerator::didExecute):
(JSC::ProfileGenerator::exceptionUnwind):
(JSC::ProfileGenerator::stopProfiling):
(JSC::ProfileGenerator::removeProfileStart):
(JSC::ProfileGenerator::removeProfileEnd):
* profiler/ProfileGenerator.h: Added.
(JSC::ProfileGenerator::profile):
(JSC::ProfileGenerator::origin):
(JSC::ProfileGenerator::profileGroup):
(JSC::ProfileGenerator::setIsSuspended):
* profiler/ProfileNode.cpp: Added.
(JSC::ProfileNode::ProfileNode):
(JSC::ProfileNode::addChild):
(JSC::ProfileNode::removeChild):
(JSC::ProfileNode::spliceNode):
(JSC::ProfileNode::traverseNextNodePostOrder):
(JSC::ProfileNode::debugPrint):
(JSC::ProfileNode::debugPrintSampleStyle):
(JSC::ProfileNode::debugPrintRecursively):
(JSC::ProfileNode::debugPrintSampleStyleRecursively):
* profiler/ProfileNode.h: Added.
(JSC::ProfileNode::create):
(JSC::ProfileNode::Call::Call):
(JSC::ProfileNode::Call::startTime):
(JSC::ProfileNode::Call::setStartTime):
(JSC::ProfileNode::Call::elapsedTime):
(JSC::ProfileNode::Call::setElapsedTime):
(JSC::ProfileNode::operator==):
(JSC::ProfileNode::callerCallFrame):
(JSC::ProfileNode::callIdentifier):
(JSC::ProfileNode::id):
(JSC::ProfileNode::functionName):
(JSC::ProfileNode::url):
(JSC::ProfileNode::lineNumber):
(JSC::ProfileNode::columnNumber):
(JSC::ProfileNode::parent):
(JSC::ProfileNode::setParent):
(JSC::ProfileNode::calls):
(JSC::ProfileNode::lastCall):
(JSC::ProfileNode::appendCall):
(JSC::ProfileNode::children):
(JSC::ProfileNode::firstChild):
(JSC::ProfileNode::lastChild):
(JSC::ProfileNode::nextSibling):
(JSC::ProfileNode::setNextSibling):
(JSC::ProfileNode::forEachNodePostorder):
(JSC::CalculateProfileSubtreeDataFunctor::operator()):
(JSC::CalculateProfileSubtreeDataFunctor::returnValue):
* profiler/ProfilerJettisonReason.cpp:
(WTF::printInternal):
* profiler/ProfilerJettisonReason.h:
* runtime/CodeCache.cpp:
(JSC::CodeCache::getGlobalCodeBlock):
(JSC::CodeCache::getProgramCodeBlock):
(JSC::CodeCache::getEvalCodeBlock):
(JSC::CodeCache::getModuleProgramCodeBlock):
* runtime/CodeCache.h:
* runtime/Executable.cpp:
(JSC::ScriptExecutable::newCodeBlockFor):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::~JSGlobalObject):
(JSC::JSGlobalObject::hasLegacyProfiler):
(JSC::JSGlobalObject::createProgramCodeBlock):
(JSC::JSGlobalObject::createEvalCodeBlock):
(JSC::JSGlobalObject::createModuleProgramCodeBlock):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::supportsLegacyProfiling):
* runtime/Options.h:
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::SetEnabledProfilerFunctor::operator()):
(JSC::VM::setEnabledProfiler):
* runtime/VM.h:
(JSC::VM::enabledProfiler):
(JSC::VM::enabledProfilerAddress):

Source/WebCore:

Tests: fast/profiler/*

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* ForwardingHeaders/profiler/LegacyProfiler.h: Added.
* ForwardingHeaders/profiler/Profile.h: Added.
* ForwardingHeaders/profiler/ProfileNode.h: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCustomXPathNSResolver.cpp:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::supportsLegacyProfiling):
(WebCore::JSDOMWindowBase::supportsRichSourceInfo):
* bindings/js/JSDOMWindowBase.h:
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
* bindings/js/JSWorkerGlobalScopeBase.h:
* bindings/js/ScriptCachedFrameData.cpp:
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::clearWindowShell):
* bindings/js/ScriptProfile.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
* bindings/js/ScriptProfileNode.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
* bindings/scripts/CodeGeneratorJS.pm:
(AddClassForwardIfNeeded):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
(WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
* bindings/scripts/test/TestObj.idl:
* css/CSSParser.cpp:
* dom/Document.cpp:
* inspector/InspectorConsoleInstrumentation.h:
(WebCore::InspectorInstrumentation::stopProfiling):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::legacyProfilerEnabled):
(WebCore::InspectorController::setLegacyProfilerEnabled):
* inspector/InspectorController.h:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::stopProfilingImpl):
* inspector/InspectorInstrumentation.h:
* inspector/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::startFromConsole):
(WebCore::InspectorTimelineAgent::stopFromConsole):
* inspector/InspectorTimelineAgent.h:
* inspector/PageDebuggerAgent.cpp:
* inspector/PageRuntimeAgent.cpp:
* inspector/ScriptProfile.idl: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
* inspector/ScriptProfileNode.idl: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
* inspector/TimelineRecordFactory.cpp:
(WebCore::buildAggregateCallInfoInspectorObject):
(WebCore::buildInspectorObject):
(WebCore::buildProfileInspectorObject):
(WebCore::TimelineRecordFactory::appendProfile):
* inspector/TimelineRecordFactory.h:
* page/DOMWindow.cpp:
* page/Page.cpp:
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::profileEnd):
(WebCore::PageConsoleClient::clearProfiles):
* page/PageConsoleClient.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::consoleProfiles):
(WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
* testing/Internals.h:
* testing/Internals.idl:
* testing/js/WebCoreTestSupport.cpp:
* xml/XSLStyleSheetLibxslt.cpp:
* xml/XSLTProcessorLibxslt.cpp:

Source/WebKit/win:

* Interfaces/IWebInspector.idl:
* WebCoreStatistics.cpp:
* WebInspector.cpp:
(WebInspector::isJavaScriptProfilingEnabled):
(WebInspector::setJavaScriptProfilingEnabled):
* WebInspector.h:
* WebView.cpp:

LayoutTests:

* fast/profiler/anonymous-event-handler-expected.txt: Added.
* fast/profiler/anonymous-event-handler.html: Added.
* fast/profiler/anonymous-function-called-from-different-contexts-expected.txt: Added.
* fast/profiler/anonymous-function-called-from-different-contexts.html: Added.
* fast/profiler/anonymous-function-calls-built-in-functions-expected.txt: Added.
* fast/profiler/anonymous-function-calls-built-in-functions.html: Added.
* fast/profiler/anonymous-function-calls-eval-expected.txt: Added.
* fast/profiler/anonymous-function-calls-eval.html: Added.
* fast/profiler/anonymous-functions-with-display-names-expected.txt: Added.
* fast/profiler/anonymous-functions-with-display-names.html: Added.
* fast/profiler/apply-expected.txt: Added.
* fast/profiler/apply.html: Added.
* fast/profiler/built-in-function-calls-anonymous-expected.txt: Added.
* fast/profiler/built-in-function-calls-anonymous.html: Added.
* fast/profiler/built-in-function-calls-user-defined-function-expected.txt: Added.
* fast/profiler/built-in-function-calls-user-defined-function.html: Added.
* fast/profiler/call-expected.txt: Added.
* fast/profiler/call-register-leak-expected.txt: Added.
* fast/profiler/call-register-leak.html: Added.
* fast/profiler/call.html: Added.
* fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt: Added.
* fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope.html: Added.
* fast/profiler/compare-multiple-profiles-expected.txt: Added.
* fast/profiler/compare-multiple-profiles.html: Added.
* fast/profiler/constructor-expected.txt: Added.
* fast/profiler/constructor.html: Added.
* fast/profiler/dead-time-expected.txt: Added.
* fast/profiler/dead-time.html: Added.
* fast/profiler/document-dot-write-expected.txt: Added.
* fast/profiler/document-dot-write.html: Added.
* fast/profiler/event-handler-expected.txt: Added.
* fast/profiler/event-handler.html: Added.
* fast/profiler/execution-context-and-eval-on-same-line-expected.txt: Added.
* fast/profiler/execution-context-and-eval-on-same-line.html: Added.
* fast/profiler/inline-event-handler-expected.txt: Added.
* fast/profiler/inline-event-handler.html: Added.
* fast/profiler/many-calls-in-the-same-scope-expected.txt: Added.
* fast/profiler/many-calls-in-the-same-scope.html: Added.
* fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt: Added.
* fast/profiler/multiple-and-different-scoped-anonymous-function-calls.html: Added.
* fast/profiler/multiple-and-different-scoped-function-calls-expected.txt: Added.
* fast/profiler/multiple-and-different-scoped-function-calls.html: Added.
* fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt: Added.
* fast/profiler/multiple-anonymous-functions-called-from-the-same-function.html: Added.
* fast/profiler/multiple-frames-expected.txt: Added.
* fast/profiler/multiple-frames.html: Added.
* fast/profiler/named-functions-with-display-names-expected.txt: Added.
* fast/profiler/named-functions-with-display-names.html: Added.
* fast/profiler/nested-anonymous-functon-expected.txt: Added.
* fast/profiler/nested-anonymous-functon.html: Added.
* fast/profiler/nested-start-and-stop-profiler-expected.txt: Added.
* fast/profiler/nested-start-and-stop-profiler.html: Added.
* fast/profiler/no-execution-context-expected.txt: Added.
* fast/profiler/no-execution-context.html: Added.
* fast/profiler/one-execution-context-expected.txt: Added.
* fast/profiler/one-execution-context.html: Added.
* fast/profiler/profile-calls-in-included-file-expected.txt: Added.
* fast/profiler/profile-calls-in-included-file.html: Added.
* fast/profiler/profile-with-no-title-expected.txt: Added.
* fast/profiler/profile-with-no-title.html: Added.
* fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt: Added.
* fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html: Added.
* fast/profiler/profiling-from-a-nested-location-expected.txt: Added.
* fast/profiler/profiling-from-a-nested-location.html: Added.
* fast/profiler/resources/other-frame.html: Added.
* fast/profiler/resources/other-window.html: Added.
* fast/profiler/resources/profiler-test-JS-resources.js: Added.
(endTest):
(insertGivenText):
(insertNewText):
(arrayOperatorFunction):
(anonymousFunction):
(anotherAnonymousFunction):
(intermediaryFunction):
(isEqualToFive):
(startProfile):
(printHeavyProfilesDataWithoutTime):
(printProfilesDataWithoutTime):
(printProfileNodeWithoutTime):
* fast/profiler/simple-event-call-expected.txt: Added.
* fast/profiler/simple-event-call.html: Added.
* fast/profiler/simple-no-level-change-expected.txt: Added.
* fast/profiler/simple-no-level-change.html: Added.
* fast/profiler/start-and-stop-profiler-multiple-times-expected.txt: Added.
* fast/profiler/start-and-stop-profiler-multiple-times.html: Added.
* fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt: Added.
* fast/profiler/start-and-stop-profiling-in-the-same-function.html: Added.
* fast/profiler/start-but-dont-stop-profiling-expected.txt: Added.
* fast/profiler/start-but-dont-stop-profiling.html: Added.
* fast/profiler/stop-profiling-after-setTimeout-expected.txt: Added.
* fast/profiler/stop-profiling-after-setTimeout.html: Added.
* fast/profiler/stop-then-function-call-expected.txt: Added.
* fast/profiler/stop-then-function-call.html: Added.
* fast/profiler/throw-exception-from-eval-expected.txt: Added.
* fast/profiler/throw-exception-from-eval.html-disabled: Added.
* fast/profiler/two-execution-contexts-expected.txt: Added.
* fast/profiler/two-execution-contexts.html: Added.
* fast/profiler/user-defined-function-calls-built-in-functions-expected.txt: Added.
* fast/profiler/user-defined-function-calls-built-in-functions.html: Added.
* fast/profiler/window-dot-eval-expected.txt: Added.
* fast/profiler/window-dot-eval.html: Added.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkChangeLog">trunk/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkSourceJavaScriptCoreCMakeListstxt">trunk/Source/JavaScriptCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj">trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeListjson">trunk/Source/JavaScriptCore/bytecode/BytecodeList.json</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeBytecodeUseDefh">trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeCodeBlockcpp">trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutablecpp">trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh">trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGAbstractInterpreterInlinesh">trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp">trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGCapabilitiescpp">trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGClobberizeh">trunk/Source/JavaScriptCore/dfg/DFGClobberize.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGDoesGCcpp">trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGFixupPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGNodeTypeh">trunk/Source/JavaScriptCore/dfg/DFGNodeType.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp">trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSafeToExecuteh">trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp">trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptBasecpp">trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolTimelinejson">trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreinterpreterInterpretercpp">trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITcpp">trunk/Source/JavaScriptCore/jit/JIT.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITh">trunk/Source/JavaScriptCore/jit/JIT.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodescpp">trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOpcodes32_64cpp">trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationscpp">trunk/Source/JavaScriptCore/jit/JITOperations.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorejitJITOperationsh">trunk/Source/JavaScriptCore/jit/JITOperations.h</a></li>
<li><a href="#trunkSourceJavaScriptCorejsccpp">trunk/Source/JavaScriptCore/jsc.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathscpp">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLLIntSlowPathsh">trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h</a></li>
<li><a href="#trunkSourceJavaScriptCorellintLowLevelInterpreterasm">trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm</a></li>
<li><a href="#trunkSourceJavaScriptCoreparserParserModesh">trunk/Source/JavaScriptCore/parser/ParserModes.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerJettisonReasoncpp">trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh">trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCodeCachecpp">trunk/Source/JavaScriptCore/runtime/CodeCache.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeCodeCacheh">trunk/Source/JavaScriptCore/runtime/CodeCache.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeExecutablecpp">trunk/Source/JavaScriptCore/runtime/Executable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeOptionsh">trunk/Source/JavaScriptCore/runtime/Options.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMcpp">trunk/Source/JavaScriptCore/runtime/VM.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMh">trunk/Source/JavaScriptCore/runtime/VM.h</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcescpp">trunk/Source/WebCore/DerivedSources.cpp</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSCustomXPathNSResolvercpp">trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowBasecpp">trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowBaseh">trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWorkerGlobalScopeBasecpp">trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWorkerGlobalScopeBaseh">trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptCachedFrameDatacpp">trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptControllercpp">trunk/Source/WebCore/bindings/js/ScriptController.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorConsoleInstrumentationh">trunk/Source/WebCore/inspector/InspectorConsoleInstrumentation.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorControllercpp">trunk/Source/WebCore/inspector/InspectorController.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorControllerh">trunk/Source/WebCore/inspector/InspectorController.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorInstrumentationcpp">trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorInstrumentationh">trunk/Source/WebCore/inspector/InspectorInstrumentation.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgentcpp">trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorTimelineAgenth">trunk/Source/WebCore/inspector/InspectorTimelineAgent.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageDebuggerAgentcpp">trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageRuntimeAgentcpp">trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorTimelineRecordFactorycpp">trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorTimelineRecordFactoryh">trunk/Source/WebCore/inspector/TimelineRecordFactory.h</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageConsoleClientcpp">trunk/Source/WebCore/page/PageConsoleClient.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageConsoleClienth">trunk/Source/WebCore/page/PageConsoleClient.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsh">trunk/Source/WebCore/testing/Internals.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalsidl">trunk/Source/WebCore/testing/Internals.idl</a></li>
<li><a href="#trunkSourceWebCoretestingjsWebCoreTestSupportcpp">trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXSLStyleSheetLibxsltcpp">trunk/Source/WebCore/xml/XSLStyleSheetLibxslt.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXSLTProcessorLibxsltcpp">trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinInterfacesIWebInspectoridl">trunk/Source/WebKit/win/Interfaces/IWebInspector.idl</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreStatisticscpp">trunk/Source/WebKit/win/WebCoreStatistics.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebInspectorcpp">trunk/Source/WebKit/win/WebInspector.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebInspectorh">trunk/Source/WebKit/win/WebInspector.h</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/fast/profiler/</li>
<li><a href="#trunkLayoutTestsfastprofileranonymouseventhandlerexpectedtxt">trunk/LayoutTests/fast/profiler/anonymous-event-handler-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofileranonymouseventhandlerhtml">trunk/LayoutTests/fast/profiler/anonymous-event-handler.html</a></li>
<li><a href="#trunkLayoutTestsfastprofileranonymousfunctioncalledfromdifferentcontextsexpectedtxt">trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofileranonymousfunctioncalledfromdifferentcontextshtml">trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts.html</a></li>
<li><a href="#trunkLayoutTestsfastprofileranonymousfunctioncallsbuiltinfunctionsexpectedtxt">trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofileranonymousfunctioncallsbuiltinfunctionshtml">trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions.html</a></li>
<li><a href="#trunkLayoutTestsfastprofileranonymousfunctioncallsevalexpectedtxt">trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofileranonymousfunctioncallsevalhtml">trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval.html</a></li>
<li><a href="#trunkLayoutTestsfastprofileranonymousfunctionswithdisplaynamesexpectedtxt">trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofileranonymousfunctionswithdisplaynameshtml">trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerapplyexpectedtxt">trunk/LayoutTests/fast/profiler/apply-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerapplyhtml">trunk/LayoutTests/fast/profiler/apply.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerbuiltinfunctioncallsanonymousexpectedtxt">trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerbuiltinfunctioncallsanonymoushtml">trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerbuiltinfunctioncallsuserdefinedfunctionexpectedtxt">trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerbuiltinfunctioncallsuserdefinedfunctionhtml">trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilercallexpectedtxt">trunk/LayoutTests/fast/profiler/call-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilercallregisterleakexpectedtxt">trunk/LayoutTests/fast/profiler/call-register-leak-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilercallregisterleakhtml">trunk/LayoutTests/fast/profiler/call-register-leak.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilercallhtml">trunk/LayoutTests/fast/profiler/call.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilercallingthefunctionthatstartedtheprofilerfromanotherscopeexpectedtxt">trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilercallingthefunctionthatstartedtheprofilerfromanotherscopehtml">trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilercomparemultipleprofilesexpectedtxt">trunk/LayoutTests/fast/profiler/compare-multiple-profiles-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilercomparemultipleprofileshtml">trunk/LayoutTests/fast/profiler/compare-multiple-profiles.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerconstructorexpectedtxt">trunk/LayoutTests/fast/profiler/constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerconstructorhtml">trunk/LayoutTests/fast/profiler/constructor.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerdeadtimeexpectedtxt">trunk/LayoutTests/fast/profiler/dead-time-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerdeadtimehtml">trunk/LayoutTests/fast/profiler/dead-time.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerdocumentdotwriteexpectedtxt">trunk/LayoutTests/fast/profiler/document-dot-write-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerdocumentdotwritehtml">trunk/LayoutTests/fast/profiler/document-dot-write.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilereventhandlerexpectedtxt">trunk/LayoutTests/fast/profiler/event-handler-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilereventhandlerhtml">trunk/LayoutTests/fast/profiler/event-handler.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerexecutioncontextandevalonsamelineexpectedtxt">trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerexecutioncontextandevalonsamelinehtml">trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerinlineeventhandlerexpectedtxt">trunk/LayoutTests/fast/profiler/inline-event-handler-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerinlineeventhandlerhtml">trunk/LayoutTests/fast/profiler/inline-event-handler.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilermanycallsinthesamescopeexpectedtxt">trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilermanycallsinthesamescopehtml">trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilermultipleanddifferentscopedanonymousfunctioncallsexpectedtxt">trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilermultipleanddifferentscopedanonymousfunctioncallshtml">trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilermultipleanddifferentscopedfunctioncallsexpectedtxt">trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilermultipleanddifferentscopedfunctioncallshtml">trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilermultipleanonymousfunctionscalledfromthesamefunctionexpectedtxt">trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilermultipleanonymousfunctionscalledfromthesamefunctionhtml">trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilermultipleframesexpectedtxt">trunk/LayoutTests/fast/profiler/multiple-frames-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilermultipleframeshtml">trunk/LayoutTests/fast/profiler/multiple-frames.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilernamedfunctionswithdisplaynamesexpectedtxt">trunk/LayoutTests/fast/profiler/named-functions-with-display-names-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilernamedfunctionswithdisplaynameshtml">trunk/LayoutTests/fast/profiler/named-functions-with-display-names.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilernestedanonymousfunctonexpectedtxt">trunk/LayoutTests/fast/profiler/nested-anonymous-functon-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilernestedanonymousfunctonhtml">trunk/LayoutTests/fast/profiler/nested-anonymous-functon.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilernestedstartandstopprofilerexpectedtxt">trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilernestedstartandstopprofilerhtml">trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilernoexecutioncontextexpectedtxt">trunk/LayoutTests/fast/profiler/no-execution-context-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilernoexecutioncontexthtml">trunk/LayoutTests/fast/profiler/no-execution-context.html</a></li>
<li><a href="#trunkLayoutTestsfastprofileroneexecutioncontextexpectedtxt">trunk/LayoutTests/fast/profiler/one-execution-context-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofileroneexecutioncontexthtml">trunk/LayoutTests/fast/profiler/one-execution-context.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerprofilecallsinincludedfileexpectedtxt">trunk/LayoutTests/fast/profiler/profile-calls-in-included-file-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerprofilecallsinincludedfilehtml">trunk/LayoutTests/fast/profiler/profile-calls-in-included-file.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerprofilewithnotitleexpectedtxt">trunk/LayoutTests/fast/profiler/profile-with-no-title-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerprofilewithnotitlehtml">trunk/LayoutTests/fast/profiler/profile-with-no-title.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerprofilingfromanestedlocationbutstopprofilingoutsidethenestingexpectedtxt">trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerprofilingfromanestedlocationbutstopprofilingoutsidethenestinghtml">trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerprofilingfromanestedlocationexpectedtxt">trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerprofilingfromanestedlocationhtml">trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location.html</a></li>
<li>trunk/LayoutTests/fast/profiler/resources/</li>
<li><a href="#trunkLayoutTestsfastprofilerresourcesotherframehtml">trunk/LayoutTests/fast/profiler/resources/other-frame.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerresourcesotherwindowhtml">trunk/LayoutTests/fast/profiler/resources/other-window.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerresourcesprofilertestJSresourcesjs">trunk/LayoutTests/fast/profiler/resources/profiler-test-JS-resources.js</a></li>
<li><a href="#trunkLayoutTestsfastprofilersimpleeventcallexpectedtxt">trunk/LayoutTests/fast/profiler/simple-event-call-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilersimpleeventcallhtml">trunk/LayoutTests/fast/profiler/simple-event-call.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilersimplenolevelchangeexpectedtxt">trunk/LayoutTests/fast/profiler/simple-no-level-change-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilersimplenolevelchangehtml">trunk/LayoutTests/fast/profiler/simple-no-level-change.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstartandstopprofilermultipletimesexpectedtxt">trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstartandstopprofilermultipletimeshtml">trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstartandstopprofilinginthesamefunctionexpectedtxt">trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstartandstopprofilinginthesamefunctionhtml">trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstartbutdontstopprofilingexpectedtxt">trunk/LayoutTests/fast/profiler/start-but-dont-stop-profiling-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstartbutdontstopprofilinghtml">trunk/LayoutTests/fast/profiler/start-but-dont-stop-profiling.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstopprofilingaftersetTimeoutexpectedtxt">trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstopprofilingaftersetTimeouthtml">trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstopthenfunctioncallexpectedtxt">trunk/LayoutTests/fast/profiler/stop-then-function-call-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerstopthenfunctioncallhtml">trunk/LayoutTests/fast/profiler/stop-then-function-call.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerthrowexceptionfromevalexpectedtxt">trunk/LayoutTests/fast/profiler/throw-exception-from-eval-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerthrowexceptionfromevalhtmldisabled">trunk/LayoutTests/fast/profiler/throw-exception-from-eval.html-disabled</a></li>
<li><a href="#trunkLayoutTestsfastprofilertwoexecutioncontextsexpectedtxt">trunk/LayoutTests/fast/profiler/two-execution-contexts-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilertwoexecutioncontextshtml">trunk/LayoutTests/fast/profiler/two-execution-contexts.html</a></li>
<li><a href="#trunkLayoutTestsfastprofileruserdefinedfunctioncallsbuiltinfunctionsexpectedtxt">trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofileruserdefinedfunctioncallsbuiltinfunctionshtml">trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions.html</a></li>
<li><a href="#trunkLayoutTestsfastprofilerwindowdotevalexpectedtxt">trunk/LayoutTests/fast/profiler/window-dot-eval-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastprofilerwindowdotevalhtml">trunk/LayoutTests/fast/profiler/window-dot-eval.html</a></li>
<li><a href="#trunkManualTestsinspectorprofilertestcallhtml">trunk/ManualTests/inspector/profiler-test-call.html</a></li>
<li><a href="#trunkManualTestsinspectorprofilertestmanycallsinthesamescopehtml">trunk/ManualTests/inspector/profiler-test-many-calls-in-the-same-scope.html</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSProfilerPrivatecpp">trunk/Source/JavaScriptCore/API/JSProfilerPrivate.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreAPIJSProfilerPrivateh">trunk/Source/JavaScriptCore/API/JSProfilerPrivate.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerCallIdentifierh">trunk/Source/JavaScriptCore/profiler/CallIdentifier.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerLegacyProfilercpp">trunk/Source/JavaScriptCore/profiler/LegacyProfiler.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerLegacyProfilerh">trunk/Source/JavaScriptCore/profiler/LegacyProfiler.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfilecpp">trunk/Source/JavaScriptCore/profiler/Profile.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfileh">trunk/Source/JavaScriptCore/profiler/Profile.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfileGeneratorcpp">trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfileGeneratorh">trunk/Source/JavaScriptCore/profiler/ProfileGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfileNodecpp">trunk/Source/JavaScriptCore/profiler/ProfileNode.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreprofilerProfileNodeh">trunk/Source/JavaScriptCore/profiler/ProfileNode.h</a></li>
<li><a href="#trunkSourceWebCoreForwardingHeadersprofilerLegacyProfilerh">trunk/Source/WebCore/ForwardingHeaders/profiler/LegacyProfiler.h</a></li>
<li><a href="#trunkSourceWebCoreForwardingHeadersprofilerProfileh">trunk/Source/WebCore/ForwardingHeaders/profiler/Profile.h</a></li>
<li><a href="#trunkSourceWebCoreForwardingHeadersprofilerProfileNodeh">trunk/Source/WebCore/ForwardingHeaders/profiler/ProfileNode.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptProfileh">trunk/Source/WebCore/bindings/js/ScriptProfile.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsScriptProfileNodeh">trunk/Source/WebCore/bindings/js/ScriptProfileNode.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorScriptProfileidl">trunk/Source/WebCore/inspector/ScriptProfile.idl</a></li>
<li><a href="#trunkSourceWebCoreinspectorScriptProfileNodeidl">trunk/Source/WebCore/inspector/ScriptProfileNode.idl</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/ChangeLog (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ChangeLog        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/ChangeLog        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1,3 +1,10 @@
</span><ins>+2016-05-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Unreviewed rollout r200924. Caused js/regress/string-replace-generic.html to fail.
+
+        * ManualTests/inspector/profiler-test-call.html: Added.
+        * ManualTests/inspector/profiler-test-many-calls-in-the-same-scope.html: Added.
+
</ins><span class="cx"> 2016-05-14  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove LegacyProfiler
</span></span></pre></div>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/LayoutTests/ChangeLog        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1,3 +1,112 @@
</span><ins>+2016-05-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Unreviewed rollout r200924. Caused js/regress/string-replace-generic.html to fail.
+
+        * fast/profiler/anonymous-event-handler-expected.txt: Added.
+        * fast/profiler/anonymous-event-handler.html: Added.
+        * fast/profiler/anonymous-function-called-from-different-contexts-expected.txt: Added.
+        * fast/profiler/anonymous-function-called-from-different-contexts.html: Added.
+        * fast/profiler/anonymous-function-calls-built-in-functions-expected.txt: Added.
+        * fast/profiler/anonymous-function-calls-built-in-functions.html: Added.
+        * fast/profiler/anonymous-function-calls-eval-expected.txt: Added.
+        * fast/profiler/anonymous-function-calls-eval.html: Added.
+        * fast/profiler/anonymous-functions-with-display-names-expected.txt: Added.
+        * fast/profiler/anonymous-functions-with-display-names.html: Added.
+        * fast/profiler/apply-expected.txt: Added.
+        * fast/profiler/apply.html: Added.
+        * fast/profiler/built-in-function-calls-anonymous-expected.txt: Added.
+        * fast/profiler/built-in-function-calls-anonymous.html: Added.
+        * fast/profiler/built-in-function-calls-user-defined-function-expected.txt: Added.
+        * fast/profiler/built-in-function-calls-user-defined-function.html: Added.
+        * fast/profiler/call-expected.txt: Added.
+        * fast/profiler/call-register-leak-expected.txt: Added.
+        * fast/profiler/call-register-leak.html: Added.
+        * fast/profiler/call.html: Added.
+        * fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt: Added.
+        * fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope.html: Added.
+        * fast/profiler/compare-multiple-profiles-expected.txt: Added.
+        * fast/profiler/compare-multiple-profiles.html: Added.
+        * fast/profiler/constructor-expected.txt: Added.
+        * fast/profiler/constructor.html: Added.
+        * fast/profiler/dead-time-expected.txt: Added.
+        * fast/profiler/dead-time.html: Added.
+        * fast/profiler/document-dot-write-expected.txt: Added.
+        * fast/profiler/document-dot-write.html: Added.
+        * fast/profiler/event-handler-expected.txt: Added.
+        * fast/profiler/event-handler.html: Added.
+        * fast/profiler/execution-context-and-eval-on-same-line-expected.txt: Added.
+        * fast/profiler/execution-context-and-eval-on-same-line.html: Added.
+        * fast/profiler/inline-event-handler-expected.txt: Added.
+        * fast/profiler/inline-event-handler.html: Added.
+        * fast/profiler/many-calls-in-the-same-scope-expected.txt: Added.
+        * fast/profiler/many-calls-in-the-same-scope.html: Added.
+        * fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt: Added.
+        * fast/profiler/multiple-and-different-scoped-anonymous-function-calls.html: Added.
+        * fast/profiler/multiple-and-different-scoped-function-calls-expected.txt: Added.
+        * fast/profiler/multiple-and-different-scoped-function-calls.html: Added.
+        * fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt: Added.
+        * fast/profiler/multiple-anonymous-functions-called-from-the-same-function.html: Added.
+        * fast/profiler/multiple-frames-expected.txt: Added.
+        * fast/profiler/multiple-frames.html: Added.
+        * fast/profiler/named-functions-with-display-names-expected.txt: Added.
+        * fast/profiler/named-functions-with-display-names.html: Added.
+        * fast/profiler/nested-anonymous-functon-expected.txt: Added.
+        * fast/profiler/nested-anonymous-functon.html: Added.
+        * fast/profiler/nested-start-and-stop-profiler-expected.txt: Added.
+        * fast/profiler/nested-start-and-stop-profiler.html: Added.
+        * fast/profiler/no-execution-context-expected.txt: Added.
+        * fast/profiler/no-execution-context.html: Added.
+        * fast/profiler/one-execution-context-expected.txt: Added.
+        * fast/profiler/one-execution-context.html: Added.
+        * fast/profiler/profile-calls-in-included-file-expected.txt: Added.
+        * fast/profiler/profile-calls-in-included-file.html: Added.
+        * fast/profiler/profile-with-no-title-expected.txt: Added.
+        * fast/profiler/profile-with-no-title.html: Added.
+        * fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt: Added.
+        * fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html: Added.
+        * fast/profiler/profiling-from-a-nested-location-expected.txt: Added.
+        * fast/profiler/profiling-from-a-nested-location.html: Added.
+        * fast/profiler/resources/other-frame.html: Added.
+        * fast/profiler/resources/other-window.html: Added.
+        * fast/profiler/resources/profiler-test-JS-resources.js: Added.
+        (endTest):
+        (insertGivenText):
+        (insertNewText):
+        (arrayOperatorFunction):
+        (anonymousFunction):
+        (anotherAnonymousFunction):
+        (intermediaryFunction):
+        (isEqualToFive):
+        (startProfile):
+        (printHeavyProfilesDataWithoutTime):
+        (printProfilesDataWithoutTime):
+        (printProfileNodeWithoutTime):
+        * fast/profiler/simple-event-call-expected.txt: Added.
+        * fast/profiler/simple-event-call.html: Added.
+        * fast/profiler/simple-no-level-change-expected.txt: Added.
+        * fast/profiler/simple-no-level-change.html: Added.
+        * fast/profiler/start-and-stop-profiler-multiple-times-expected.txt: Added.
+        * fast/profiler/start-and-stop-profiler-multiple-times.html: Added.
+        * fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt: Added.
+        * fast/profiler/start-and-stop-profiling-in-the-same-function.html: Added.
+        * fast/profiler/start-but-dont-stop-profiling-expected.txt: Added.
+        * fast/profiler/start-but-dont-stop-profiling.html: Added.
+        * fast/profiler/stop-profiling-after-setTimeout-expected.txt: Added.
+        * fast/profiler/stop-profiling-after-setTimeout.html: Added.
+        * fast/profiler/stop-then-function-call-expected.txt: Added.
+        * fast/profiler/stop-then-function-call.html: Added.
+        * fast/profiler/throw-exception-from-eval-expected.txt: Added.
+        * fast/profiler/throw-exception-from-eval.html-disabled: Added.
+        * fast/profiler/two-execution-contexts-expected.txt: Added.
+        * fast/profiler/two-execution-contexts.html: Added.
+        * fast/profiler/user-defined-function-calls-built-in-functions-expected.txt: Added.
+        * fast/profiler/user-defined-function-calls-built-in-functions.html: Added.
+        * fast/profiler/window-dot-eval-expected.txt: Added.
+        * fast/profiler/window-dot-eval.html: Added.
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/ios-simulator/TestExpectations:
+
</ins><span class="cx"> 2016-05-16  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Focus ordering should respect slot elements
</span></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymouseventhandlerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-event-handler-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-event-handler-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-event-handler-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+This page has an anonymous event handler. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. It should show the anonymous function at the same level as the onload handler. 
+
+Profile title: Anonymous event handler
+Thread_1 (no file) (line 0:0)
+   startTest anonymous-event-handler.html (line 10:19)
+      getElementById (no file) (line 0:0)
+      click (no file) (line 0:0)
+         onclick anonymous-event-handler.html (line 15:51)
+            insertNewText profiler-test-JS-resources.js (line 17:23)
+               createElement (no file) (line 0:0)
+               createTextNode (no file) (line 0:0)
+               appendChild (no file) (line 0:0)
+               getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymouseventhandlerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-event-handler.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-event-handler.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-event-handler.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Anonymous event handler&quot;);
+
+    var buttonWithAnonymousHandler = document.getElementById(&quot;buttonWithAnAnonymousEventHandler&quot;)
+    buttonWithAnonymousHandler.onclick = function () {
+        insertNewText();
+    }
+
+    buttonWithAnonymousHandler.click();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has an anonymous event handler.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  It should show the anonymous function at the same level as the onload
+handler.
+&lt;input type=&quot;button&quot; id=&quot;buttonWithAnAnonymousEventHandler&quot; value=&quot;Button with an anonymous event handler&quot;&gt;
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymousfunctioncalledfromdifferentcontextsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+This page's JavaScript calls an anonymous function from different contexts. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. Beneath onload and startTest it should show three children, an anonymous function, script context, and the endTest call.
+
+Profile title: Same anonymous function called from different contexts
+Thread_1 (no file) (line 0:0)
+   startTest anonymous-function-called-from-different-contexts.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      eval (no file) (line 0:0)
+         (program) (no file) (line 1:1)
+            anonymousFunction profiler-test-JS-resources.js (line 29:34)
+               insertNewText profiler-test-JS-resources.js (line 17:23)
+                  createElement (no file) (line 0:0)
+                  createTextNode (no file) (line 0:0)
+                  appendChild (no file) (line 0:0)
+                  getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymousfunctioncalledfromdifferentcontextshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Same anonymous function called from different contexts&quot;);
+
+    anonymousFunction();
+    eval(&quot;anonymousFunction()&quot;);
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls an anonymous function from different contexts.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  Beneath onload and startTest it should show three children, an
+anonymous function, script context, and the endTest call.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymousfunctioncallsbuiltinfunctionsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+This page has an anonymous JavaScript function that calls built-in functions. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. Beneath onload and startTest it should show three children, an anonymous function, script context, and the endTest call.
+
+Profile title: Anonymous function calls built-in functions
+Thread_1 (no file) (line 0:0)
+   startTest anonymous-function-calls-built-in-functions.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymousfunctioncallsbuiltinfunctionshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Anonymous function calls built-in functions&quot;);
+    anonymousFunction();
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has an anonymous JavaScript function that calls built-in functions.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  Beneath onload and startTest it should show three children, an
+anonymous function, script context, and the endTest call.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymousfunctioncallsevalexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+This page's JavaScript calls an anonymous function which calls eval(). 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. Beneath onload and startTest it should show an (anonymous function) which has a (program) child.
+
+Profile title: Anonymous function calles eval
+Thread_1 (no file) (line 0:0)
+   startTest anonymous-function-calls-eval.html (line 10:19)
+      variableThatPointsToAnAnonymousFunction anonymous-function-calls-eval.html (line 14:59)
+         eval (no file) (line 0:0)
+            (program) (no file) (line 1:1)
+               insertNewText profiler-test-JS-resources.js (line 17:23)
+                  createElement (no file) (line 0:0)
+                  createTextNode (no file) (line 0:0)
+                  appendChild (no file) (line 0:0)
+                  getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymousfunctioncallsevalhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Anonymous function calles eval&quot;);
+
+    var variableThatPointsToAnAnonymousFunction = function() {
+        eval(&quot;insertNewText()&quot;);
+    }
+
+    variableThatPointsToAnAnonymousFunction();
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls an anonymous function which calls eval().
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  Beneath onload and startTest it should show an (anonymous function)
+which has a (program) child.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymousfunctionswithdisplaynamesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+This page's JavaScript calls anonymous functions with display names. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. You should see functions named &quot;[x] iterations function&quot;, and no anonymous functions.
+
+Profile title: Anonymous functions with display names
+Thread_1 (no file) (line 0:0)
+   startTest anonymous-functions-with-display-names.html (line 22:19)
+      anonymousFunctionGenerator anonymous-functions-with-display-names.html (line 10:36)
+      0 iterations function anonymous-functions-with-display-names.html (line 12:59)
+      1 iterations function anonymous-functions-with-display-names.html (line 12:59)
+      2 iterations function anonymous-functions-with-display-names.html (line 12:59)
+      20 iterations function anonymous-functions-with-display-names.html (line 12:59)
+      1000 iterations function anonymous-functions-with-display-names.html (line 12:59)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileranonymousfunctionswithdisplaynameshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,45 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function anonymousFunctionGenerator(iterations)
+{
+    var variableThatPointsToAnAnonymousFunction = function()
+    {
+        for (var i = 0; i &lt; iterations; ++i) ;
+    }
+    
+    variableThatPointsToAnAnonymousFunction.displayName = iterations + &quot; iterations function&quot;;
+    
+    return variableThatPointsToAnAnonymousFunction;
+}
+
+function startTest()
+{
+    console.profile(&quot;Anonymous functions with display names&quot;);
+
+    anonymousFunctionGenerator(0)();
+    anonymousFunctionGenerator(1)();
+    anonymousFunctionGenerator(2)();
+    anonymousFunctionGenerator(20)();
+    anonymousFunctionGenerator(1000)();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls anonymous functions with display names.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  You should see functions named &quot;[x] iterations function&quot;, and no anonymous functions.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerapplyexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/apply-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/apply-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/apply-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+This page's JavaScript has a call to apply() in it. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call to fakeInteriorFunction() and a call to apply().
+
+Profile title: Using the apply() method
+Thread_1 (no file) (line 0:0)
+   startTest apply.html (line 10:19)
+      fakeObject apply.html (line 17:21)
+         fakeInteriorFunction apply.html (line 23:30)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerapplyhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/apply.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/apply.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/apply.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,40 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Using the apply() method&quot;);
+    var myObject = new fakeObject(1, 2);
+    endTest();
+}
+
+function fakeObject (x, y)
+{
+    this.x = x;
+    fakeInteriorFunction.apply(this, arguments);
+}
+
+function fakeInteriorFunction(x, y)
+{
+    this.y = y;
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript has a call to apply() in it.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to fakeInteriorFunction() and
+a call to apply().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerbuiltinfunctioncallsanonymousexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+This page uses a built-in function to call an anonymous function. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile map() should be the sibling of an (anonymous function) which has arrayOperatorFunction() as a child.
+
+Profile title: Built-in function calls an anonymous function
+Thread_1 (no file) (line 0:0)
+   startTest built-in-function-calls-anonymous.html (line 10:19)
+      Array (no file) (line 0:0)
+      map (no file) (line 0:0)
+         Object (no file) (line 0:0)
+         toLength (no file) (line 0:0)
+            toInteger (no file) (line 0:0)
+               Number (no file) (line 0:0)
+               (anonymous function) (no file) (line 0:0)
+         isArray (no file) (line 0:0)
+         (anonymous function) (no file) (line 0:0)
+         speciesGetter (no file) (line 0:0)
+         Array (no file) (line 0:0)
+         myFunction built-in-function-calls-anonymous.html (line 14:30)
+            arrayOperatorFunction profiler-test-JS-resources.js (line 25:31)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerbuiltinfunctioncallsanonymoushtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Built-in function calls an anonymous function&quot;);
+
+    var myFunction = function(arrayElement) {
+        return arrayOperatorFunction(arrayElement);
+    }
+
+    var myArray = new Array (0, 1, 2);
+    myArray.map(myFunction);
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page uses a built-in function to call an anonymous function.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile map() should be the sibling of an (anonymous function)
+which has arrayOperatorFunction() as a child.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerbuiltinfunctioncallsuserdefinedfunctionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+This page uses a built-in function to call a user defined function. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile map() should have arrayOperatorFunction() as a child.
+
+Profile title: Built-in function calls a user defined function
+Thread_1 (no file) (line 0:0)
+   startTest built-in-function-calls-user-defined-function.html (line 10:19)
+      Array (no file) (line 0:0)
+      map (no file) (line 0:0)
+         Object (no file) (line 0:0)
+         toLength (no file) (line 0:0)
+            toInteger (no file) (line 0:0)
+               Number (no file) (line 0:0)
+               (anonymous function) (no file) (line 0:0)
+         isArray (no file) (line 0:0)
+         (anonymous function) (no file) (line 0:0)
+         speciesGetter (no file) (line 0:0)
+         Array (no file) (line 0:0)
+         arrayOperatorFunction profiler-test-JS-resources.js (line 25:31)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerbuiltinfunctioncallsuserdefinedfunctionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Built-in function calls a user defined function&quot;);
+
+    var myArray = new Array (0, 1, 2);
+    myArray.map(arrayOperatorFunction);
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page uses a built-in function to call a user defined function.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile map() should have arrayOperatorFunction() as a child.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilercallexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/call-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/call-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/call-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+This page's JavaScript has a call to call() in it. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call to fakeObject() with call() as its child and a fakeInteriorFunction() as call()'s child.
+
+Profile title: Using the call() method
+Thread_1 (no file) (line 0:0)
+   startTest call.html (line 10:19)
+      fakeObject call.html (line 19:21)
+         fakeInteriorFunction call.html (line 25:30)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilercallregisterleakexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/call-register-leak-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/call-register-leak-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/call-register-leak-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+This page tests that the generation of bytecode allocates registers correctly when profiling is enabled. To run the test manually, enable profiling in the web inspector and reload this page.
+
+PASS: localCallTest(1, 2) should be 2 and is.
+
+PASS: globalCallTest(1, 2) should be 2 and is.
+
+PASS: scopedCallTest(1, 2) should be 2 and is.
+
+PASS: resolveCallTest(1, 2) should be 2 and is.
+
+PASS: bracketCallTest(1, 2) should be 2 and is.
+
+PASS: dotCallTest(1, 2) should be 2 and is.
+
+PASS: newTest(1, 2) should be 2 and is.
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilercallregisterleakhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/call-register-leak.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/call-register-leak.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/call-register-leak.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+&lt;body&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function log(s)
+{
+    if (this.document)
+        document.getElementById(&quot;console&quot;).appendChild(document.createTextNode(s + &quot;\n&quot;));
+    else
+        print(s + &quot;\n&quot;);
+}
+
+function shouldBe(a, aDescription, b)
+{
+    if (a === b)
+        log(&quot;PASS: &quot; + aDescription + &quot; should be &quot; + b + &quot; and is.\n&quot;);
+    else
+        log(&quot;FAIL: &quot; + aDescription + &quot; should be &quot; + b + &quot; but instead is &quot; + a + &quot;.\n&quot;);
+}
+
+function localCallTest(a, b)
+{
+    function localCall(o)
+    {
+        return o.toString();
+    }
+    return [localCall(a), b][1];
+}
+
+function globalCall(o)
+{
+    return o.toString();
+}
+
+function globalCallTest(a, b)
+{
+    return [globalCall(a), b][1];
+}
+
+function scopedCallTest(a, b)
+{
+    function scopedCall(o)
+    {
+        return o.toString();
+    }
+
+    function f()
+    {
+        return [scopedCall(a), b][1];
+    }
+
+    return f();
+}
+
+function resolveCallTest(a, b)
+{
+    o = { resolvedCall: function(o) { return o.toString(); }};
+    with (o) {
+        return [resolvedCall(o), b][1];
+    }
+}
+
+function bracketCallTest(a, b)
+{
+    return [a[&quot;toString&quot;](), b][1];
+}
+
+function dotCallTest(a, b)
+{
+    return [a.toString(), b][1];
+}
+
+function testConstructor(o)
+{
+    return o.toString();
+}
+
+function newTest(a, b)
+{
+    return [new testConstructor(a), b][1];
+}
+
+function startTest()
+{
+    shouldBe(localCallTest(1, 2), &quot;localCallTest(1, 2)&quot;, 2);
+    shouldBe(globalCallTest(1, 2), &quot;globalCallTest(1, 2)&quot;, 2);
+    shouldBe(scopedCallTest(1, 2), &quot;scopedCallTest(1, 2)&quot;, 2);
+    shouldBe(resolveCallTest(1, 2), &quot;resolveCallTest(1, 2)&quot;, 2);
+    shouldBe(bracketCallTest(1, 2), &quot;bracketCallTest(1, 2)&quot;, 2);
+    shouldBe(dotCallTest(1, 2), &quot;dotCallTest(1, 2)&quot;, 2);
+    shouldBe(newTest(1, 2), &quot;newTest(1, 2)&quot;, 2);
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;startTest()&quot;&gt;
+&lt;p&gt;
+This page tests that the generation of bytecode allocates registers correctly when profiling is enabled. To run the test manually, enable profiling in the web inspector and reload this page.
+&lt;/p&gt;
+&lt;pre id=&quot;console&quot;&gt;&lt;/pre&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilercallhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/call.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/call.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/call.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Using the call() method&quot;);
+
+    var myObject = new fakeObject(1, 2);
+
+    endTest();
+}
+
+function fakeObject (x, y)
+{
+    this.x = x;
+    fakeInteriorFunction.call(this, y);
+}
+
+function fakeInteriorFunction(y)
+{
+    this.y = y;
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript has a call to call() in it.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to fakeObject() with call() as
+its child and a fakeInteriorFunction() as call()'s child.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilercallingthefunctionthatstartedtheprofilerfromanotherscopeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+This page's JavaScript starts profiling from within a function which is then called later from another context. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profiler you should see a call to indirection() and functionWichStartsAndStopsTheProfiler()
+
+Profile title: Calling the same function where the profile started from another function
+Thread_1 (no file) (line 0:0)
+   indirection calling-the-function-that-started-the-profiler-from-another-scope.html (line 17:21)
+      functionWichStartsAndStopsTheProfiler calling-the-function-that-started-the-profiler-from-another-scope.html (line 23:47)
+   functionWichStartsAndStopsTheProfiler calling-the-function-that-started-the-profiler-from-another-scope.html (line 23:47)
+   endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilercallingthefunctionthatstartedtheprofilerfromanotherscopehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    indirection();
+    functionWichStartsAndStopsTheProfiler();
+    endTest();
+}
+
+function indirection()
+{
+    functionWichStartsAndStopsTheProfiler();
+}
+
+var firstTime = true;
+function functionWichStartsAndStopsTheProfiler()
+{
+    if (firstTime) {
+        console.profile(&quot;Calling the same function where the profile started from another function&quot;);
+        firstTime = false;
+    }
+
+    for (var i = 0; i &lt; 10000000; i++)
+        var b = i + 2;
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript starts profiling from within a function which is then called
+later from another context.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profiler you should see a call to indirection() and
+functionWichStartsAndStopsTheProfiler()
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilercomparemultipleprofilesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/compare-multiple-profiles-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/compare-multiple-profiles-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/compare-multiple-profiles-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+This page has multiple profiles with the same name. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. It should not crash or hang and there should be multiple runs of the same named profile.
+
+Profile title: Test
+Thread_1 (no file) (line 0:0)
+   startTest compare-multiple-profiles.html (line 22:19)
+      test compare-multiple-profiles.html (line 11:14)
+         test2 compare-multiple-profiles.html (line 17:15)
+
+Profile title: Test
+Thread_1 (no file) (line 0:0)
+   startTest compare-multiple-profiles.html (line 22:19)
+      test compare-multiple-profiles.html (line 11:14)
+         test2 compare-multiple-profiles.html (line 17:15)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilercomparemultipleprofileshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/compare-multiple-profiles.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/compare-multiple-profiles.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/compare-multiple-profiles.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,46 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+var j = 0;
+function test(len) {
+    for (var i = 0; i &lt; len; ++i)
+        ++j;
+    test2(2000 - len);
+}
+
+function test2(len) {
+    for (var i = 0; i &lt; len; ++i)
+        --j;
+}
+
+function startTest()
+{
+    console.profile(&quot;Test&quot;);
+    test(100);
+    console.profileEnd(&quot;Test&quot;);
+
+    console.profile(&quot;Test&quot;);
+    test(1000);
+    console.profileEnd(&quot;Test&quot;);
+
+    printProfilesDataWithoutTime();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has multiple profiles with the same name.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  It should not crash or hang and there should be multiple runs of the
+same named profile.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerconstructorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/constructor-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/constructor-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/constructor-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+This page's JavaScript has a call to new() in it. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call to fakeObject() and Array() in it.
+
+Profile title: Using a constructor.
+Thread_1 (no file) (line 0:0)
+   startTest constructor.html (line 10:19)
+      fakeObject constructor.html (line 19:21)
+         Array (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerconstructorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/constructor.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/constructor.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/constructor.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Using a constructor.&quot;);
+
+    var myObject = new fakeObject(1, 2);
+
+    endTest();
+}
+
+function fakeObject (x, y)
+{
+    var myArray = new Array()
+    myArray[0] = 5;
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript has a call to new() in it.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to fakeObject() and Array()
+in it.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerdeadtimeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/dead-time-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/dead-time-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/dead-time-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+This page's JavaScript Has some dead time in the profile. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a large amount of the % spent in (non-JavaScript).
+
+Profile title: Dead time in profile.
+Thread_1 (no file) (line 0:0)
+   onload dead-time.html (line 21:44)
+      startTest dead-time.html (line 12:19)
+         setTimeout (no file) (line 0:0)
+   (program) dead-time.html (line 1:1)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerdeadtimehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/dead-time.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/dead-time.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/dead-time.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Dead time in profile.&quot;);
+    setTimeout(&quot;endTest()&quot;, 1234);
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript Has some dead time in the profile.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a large amount of the % spent in 
+(non-JavaScript).
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerdocumentdotwriteexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/document-dot-write-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/document-dot-write-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/document-dot-write-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+
+Profile title: Call Document.write()
+Thread_1 (no file) (line 0:0)
+   startTest document-dot-write.html (line 10:19)
+      write (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerdocumentdotwritehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/document-dot-write.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/document-dot-write.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/document-dot-write.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Call Document.write()&quot;);
+
+    document.write(&quot;&lt;div id=\&quot;output\&quot;&gt;&lt;/div&gt;&quot;);
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page calls document.write().
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  If there is a profile it should show write().
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilereventhandlerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/event-handler-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/event-handler-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/event-handler-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+This page has an event handler. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile insertnewText() should be a sibling to onload(). 
+
+Profile title: Event handler
+Thread_1 (no file) (line 0:0)
+   startTest event-handler.html (line 10:19)
+      getElementById (no file) (line 0:0)
+      addEventListener (no file) (line 0:0)
+      click (no file) (line 0:0)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilereventhandlerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/event-handler.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/event-handler.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/event-handler.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{    
+    console.profile(&quot;Event handler&quot;);
+
+    var myButton = document.getElementById(&quot;buttonWithAnEventListener&quot;);
+    myButton.addEventListener(&quot;click&quot;, insertNewText, false);
+    myButton.click();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has an event handler.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile insertnewText() should be a sibling to onload().
+&lt;input type=&quot;button&quot; id=&quot;buttonWithAnEventListener&quot; value=&quot;Button with an event listener&quot;&gt;
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerexecutioncontextandevalonsamelineexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+This page has a call to eval and a script tag on the same line. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be multiple (program) elements and one that represents the eval().
+
+Profile title: Two Execution Contexts on the same line
+Thread_1 (no file) (line 0:0)
+   startTest execution-context-and-eval-on-same-line.html (line 10:19)
+      evalFunction (no file) (line 1:22)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerexecutioncontextandevalonsamelinehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Two Execution Contexts on the same line&quot;);
+
+    evalFunction();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;script&gt;
+eval(&quot;function evalFunction() { insertNewText(); }&quot;);
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has a call to eval and a script tag on the same line.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be multiple (program) elements and
+one that represents the eval().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerinlineeventhandlerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/inline-event-handler-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/inline-event-handler-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/inline-event-handler-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+This page has an inline event handler. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile onclick() should be a sibling to onload() and onclick() should have eventListener() as a child. 
+
+Profile title: Inline event handler
+Thread_1 (no file) (line 0:0)
+   startTest inline-event-handler.html (line 10:19)
+      getElementById (no file) (line 0:0)
+      click (no file) (line 0:0)
+         onclick inline-event-handler.html (line 31:127)
+            eventListener inline-event-handler.html (line 17:23)
+               anonymousFunction profiler-test-JS-resources.js (line 29:34)
+                  insertNewText profiler-test-JS-resources.js (line 17:23)
+                     createElement (no file) (line 0:0)
+                     createTextNode (no file) (line 0:0)
+                     appendChild (no file) (line 0:0)
+                     getElementById (no file) (line 0:0)
+               endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerinlineeventhandlerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/inline-event-handler.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/inline-event-handler.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/inline-event-handler.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{    
+    console.profile(&quot;Inline event handler&quot;);
+
+    document.getElementById(&quot;eventListenerSetInline&quot;).click();
+}
+
+function eventListener() {    
+    anonymousFunction();
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has an inline event handler.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile onclick() should be a sibling to onload() and onclick()
+should have eventListener() as a child.
+&lt;input type=&quot;button&quot; onclick=&quot;eventListener()&quot; id=&quot;eventListenerSetInline&quot; value=&quot;Event Listener Set Inline&quot;&gt;
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermanycallsinthesamescopeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+This page's JavaScript has many function calls in the same scope. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile many functions should be the children of startTest. Use the sorting capabilites to make sure the similarly named functions are sorted correctly.
+
+Profile title: Many Calls In The Same Scope
+Thread_1 (no file) (line 0:0)
+   startTest many-calls-in-the-same-scope.html (line 10:19)
+      insertNewText profiler-test-JS-resources.js (line 17:23)
+         createElement (no file) (line 0:0)
+         createTextNode (no file) (line 0:0)
+         appendChild (no file) (line 0:0)
+         getElementById (no file) (line 0:0)
+      insertGivenText profiler-test-JS-resources.js (line 9:25)
+         createElement (no file) (line 0:0)
+         createTextNode (no file) (line 0:0)
+         appendChild (no file) (line 0:0)
+         getElementById (no file) (line 0:0)
+      arrayOperatorFunction profiler-test-JS-resources.js (line 25:31)
+      intermediaryFunction profiler-test-JS-resources.js (line 32:30)
+         anonymousFunction profiler-test-JS-resources.js (line 29:34)
+            insertNewText profiler-test-JS-resources.js (line 17:23)
+               createElement (no file) (line 0:0)
+               createTextNode (no file) (line 0:0)
+               appendChild (no file) (line 0:0)
+               getElementById (no file) (line 0:0)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      end many-calls-in-the-same-scope.html (line 26:13)
+      endT many-calls-in-the-same-scope.html (line 31:14)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermanycallsinthesamescopehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,49 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Many Calls In The Same Scope&quot;);
+
+    insertNewText();
+    insertGivenText(&quot;This was a triumph.&quot;);
+    arrayOperatorFunction(7);
+    intermediaryFunction();
+    anonymousFunction();
+    end()
+    endT();
+    endT();
+
+    endTest();
+}
+
+function end()
+{
+    var x = 0;
+}
+
+function endT()
+{
+    var y = 1;
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript has many function calls in the same scope.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile many functions should be the children of startTest.
+Use the sorting capabilites to make sure the similarly named functions are sorted
+correctly.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermultipleanddifferentscopedanonymousfunctioncallsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+This page's JavaScript calls the same anonymous function from multiple and differently scoped locations. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call to fakeObject with fakeInteriorFunction as its child, but call() should not be shown.
+
+Profile title: Multiple and different scoped calls to the same anonymous function
+Thread_1 (no file) (line 0:0)
+   startTest multiple-and-different-scoped-anonymous-function-calls.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      intermediaryFunction profiler-test-JS-resources.js (line 32:30)
+         anonymousFunction profiler-test-JS-resources.js (line 29:34)
+            insertNewText profiler-test-JS-resources.js (line 17:23)
+               createElement (no file) (line 0:0)
+               createTextNode (no file) (line 0:0)
+               appendChild (no file) (line 0:0)
+               getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermultipleanddifferentscopedanonymousfunctioncallshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Multiple and different scoped calls to the same anonymous function&quot;);
+
+    anonymousFunction();
+    anonymousFunction();
+
+    intermediaryFunction();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls the same anonymous function from multiple and differently scoped locations.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to fakeObject with
+fakeInteriorFunction as its child, but call() should not be shown.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermultipleanddifferentscopedfunctioncallsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+This page's JavaScript calls the same function from multiple and differently scoped locations. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be two calls to insertNewText under startTest() and one under an (anonymous function) under intermediaryFunction().
+
+Profile title: Multiple and different scoped calls to the same function
+Thread_1 (no file) (line 0:0)
+   startTest multiple-and-different-scoped-function-calls.html (line 10:19)
+      insertNewText profiler-test-JS-resources.js (line 17:23)
+         createElement (no file) (line 0:0)
+         createTextNode (no file) (line 0:0)
+         appendChild (no file) (line 0:0)
+         getElementById (no file) (line 0:0)
+      intermediaryFunction profiler-test-JS-resources.js (line 32:30)
+         anonymousFunction profiler-test-JS-resources.js (line 29:34)
+            insertNewText profiler-test-JS-resources.js (line 17:23)
+               createElement (no file) (line 0:0)
+               createTextNode (no file) (line 0:0)
+               appendChild (no file) (line 0:0)
+               getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermultipleanddifferentscopedfunctioncallshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Multiple and different scoped calls to the same function&quot;);
+
+    insertNewText();
+    insertNewText();
+
+    intermediaryFunction();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls the same function from multiple and differently scoped locations.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be two calls to insertNewText under
+startTest() and one under an (anonymous function) under intermediaryFunction().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermultipleanonymousfunctionscalledfromthesamefunctionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+This page's JavaScript calls the different anonymous functions the same scope. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call two entries named to (anonymous function), as opposed to one entry called twice.
+
+Profile title: Multiple calls to different anonymous functions
+Thread_1 (no file) (line 0:0)
+   startTest multiple-anonymous-functions-called-from-the-same-function.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      anotherAnonymousFunction profiler-test-JS-resources.js (line 30:41)
+         insertGivenText profiler-test-JS-resources.js (line 9:25)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermultipleanonymousfunctionscalledfromthesamefunctionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Multiple calls to different anonymous functions&quot;);
+
+    anonymousFunction();
+    anotherAnonymousFunction();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls the different anonymous functions the same scope.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call two entries named to (anonymous function),
+as opposed to one entry called twice.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermultipleframesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/multiple-frames-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/multiple-frames-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/multiple-frames-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+This test has JS executing in another window. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call to functionInOtherFrame().
+
+Profile title: Other window executing JavaScript
+Thread_1 (no file) (line 0:0)
+   startTest multiple-frames.html (line 10:19)
+      getElementById (no file) (line 0:0)
+      functionInOtherFrame other-frame.html (line 4:30)
+         functionInParentFrame multiple-frames.html (line 21:31)
+      insertGivenText profiler-test-JS-resources.js (line 9:25)
+         createElement (no file) (line 0:0)
+         createTextNode (no file) (line 0:0)
+         appendChild (no file) (line 0:0)
+         getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilermultipleframeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/multiple-frames.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/multiple-frames.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/multiple-frames.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Other window executing JavaScript&quot;);
+
+    var myFrame = document.getElementById(&quot;mySubFrame&quot;);
+    var secret = myFrame.contentWindow.functionInOtherFrame();
+    insertGivenText(secret);
+
+    endTest();
+}
+
+function functionInParentFrame() {
+    return &quot;Pi&quot;;
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This test has JS executing in another window.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to functionInOtherFrame().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;iframe src=&quot;resources/other-frame.html&quot; id=&quot;mySubFrame&quot;&gt;&lt;/iframe&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilernamedfunctionswithdisplaynamesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/named-functions-with-display-names-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/named-functions-with-display-names-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/named-functions-with-display-names-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+This page's JavaScript calls named functions and changes their display names. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. You should see functions named &quot;[x] iteration[s] function&quot;, and not &quot;function[x]&quot;
+
+Profile title: Named functions with display names
+Thread_1 (no file) (line 0:0)
+   startTest named-functions-with-display-names.html (line 53:19)
+      0 iterations function named-functions-with-display-names.html (line 10:19)
+      1 iteration function named-functions-with-display-names.html (line 17:19)
+      2 iterations function named-functions-with-display-names.html (line 24:19)
+      20 iterations function named-functions-with-display-names.html (line 31:20)
+      1000 iterations function named-functions-with-display-names.html (line 38:22)
+      bogusDisplayNameFunction named-functions-with-display-names.html (line 46:34)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilernamedfunctionswithdisplaynameshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/named-functions-with-display-names.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/named-functions-with-display-names.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/named-functions-with-display-names.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function function0()
+{
+    for (var i = 0; i &lt; 0; ++i) ;
+}
+
+function0.displayName = &quot;0 iterations function&quot;;
+
+function function1()
+{
+    for (var i = 0; i &lt; 1; ++i) ;
+}
+
+function1.displayName = &quot;1 iteration function&quot;;
+
+function function2()
+{
+    for (var i = 0; i &lt; 2; ++i) ;
+}
+
+function2.displayName = &quot;2 iterations function&quot;;
+
+function function20()
+{
+    for (var i = 0; i &lt; 20; ++i) ;
+}
+
+function20.displayName = &quot;20 iterations function&quot;;
+
+function function1000()
+{
+    for (var i = 0; i &lt; 1000; ++i) ;
+}
+
+function1000.displayName = &quot;1000 iterations function&quot;;
+
+
+function bogusDisplayNameFunction()
+{
+    for (var i = 0; i &lt; 0; ++i) ;
+}
+
+bogusDisplayNameFunction.displayName = bogusDisplayNameFunction;
+
+function startTest()
+{
+    console.profile(&quot;Named functions with display names&quot;);
+
+    function0();
+    function1();
+    function2();
+    function20();
+    function1000();
+    bogusDisplayNameFunction();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls named functions and changes their display names.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  You should see functions named &quot;[x] iteration[s] function&quot;, and not &quot;function[x]&quot;
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilernestedanonymousfunctonexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/nested-anonymous-functon-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/nested-anonymous-functon-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/nested-anonymous-functon-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,17 @@
</span><ins>+This page's JavaScript calls an anonymous which calls a nested anonymous function. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be an (anonymous function) with a child (anonymous function).
+
+Profile title: Nested anonymous functions called
+Thread_1 (no file) (line 0:0)
+   startTest nested-anonymous-functon.html (line 10:19)
+      AnonymousFunctionWichCallsAnAnonymousFunction nested-anonymous-functon.html (line 14:65)
+         anonymousFunction profiler-test-JS-resources.js (line 29:34)
+            insertNewText profiler-test-JS-resources.js (line 17:23)
+               createElement (no file) (line 0:0)
+               createTextNode (no file) (line 0:0)
+               appendChild (no file) (line 0:0)
+               getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilernestedanonymousfunctonhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/nested-anonymous-functon.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/nested-anonymous-functon.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/nested-anonymous-functon.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Nested anonymous functions called&quot;);
+
+    var AnonymousFunctionWichCallsAnAnonymousFunction = function() {
+        anonymousFunction();
+    }
+
+    AnonymousFunctionWichCallsAnAnonymousFunction();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls an anonymous which calls a nested anonymous function.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be an (anonymous function) with a child
+(anonymous function).
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilernestedstartandstopprofilerexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,186 @@
</span><ins>+This page's JavaScript calls console.profile() three times then console.profileEnd() three times. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profiler there should be three profiles.
+
+Profile title: Start the profiler the third time.
+Thread_1 (no file) (line 0:0)
+   startTest nested-start-and-stop-profiler.html (line 10:19)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
+Profile title: Start the profiler the third time.
+Thread_1 (no file) (line 0:0)
+   startTest nested-start-and-stop-profiler.html (line 10:19)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+Profile title: Start the profiler the second time.
+Thread_1 (no file) (line 0:0)
+   startTest nested-start-and-stop-profiler.html (line 10:19)
+      endTest profiler-test-JS-resources.js (line 1:17)
+         profileEnd (no file) (line 0:0)
+         printProfilesDataWithoutTime profiler-test-JS-resources.js (line 62:38)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+               replace (no file) (line 0:0)
+                  hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                     (anonymous function) (no file) (line 0:0)
+                  anonymous (no file) (line 0:0)
+               createTextNode (no file) (line 0:0)
+               appendChild (no file) (line 0:0)
+               children (no file) (line 0:0)
+               printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                  replace (no file) (line 0:0)
+                     hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                        (anonymous function) (no file) (line 0:0)
+                     anonymous (no file) (line 0:0)
+                  createTextNode (no file) (line 0:0)
+                  appendChild (no file) (line 0:0)
+                  children (no file) (line 0:0)
+                  printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                     replace (no file) (line 0:0)
+                        hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                           (anonymous function) (no file) (line 0:0)
+                        anonymous (no file) (line 0:0)
+                     createTextNode (no file) (line 0:0)
+                     appendChild (no file) (line 0:0)
+                     children (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+         notifyDone (no file) (line 0:0)
+
+
+Profile title: Start the profiler the third time.
+Thread_1 (no file) (line 0:0)
+   startTest nested-start-and-stop-profiler.html (line 10:19)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+Profile title: Start the profiler the second time.
+Thread_1 (no file) (line 0:0)
+   startTest nested-start-and-stop-profiler.html (line 10:19)
+      endTest profiler-test-JS-resources.js (line 1:17)
+         profileEnd (no file) (line 0:0)
+         printProfilesDataWithoutTime profiler-test-JS-resources.js (line 62:38)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+               replace (no file) (line 0:0)
+                  hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                     (anonymous function) (no file) (line 0:0)
+                  anonymous (no file) (line 0:0)
+               createTextNode (no file) (line 0:0)
+               appendChild (no file) (line 0:0)
+               children (no file) (line 0:0)
+               printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                  replace (no file) (line 0:0)
+                     hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                        (anonymous function) (no file) (line 0:0)
+                     anonymous (no file) (line 0:0)
+                  createTextNode (no file) (line 0:0)
+                  appendChild (no file) (line 0:0)
+                  children (no file) (line 0:0)
+                  printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                     replace (no file) (line 0:0)
+                        hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                           (anonymous function) (no file) (line 0:0)
+                        anonymous (no file) (line 0:0)
+                     createTextNode (no file) (line 0:0)
+                     appendChild (no file) (line 0:0)
+                     children (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+         notifyDone (no file) (line 0:0)
+
+Profile title: Start the profiler the first time.
+Thread_1 (no file) (line 0:0)
+   startTest nested-start-and-stop-profiler.html (line 10:19)
+      endTest profiler-test-JS-resources.js (line 1:17)
+         profileEnd (no file) (line 0:0)
+         printProfilesDataWithoutTime profiler-test-JS-resources.js (line 62:38)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+               replace (no file) (line 0:0)
+                  hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                     (anonymous function) (no file) (line 0:0)
+                  anonymous (no file) (line 0:0)
+               createTextNode (no file) (line 0:0)
+               appendChild (no file) (line 0:0)
+               children (no file) (line 0:0)
+               printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                  replace (no file) (line 0:0)
+                     hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                        (anonymous function) (no file) (line 0:0)
+                     anonymous (no file) (line 0:0)
+                  createTextNode (no file) (line 0:0)
+                  appendChild (no file) (line 0:0)
+                  children (no file) (line 0:0)
+                  printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                     replace (no file) (line 0:0)
+                        hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                           (anonymous function) (no file) (line 0:0)
+                        anonymous (no file) (line 0:0)
+                     createTextNode (no file) (line 0:0)
+                     appendChild (no file) (line 0:0)
+                     children (no file) (line 0:0)
+                     printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                        replace (no file) (line 0:0)
+                           hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                              (anonymous function) (no file) (line 0:0)
+                           anonymous (no file) (line 0:0)
+                        createTextNode (no file) (line 0:0)
+                        appendChild (no file) (line 0:0)
+                        children (no file) (line 0:0)
+                        printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                           replace (no file) (line 0:0)
+                              hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                                 (anonymous function) (no file) (line 0:0)
+                              anonymous (no file) (line 0:0)
+                           createTextNode (no file) (line 0:0)
+                           appendChild (no file) (line 0:0)
+                           children (no file) (line 0:0)
+                           printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                              replace (no file) (line 0:0)
+                                 hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                                    (anonymous function) (no file) (line 0:0)
+                                 anonymous (no file) (line 0:0)
+                              createTextNode (no file) (line 0:0)
+                              appendChild (no file) (line 0:0)
+                              children (no file) (line 0:0)
+                              printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                                 replace (no file) (line 0:0)
+                                    hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                                       (anonymous function) (no file) (line 0:0)
+                                    anonymous (no file) (line 0:0)
+                                 createTextNode (no file) (line 0:0)
+                                 appendChild (no file) (line 0:0)
+                                 children (no file) (line 0:0)
+                                 printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                                    replace (no file) (line 0:0)
+                                       hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                                          (anonymous function) (no file) (line 0:0)
+                                       anonymous (no file) (line 0:0)
+                                    createTextNode (no file) (line 0:0)
+                                    appendChild (no file) (line 0:0)
+                                    children (no file) (line 0:0)
+                                    printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                                       replace (no file) (line 0:0)
+                                          hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                                             (anonymous function) (no file) (line 0:0)
+                                          anonymous (no file) (line 0:0)
+                                       createTextNode (no file) (line 0:0)
+                                       appendChild (no file) (line 0:0)
+                                       children (no file) (line 0:0)
+                                       printProfileNodeWithoutTime profiler-test-JS-resources.js (line 77:37)
+                                          replace (no file) (line 0:0)
+                                             hasObservableSideEffectsForStringReplace (no file) (line 0:0)
+                                                (anonymous function) (no file) (line 0:0)
+                                             anonymous (no file) (line 0:0)
+                                          createTextNode (no file) (line 0:0)
+                                          appendChild (no file) (line 0:0)
+                                          children (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+         notifyDone (no file) (line 0:0)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilernestedstartandstopprofilerhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Start the profiler the first time.&quot;);
+    console.profile(&quot;Start the profiler the second time.&quot;);
+    console.profile(&quot;Start the profiler the third time.&quot;);
+    endTest();
+    endTest();
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls console.profile() three times then console.profileEnd()
+three times.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profiler there should be three profiles.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilernoexecutioncontextexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/no-execution-context-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/no-execution-context-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/no-execution-context-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+This page has a no profiling information. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. You should not see any profile date in the WebInspector.
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilernoexecutioncontexthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/no-execution-context.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/no-execution-context.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/no-execution-context.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;printProfilesDataWithoutTime()&quot;&gt;
+This page has a no profiling information.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  You should not see any profile date in the WebInspector.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileroneexecutioncontextexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/one-execution-context-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/one-execution-context-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/one-execution-context-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This page has a single script tag with some simple JavaScript. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile.
+
+Profile title: One Execution Context
+Thread_1 (no file) (line 0:0)
+   startTest one-execution-context.html (line 10:19)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileroneexecutioncontexthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/one-execution-context.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/one-execution-context.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/one-execution-context.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;One Execution Context&quot;);
+    endTest();
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has a single script tag with some simple JavaScript.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerprofilecallsinincludedfileexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/profile-calls-in-included-file-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/profile-calls-in-included-file-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/profile-calls-in-included-file-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This page calls the profiler from the included file. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. If there is a profile that is sufficient for this test.
+
+Profile title: Profile call in included file
+Thread_1 (no file) (line 0:0)
+   startProfile profiler-test-JS-resources.js (line 42:22)
+   endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerprofilecallsinincludedfilehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/profile-calls-in-included-file.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/profile-calls-in-included-file.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/profile-calls-in-included-file.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    startProfile(&quot;Profile call in included file&quot;);
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page calls the profiler from the included file.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  If there is a profile that is sufficient for this test.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerprofilewithnotitleexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/profile-with-no-title-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/profile-with-no-title-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/profile-with-no-title-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This page creates a profile without a title. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. If there is a profile that is sufficient for this test.
+
+Profile title: 
+Thread_1 (no file) (line 0:0)
+   startTest profile-with-no-title.html (line 10:19)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerprofilewithnotitlehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/profile-with-no-title.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/profile-with-no-title.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/profile-with-no-title.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile();
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page creates a profile without a title.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  If there is a profile that is sufficient for this test.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerprofilingfromanestedlocationbutstopprofilingoutsidethenestingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This page's JavaScript starts profiling from within a nested location but stops the profiler from a different level of nesting. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call to functionWichStartsAndStopsTheProfiler().
+
+Profile title: Profiling From A Nested Location But Stop Profiling Outside The Nesting
+Thread_1 (no file) (line 0:0)
+   functionWichStartsTheProfiler profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html (line 16:39)
+   endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerprofilingfromanestedlocationbutstopprofilingoutsidethenestinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    functionWichStartsTheProfiler();
+    endTest();
+}
+
+function functionWichStartsTheProfiler()
+{
+    console.profile(&quot;Profiling From A Nested Location But Stop Profiling Outside The Nesting&quot;);
+
+    for (var i = 0; i &lt; 10000000; i++)
+        var b = i + 2;
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript starts profiling from within a nested location but stops the profiler
+from a different level of nesting.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to functionWichStartsAndStopsTheProfiler().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerprofilingfromanestedlocationexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This page's JavaScript starts profiling from within a nested location. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call to functionWichStartsAndStopsTheProfiler().
+
+Profile title: Profiling From A Nested Location
+Thread_1 (no file) (line 0:0)
+   functionWichStartsAndStopsTheProfiler profiling-from-a-nested-location.html (line 15:47)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerprofilingfromanestedlocationhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    functionWichStartsAndStopsTheProfiler();
+}
+
+function functionWichStartsAndStopsTheProfiler()
+{
+    console.profile(&quot;Profiling From A Nested Location&quot;);
+
+    for (var i = 0; i &lt; 10000000; i++)
+        var b = i + 2;
+
+    endTest();
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript starts profiling from within a nested location.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to functionWichStartsAndStopsTheProfiler().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerresourcesotherframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/resources/other-frame.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/resources/other-frame.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/resources/other-frame.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+function functionInOtherFrame() {
+        return parent.functionInParentFrame();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body&gt;
+This file contains some JavaScript.
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfastprofilerresourcesotherwindowhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/resources/other-window.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/resources/other-window.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/resources/other-window.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+var interestingKnowledge;
+function otherTestStart()
+{
+    interestingKnowledge = isEqualToFive(3);
+    opener.windowFinishedLoading();
+}
+
+function functionInOtherWindow() {
+        return interestingKnowledge;
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;otherTestStart()&quot;&gt;
+This file executes some JavaScript.
+&lt;/body&gt;
+&lt;/html&gt;
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerresourcesprofilertestJSresourcesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/resources/profiler-test-JS-resources.js (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/resources/profiler-test-JS-resources.js                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/resources/profiler-test-JS-resources.js        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+function endTest() {
+    console.profileEnd();
+    printProfilesDataWithoutTime();
+
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+
+function insertGivenText(text) {
+    var paragraph = document.createElement(&quot;p&quot;);
+    paragraph.appendChild(document.createTextNode(text));
+    paragraph.style.display = &quot;none&quot;; // Hidden since this isn't important in the test results.
+
+    document.getElementById(&quot;output&quot;).appendChild(paragraph);
+}
+
+function insertNewText() {
+    var paragraph = document.createElement(&quot;p&quot;);
+    paragraph.appendChild(document.createTextNode(&quot;This is inserted Text&quot;));
+    paragraph.style.display = &quot;none&quot;; // Hidden since this isn't important in the test results.
+
+    document.getElementById(&quot;output&quot;).appendChild(paragraph);
+}
+
+function arrayOperatorFunction(arrayElement) {
+    return arrayElement + 5;
+}
+
+var anonymousFunction = function () { insertNewText(); };
+var anotherAnonymousFunction = function () { insertGivenText(&quot;Another anonymous function was called.&quot;) };
+
+function intermediaryFunction()
+{
+    anonymousFunction();
+}
+
+function isEqualToFive(input)
+{
+    return input === 5;
+}
+
+function startProfile(title)
+{
+    console.profile(title);
+}
+
+function printHeavyProfilesDataWithoutTime()
+{
+    var preElement = document.createElement(&quot;pre&quot;);
+    preElement.appendChild(document.createTextNode(&quot;\n&quot;));
+
+    var profiles = internals.consoleProfiles;
+    for (var i = 0; i &lt; profiles.length; ++i) {
+        preElement.appendChild(document.createTextNode(&quot;Profile title: &quot; + profiles[i].title + &quot;\n&quot;));
+        printProfileNodeWithoutTime(preElement, profiles[i].heavyProfile.rootNode, 0);
+        preElement.appendChild(document.createTextNode(&quot;\n&quot;));
+    }
+
+    document.getElementById(&quot;output&quot;).appendChild(preElement);
+}
+
+function printProfilesDataWithoutTime()
+{
+    var preElement = document.createElement(&quot;pre&quot;);
+    preElement.appendChild(document.createTextNode(&quot;\n&quot;));
+
+    var profiles = internals.consoleProfiles;
+    for (var i = 0; i &lt; profiles.length; ++i) {
+        preElement.appendChild(document.createTextNode(&quot;Profile title: &quot; + profiles[i].title + &quot;\n&quot;));
+        printProfileNodeWithoutTime(preElement, profiles[i].rootNode, 0);
+        preElement.appendChild(document.createTextNode(&quot;\n&quot;));
+    }
+
+    document.getElementById(&quot;output&quot;).appendChild(preElement);
+}
+
+function printProfileNodeWithoutTime(preElement, node, indentLevel)
+{
+    var space = &quot;&quot;;
+    for (var i = 0; i &lt; indentLevel; ++i)
+        space += &quot;   &quot;
+
+    ++indentLevel;
+
+    var strippedURL = node.url.replace(/.*\//, &quot;&quot;);
+    if (!strippedURL)
+        strippedURL = &quot;(no file)&quot;;
+
+    var line = space + node.functionName + &quot; &quot; + strippedURL + &quot; (line &quot; + node.lineNumber + &quot;:&quot; + node.columnNumber + &quot;)\n&quot;;
+    preElement.appendChild(document.createTextNode(line));
+
+    var children = node.children();
+    for (var i = 0; i &lt; children.length; ++i)
+        printProfileNodeWithoutTime(preElement, children[i], indentLevel);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilersimpleeventcallexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/simple-event-call-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/simple-event-call-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/simple-event-call-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This page's JavaScript has an onload event. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. There should be only one onload node.
+
+Profile title: A simple profile test where an event happens.
+Thread_1 (no file) (line 0:0)
+   startTest simple-event-call.html (line 10:19)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilersimpleeventcallhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/simple-event-call.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/simple-event-call.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/simple-event-call.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,27 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;A simple profile test where an event happens.&quot;);
+    // FIXME: this is not testing what it says it is.
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript has an onload event.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  There should be only one onload node.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilersimplenolevelchangeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/simple-no-level-change-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/simple-no-level-change-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/simple-no-level-change-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This page's JavaScript starts and stops profiling from the same scope. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. There should be no function calls between console.profile() and console.profileEnd().
+
+Profile title: A simple profile test where no scope chagnes
+Thread_1 (no file) (line 0:0)
+   functionWichStartsAndStopsTheProfiler simple-no-level-change.html (line 15:47)
+      getElementById (no file) (line 0:0)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilersimplenolevelchangehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/simple-no-level-change.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/simple-no-level-change.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/simple-no-level-change.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,39 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    functionWichStartsAndStopsTheProfiler();
+}
+
+function functionWichStartsAndStopsTheProfiler()
+{
+    console.profile(&quot;A simple profile test where no scope chagnes&quot;);
+
+    for (var i = 0; i &lt; 10000000; i++)
+        var b = i + 2;
+
+    document.getElementById(&quot;output&quot;);
+
+    console.profileEnd();
+    printProfilesDataWithoutTime();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript starts and stops profiling from the same scope.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  There should be no function calls between console.profile() and
+console.profileEnd().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstartandstopprofilermultipletimesexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+This page's JavaScript calls console.profile() and console.profileEnd() three times. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profiler there should be three profiles.
+
+Profile title: Start the profiler the first time.
+Thread_1 (no file) (line 0:0)
+   startTest start-and-stop-profiler-multiple-times.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
+Profile title: Start the profiler the first time.
+Thread_1 (no file) (line 0:0)
+   startTest start-and-stop-profiler-multiple-times.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+Profile title: Start the profiler the second time.
+Thread_1 (no file) (line 0:0)
+   startTest start-and-stop-profiler-multiple-times.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
+Profile title: Start the profiler the first time.
+Thread_1 (no file) (line 0:0)
+   startTest start-and-stop-profiler-multiple-times.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+Profile title: Start the profiler the second time.
+Thread_1 (no file) (line 0:0)
+   startTest start-and-stop-profiler-multiple-times.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+Profile title: Start the profiler the third time.
+Thread_1 (no file) (line 0:0)
+   startTest start-and-stop-profiler-multiple-times.html (line 10:19)
+      anonymousFunction profiler-test-JS-resources.js (line 29:34)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstartandstopprofilermultipletimeshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+ &lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Start the profiler the first time.&quot;);
+    anonymousFunction();
+    endTest();
+    console.profile(&quot;Start the profiler the second time.&quot;);
+    anonymousFunction();
+    endTest();
+    console.profile(&quot;Start the profiler the third time.&quot;);
+    anonymousFunction();
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls console.profile() and console.profileEnd() three times.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profiler there should be three profiles.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstartandstopprofilinginthesamefunctionexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This page's JavaScript starts profiling from within a nested location. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call to functionWichStopsTheProfiler().
+
+Profile title: Profiling From A Nested Location
+Thread_1 (no file) (line 0:0)
+   startTest start-and-stop-profiling-in-the-same-function.html (line 10:19)
+      functionWichStopsTheProfiler start-and-stop-profiling-in-the-same-function.html (line 17:38)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstartandstopprofilinginthesamefunctionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Profiling From A Nested Location&quot;);
+
+    functionWichStopsTheProfiler();
+}
+
+function functionWichStopsTheProfiler()
+{
+    for (var i = 0; i &lt; 10000000; i++)
+        var b = i + 2;
+
+    console.profileEnd(&quot;Profiling From A Nested Location&quot;);
+    printProfilesDataWithoutTime();
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript starts profiling from within a nested location.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to functionWichStopsTheProfiler().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstartbutdontstopprofilingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/start-but-dont-stop-profiling-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/start-but-dont-stop-profiling-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/start-but-dont-stop-profiling-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+This page's JavaScript calls console.profile() but not console.profileEnd(). 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. You should see the profile running (when that feature is implemented 6060556). Then navigate to another page and check the WebInspector again. Safari should not have crashed and the Inspector should not show a profile (unless we allow cross-load profiling in the future 5951478 &amp; 5954912).
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstartbutdontstopprofilinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/start-but-dont-stop-profiling.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/start-but-dont-stop-profiling.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/start-but-dont-stop-profiling.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+ &lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Start the profiler but don't stop it.&quot;);
+    anonymousFunction();
+    printProfilesDataWithoutTime();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript calls console.profile() but not console.profileEnd().
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  You should see the profile running (when that feature is implemented 6060556).
+Then navigate to another page and check the WebInspector again. Safari should not
+have crashed and the Inspector should not show a profile (unless we allow cross-load
+profiling in the future 5951478 &amp;amp; 5954912).
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstopprofilingaftersetTimeoutexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+This page's JavaScript stops profiling from a timeout. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile endProfile() should not be a child of (program).
+
+Profile title: Stop profiling from a timeout
+Thread_1 (no file) (line 0:0)
+   onload stop-profiling-after-setTimeout.html (line 21:44)
+      startTest stop-profiling-after-setTimeout.html (line 12:19)
+         setTimeout (no file) (line 0:0)
+   (program) stop-profiling-after-setTimeout.html (line 1:1)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstopprofilingaftersetTimeouthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,29 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Stop profiling from a timeout&quot;);    
+    setTimeout(&quot;endTest()&quot;, 20);
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript stops profiling from a timeout.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile endProfile() should not be a child of (program).
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstopthenfunctioncallexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/stop-then-function-call-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/stop-then-function-call-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/stop-then-function-call-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+This page has an anonymous JavaScript function that calls built-in functions. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. There should be two nodes in the profile, a &quot;(program)&quot; node with one child that is &quot;test&quot;.
+
+Profile title: Test
+Thread_1 (no file) (line 0:0)
+   (program) (no file) (line 1:16)
+      test stop-then-function-call.html (line 11:14)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerstopthenfunctioncallhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/stop-then-function-call.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/stop-then-function-call.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/stop-then-function-call.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,43 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+var j = 0;
+function test(len) {
+    for (var i = 0; i &lt; len; ++i)
+        ++j;
+}
+
+function test2(len) {
+    for (var i = 0; i &lt; len; ++i)
+        --j;
+}
+
+function startTest()
+{
+    var script = &quot;console.profile('Test');\n&quot;;
+    script += &quot;test(1000);\n&quot;;
+    script += &quot;console.profileEnd('Test');\n&quot;;
+    script += &quot;test2(1000);\n&quot;;
+
+    eval(script);
+
+    printProfilesDataWithoutTime();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has an anonymous JavaScript function that calls built-in functions.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile. There should be two nodes in the profile, a &quot;(program)&quot; node with one child that is &quot;test&quot;.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerthrowexceptionfromevalexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/throw-exception-from-eval-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/throw-exception-from-eval-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/throw-exception-from-eval-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+CONSOLE MESSAGE: Test exception.
+This page throws an exception from within eval(). 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. The profiler should not crash and still show the stack under insertnewText().
+
+Profile title: Throw within an eval.
+Thread_1 (no file) (line 0)
+   (program) throw-exception-from-eval.html (line 19)
+      (program) throw-exception-from-eval.html (line 10)
+         (program) throw-exception-from-eval.html (line 4)
+         (program) throw-exception-from-eval.html (line 19)
+            eval (no file) (line 0)
+               (program) (no file) (line 1)
+   onload throw-exception-from-eval.html (line 24)
+      startTest throw-exception-from-eval.html (line 13)
+         insertNewText profiler-test-JS-resources.js (line 17)
+            createElement (no file) (line 0)
+            createTextNode (no file) (line 0)
+            appendChild (no file) (line 0)
+            getElementById (no file) (line 0)
+         endTest profiler-test-JS-resources.js (line 1)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerthrowexceptionfromevalhtmldisabled"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/throw-exception-from-eval.html-disabled (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/throw-exception-from-eval.html-disabled                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/throw-exception-from-eval.html-disabled        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.settings.setLegacyJavaScriptProfilingEnabled(true);
+
+console.profile(&quot;Throw within an eval.&quot;);
+
+function startTest()
+{
+    insertNewText();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;script&gt;
+eval(&quot;throw('Test exception.');&quot;);
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page throws an exception from within eval().
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  The profiler should not crash and still show the stack under
+insertnewText().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilertwoexecutioncontextsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/two-execution-contexts-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/two-execution-contexts-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/two-execution-contexts-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+This page has two script tags with some simple JavaScript. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be two (program) elements.
+
+Profile title: Two Execution Contexts
+Thread_1 (no file) (line 0:0)
+   startTest two-execution-contexts.html (line 10:19)
+      intermediaryFunction two-execution-contexts.html (line 17:30)
+         testEnd two-execution-contexts.html (line 33:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilertwoexecutioncontextshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/two-execution-contexts.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/two-execution-contexts.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/two-execution-contexts.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Two Execution Contexts&quot;);
+
+    intermediaryFunction();
+}
+
+function intermediaryFunction()
+{
+    testEnd();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has two script tags with some simple JavaScript.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be two (program) elements.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;script&gt;
+function testEnd() {
+    console.profileEnd();
+    printProfilesDataWithoutTime();
+}
+&lt;/script&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileruserdefinedfunctioncallsbuiltinfunctionsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+This page has JavaScript that calls built-in functions. 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be calls to createElement() createTextNode() appendChild() and testEnd(), among others.
+This is inserted Text
+
+
+Profile title: User defined function calles built-in functions
+Thread_1 (no file) (line 0:0)
+   startTest user-defined-function-calls-built-in-functions.html (line 10:19)
+      createElement (no file) (line 0:0)
+      createTextNode (no file) (line 0:0)
+      appendChild (no file) (line 0:0)
+      getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofileruserdefinedfunctioncallsbuiltinfunctionshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;User defined function calles built-in functions&quot;);
+
+    var newP = document.createElement(&quot;p&quot;);
+    var textNode =document.createTextNode(&quot;This is inserted Text&quot;);
+    newP.appendChild(textNode);
+    var output = document.getElementById(&quot;output&quot;);
+    output.appendChild(newP);
+    
+    endTest();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has JavaScript that calls built-in functions.
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be calls to createElement() createTextNode()
+appendChild() and testEnd(), among others.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerwindowdotevalexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/window-dot-eval-expected.txt (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/window-dot-eval-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/window-dot-eval-expected.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,16 @@
</span><ins>+This page has a call to window.eval(). 
+
+To run this test manually, load it in the browser then load the WebInspector and look at the profile. In the profile there should be a call to eval().
+
+Profile title: Call window.eval()
+Thread_1 (no file) (line 0:0)
+   startTest window-dot-eval.html (line 10:19)
+      evalFunction (no file) (line 1:22)
+         insertNewText profiler-test-JS-resources.js (line 17:23)
+            createElement (no file) (line 0:0)
+            createTextNode (no file) (line 0:0)
+            appendChild (no file) (line 0:0)
+            getElementById (no file) (line 0:0)
+      endTest profiler-test-JS-resources.js (line 1:17)
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastprofilerwindowdotevalhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/profiler/window-dot-eval.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/profiler/window-dot-eval.html                                (rev 0)
+++ trunk/LayoutTests/fast/profiler/window-dot-eval.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+if (window.internals)
+    internals.setLegacyJavaScriptProfilingEnabled(true);
+
+function startTest()
+{
+    console.profile(&quot;Call window.eval()&quot;);
+
+    evalFunction();
+
+    endTest();
+}
+&lt;/script&gt;
+&lt;script&gt;
+window.eval(&quot;function evalFunction() { insertNewText(); }&quot;);
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page has a call to window.eval().
+&lt;br&gt;
+&lt;br&gt;
+To run this test manually, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to eval().
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1021,6 +1021,9 @@
</span><span class="cx"> webkit.org/b/142156 css3/shapes/spec-examples/shape-outside-012.html [ Failure Pass ]
</span><span class="cx"> webkit.org/b/142156 css3/shapes/spec-examples/shape-outside-019.html [ Failure Pass ]
</span><span class="cx"> 
</span><ins>+webkit.org/b/142157 fast/profiler/dead-time.html [ Failure Pass ]
+webkit.org/b/142157 fast/profiler/stop-profiling-after-setTimeout.html [ Failure Pass ]
+
</ins><span class="cx"> webkit.org/b/95551 fast/forms/datalist/update-range-with-datalist.html [ ImageOnlyFailure Pass ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/129820 svg/clip-path/mask-nested-clip-path-006.svg [ Pass ImageOnlyFailure ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1203,6 +1203,9 @@
</span><span class="cx"> webkit.org/b/136066 animations/missing-values-first-keyframe.html [ Crash Pass ]
</span><span class="cx"> webkit.org/b/136066 animations/state-at-end-event.html [ Crash Pass ]
</span><span class="cx"> 
</span><ins>+webkit.org/b/136067 fast/profiler/dead-time.html [ Failure Pass ]
+webkit.org/b/136067 fast/profiler/stop-profiling-after-setTimeout.html [ Failure Pass ]
+
</ins><span class="cx"> webkit.org/b/136070 fast/forms/label/label-becomes-visible-while-clicking-on-label.html [ Failure Pass ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/136580 media/context-menu-actions.html [ Timeout Pass ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1894,6 +1894,7 @@
</span><span class="cx"> fast/preloader/document-write-2.html [ Failure ]
</span><span class="cx"> fast/preloader/document-write.html [ Failure ]
</span><span class="cx"> fast/preloader/image-srcset.html [ Failure ]
</span><ins>+fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html [ Failure ]
</ins><span class="cx"> fast/regions/absolute-in-relative-overflow.html [ ImageOnlyFailure ]
</span><span class="cx"> fast/regions/absolute-pos-elem-in-region.html [ ImageOnlyFailure ]
</span><span class="cx"> fast/regions/animation-element-in-region-flowed-to-other-thread.html [ ImageOnlyFailure ]
</span></span></pre></div>
<a id="trunkManualTestsinspectorprofilertestcallhtml"></a>
<div class="addfile"><h4>Added: trunk/ManualTests/inspector/profiler-test-call.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ManualTests/inspector/profiler-test-call.html                                (rev 0)
+++ trunk/ManualTests/inspector/profiler-test-call.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+console.profile(&quot;Using the call() method&quot;);
+function startTest()
+{
+    var myObject = new fakeObject(1, 2);
+    endTest();
+}
+
+function fakeObject (x, y)
+{
+    this.x = x;
+    fakeInteriorFunction.call(this, y);
+}
+
+function fakeInteriorFunction(y)
+{
+    this.y = y;
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript has a call to call() in it.
+&lt;br&gt;
+&lt;br&gt;
+To use this test, load it in the browser then load the WebInspector and look at
+the profile.  In the profile there should be a call to fakeObject() with call() as
+its child and a fakeInteriorFunction() as call()'s child.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkManualTestsinspectorprofilertestmanycallsinthesamescopehtml"></a>
<div class="addfile"><h4>Added: trunk/ManualTests/inspector/profiler-test-many-calls-in-the-same-scope.html (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/ManualTests/inspector/profiler-test-many-calls-in-the-same-scope.html                                (rev 0)
+++ trunk/ManualTests/inspector/profiler-test-many-calls-in-the-same-scope.html        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,42 @@
</span><ins>+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;resources/profiler-test-JS-resources.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+console.profile(&quot;Many Calls In The Same Scope&quot;);
+function startTest()
+{
+    insertNewText();
+    insertGivenText(&quot;This was a triumph.&quot;);
+    arrayOperatorFunction(7);
+    intermediaryFunction();
+    anonymousFunction();
+    end()
+    endT();
+    endT();
+    endTest();
+}
+
+function end()
+{
+    var x = 0;
+}
+
+function endT()
+{
+    var y = 1;
+}
+
+&lt;/script&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;startTest()&quot;&gt;
+This page's JavaScript has many function calls in the same scope.
+&lt;br&gt;
+&lt;br&gt;
+To use this test, load it in the browser then load the WebInspector and look at
+the profile.  In the profile many functions should be the children of startTest.
+Use the sorting capabilites to make sure the similarly named functions are sorted
+correctly.
+&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSProfilerPrivatecppfromrev200972trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/API/JSProfilerPrivate.cpp (from rev 200972, trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h) (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSProfilerPrivate.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/API/JSProfilerPrivate.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#include &quot;config.h&quot;
+#include &quot;JSProfilerPrivate.h&quot;
+
+#include &quot;APICast.h&quot;
+#include &quot;LegacyProfiler.h&quot;
+#include &quot;OpaqueJSString.h&quot;
+
+using namespace JSC;
+
+void JSStartProfiling(JSContextRef ctx, JSStringRef title)
+{
+    // Use an independent stopwatch for API-initiated profiling, since the user will expect it
+    // to be relative to when their command was issued.
+    RefPtr&lt;Stopwatch&gt; stopwatch = Stopwatch::create();
+    stopwatch-&gt;start();
+    LegacyProfiler::profiler()-&gt;startProfiling(toJS(ctx), title-&gt;string(), stopwatch.release());
+}
+
+void JSEndProfiling(JSContextRef ctx, JSStringRef title)
+{
+    ExecState* exec = toJS(ctx);
+    LegacyProfiler* profiler = LegacyProfiler::profiler();
+    profiler-&gt;stopProfiling(exec, title-&gt;string());
+}
+
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreAPIJSProfilerPrivatehfromrev200972trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/API/JSProfilerPrivate.h (from rev 200972, trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h) (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/API/JSProfilerPrivate.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/API/JSProfilerPrivate.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#ifndef JSProfiler_h
+#define JSProfiler_h
+
+#include &lt;JavaScriptCore/JSBase.h&gt;
+
+#ifndef __cplusplus
+#include &lt;stdbool.h&gt;
+#endif
+
+#ifdef __cplusplus
+extern &quot;C&quot; {
+#endif
+
+/*!
+@function JSStartProfiling
+@abstract Enables the profler.
+@param ctx The execution context to use.
+@param title The title of the profile.
+@result The profiler is turned on.
+*/
+JS_EXPORT void JSStartProfiling(JSContextRef ctx, JSStringRef title);
+
+/*!
+@function JSEndProfiling
+@abstract Disables the profler.
+@param ctx The execution context to use.
+@param title The title of the profile.
+@result The profiler is turned off. If there is no name, the most recently started
+        profile is stopped. If the name does not match any profile then no profile
+        is stopped.
+*/
+JS_EXPORT void JSEndProfiling(JSContextRef ctx, JSStringRef title);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* JSProfiler_h */
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/CMakeLists.txt (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/CMakeLists.txt        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/CMakeLists.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -54,6 +54,7 @@
</span><span class="cx">     API/JSClassRef.cpp
</span><span class="cx">     API/JSContextRef.cpp
</span><span class="cx">     API/JSObjectRef.cpp
</span><ins>+    API/JSProfilerPrivate.cpp
</ins><span class="cx">     API/JSTypedArray.cpp
</span><span class="cx">     API/JSScriptRef.cpp
</span><span class="cx">     API/JSStringRef.cpp
</span><span class="lines">@@ -585,6 +586,10 @@
</span><span class="cx">     parser/SourceProviderCache.cpp
</span><span class="cx">     parser/VariableEnvironment.cpp
</span><span class="cx"> 
</span><ins>+    profiler/LegacyProfiler.cpp
+    profiler/Profile.cpp
+    profiler/ProfileGenerator.cpp
+    profiler/ProfileNode.cpp
</ins><span class="cx">     profiler/ProfilerBytecode.cpp
</span><span class="cx">     profiler/ProfilerBytecodeSequence.cpp
</span><span class="cx">     profiler/ProfilerBytecodes.cpp
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1,3 +1,206 @@
</span><ins>+2016-05-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Unreviewed rollout r200924. Caused js/regress/string-replace-generic.html to fail.
+
+        * API/JSProfilerPrivate.cpp: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
+        (JSStartProfiling):
+        (JSEndProfiling):
+        * API/JSProfilerPrivate.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
+        * CMakeLists.txt:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * bytecode/BytecodeList.json:
+        * bytecode/BytecodeUseDef.h:
+        (JSC::computeUsesForBytecodeOffset):
+        (JSC::computeDefsForBytecodeOffset):
+        * bytecode/CodeBlock.cpp:
+        (JSC::CodeBlock::dumpBytecode):
+        * bytecode/UnlinkedFunctionExecutable.cpp:
+        (JSC::generateUnlinkedFunctionCodeBlock):
+        (JSC::UnlinkedFunctionExecutable::unlinkedCodeBlockFor):
+        * bytecode/UnlinkedFunctionExecutable.h:
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::BytecodeGenerator):
+        (JSC::BytecodeGenerator::emitCall):
+        (JSC::BytecodeGenerator::emitCallVarargs):
+        (JSC::BytecodeGenerator::emitCallVarargsInTailPosition):
+        (JSC::BytecodeGenerator::emitConstructVarargs):
+        (JSC::BytecodeGenerator::emitConstruct):
+        * bytecompiler/BytecodeGenerator.h:
+        (JSC::CallArguments::profileHookRegister):
+        (JSC::BytecodeGenerator::shouldEmitProfileHooks):
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::CallArguments::CallArguments):
+        (JSC::CallFunctionCallDotNode::emitBytecode):
+        (JSC::ApplyFunctionCallDotNode::emitBytecode):
+        * dfg/DFGAbstractInterpreterInlines.h:
+        (JSC::DFG::AbstractInterpreter&lt;AbstractStateType&gt;::executeEffects):
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::parseBlock):
+        * dfg/DFGCapabilities.cpp:
+        (JSC::DFG::capabilityLevel):
+        * dfg/DFGClobberize.h:
+        (JSC::DFG::clobberize):
+        * dfg/DFGDoesGC.cpp:
+        (JSC::DFG::doesGC):
+        * dfg/DFGFixupPhase.cpp:
+        (JSC::DFG::FixupPhase::fixupNode):
+        * dfg/DFGNodeType.h:
+        * dfg/DFGPredictionPropagationPhase.cpp:
+        * dfg/DFGSafeToExecute.h:
+        (JSC::DFG::safeToExecute):
+        * dfg/DFGSpeculativeJIT32_64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * dfg/DFGSpeculativeJIT64.cpp:
+        (JSC::DFG::SpeculativeJIT::compile):
+        * inspector/InjectedScriptBase.cpp:
+        (Inspector::InjectedScriptBase::callFunctionWithEvalEnabled):
+        * inspector/protocol/Timeline.json:
+        * interpreter/Interpreter.cpp:
+        (JSC::UnwindFunctor::operator()):
+        (JSC::Interpreter::execute):
+        (JSC::Interpreter::executeCall):
+        (JSC::Interpreter::executeConstruct):
+        * jit/JIT.cpp:
+        (JSC::JIT::privateCompileMainPass):
+        * jit/JIT.h:
+        * jit/JITOpcodes.cpp:
+        (JSC::JIT::emit_op_profile_will_call):
+        (JSC::JIT::emit_op_profile_did_call):
+        * jit/JITOpcodes32_64.cpp:
+        (JSC::JIT::emit_op_profile_will_call):
+        (JSC::JIT::emit_op_profile_did_call):
+        * jit/JITOperations.cpp:
+        * jit/JITOperations.h:
+        * jsc.cpp:
+        * llint/LLIntSlowPaths.cpp:
+        (JSC::LLInt::LLINT_SLOW_PATH_DECL):
+        * llint/LLIntSlowPaths.h:
+        * llint/LowLevelInterpreter.asm:
+        * parser/ParserModes.h:
+        * profiler/CallIdentifier.h: Added.
+        (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):
+        (JSC::CallIdentifier::Hash::equal):
+        (JSC::CallIdentifier::hash):
+        (JSC::CallIdentifier::operator const char*):
+        (JSC::CallIdentifier::c_str):
+        (WTF::HashTraits&lt;JSC::CallIdentifier&gt;::constructDeletedValue):
+        (WTF::HashTraits&lt;JSC::CallIdentifier&gt;::isDeletedValue):
+        * profiler/LegacyProfiler.cpp: Added.
+        (JSC::LegacyProfiler::profiler):
+        (JSC::LegacyProfiler::startProfiling):
+        (JSC::LegacyProfiler::stopProfiling):
+        (JSC::callFunctionForProfilesWithGroup):
+        (JSC::LegacyProfiler::suspendProfiling):
+        (JSC::LegacyProfiler::unsuspendProfiling):
+        (JSC::LegacyProfiler::willExecute):
+        (JSC::LegacyProfiler::didExecute):
+        (JSC::LegacyProfiler::exceptionUnwind):
+        (JSC::LegacyProfiler::createCallIdentifier):
+        (JSC::createCallIdentifierFromFunctionImp):
+        * profiler/LegacyProfiler.h: Added.
+        (JSC::LegacyProfiler::currentProfiles):
+        * profiler/Profile.cpp: Added.
+        (JSC::Profile::create):
+        (JSC::Profile::Profile):
+        (JSC::Profile::~Profile):
+        (JSC::Profile::debugPrint):
+        (JSC::functionNameCountPairComparator):
+        (JSC::Profile::debugPrintSampleStyle):
+        * profiler/Profile.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
+        * profiler/ProfileGenerator.cpp: Added.
+        (JSC::ProfileGenerator::create):
+        (JSC::ProfileGenerator::ProfileGenerator):
+        (JSC::AddParentForConsoleStartFunctor::AddParentForConsoleStartFunctor):
+        (JSC::AddParentForConsoleStartFunctor::foundParent):
+        (JSC::AddParentForConsoleStartFunctor::operator()):
+        (JSC::ProfileGenerator::addParentForConsoleStart):
+        (JSC::ProfileGenerator::title):
+        (JSC::ProfileGenerator::beginCallEntry):
+        (JSC::ProfileGenerator::endCallEntry):
+        (JSC::ProfileGenerator::willExecute):
+        (JSC::ProfileGenerator::didExecute):
+        (JSC::ProfileGenerator::exceptionUnwind):
+        (JSC::ProfileGenerator::stopProfiling):
+        (JSC::ProfileGenerator::removeProfileStart):
+        (JSC::ProfileGenerator::removeProfileEnd):
+        * profiler/ProfileGenerator.h: Added.
+        (JSC::ProfileGenerator::profile):
+        (JSC::ProfileGenerator::origin):
+        (JSC::ProfileGenerator::profileGroup):
+        (JSC::ProfileGenerator::setIsSuspended):
+        * profiler/ProfileNode.cpp: Added.
+        (JSC::ProfileNode::ProfileNode):
+        (JSC::ProfileNode::addChild):
+        (JSC::ProfileNode::removeChild):
+        (JSC::ProfileNode::spliceNode):
+        (JSC::ProfileNode::traverseNextNodePostOrder):
+        (JSC::ProfileNode::debugPrint):
+        (JSC::ProfileNode::debugPrintSampleStyle):
+        (JSC::ProfileNode::debugPrintRecursively):
+        (JSC::ProfileNode::debugPrintSampleStyleRecursively):
+        * profiler/ProfileNode.h: Added.
+        (JSC::ProfileNode::create):
+        (JSC::ProfileNode::Call::Call):
+        (JSC::ProfileNode::Call::startTime):
+        (JSC::ProfileNode::Call::setStartTime):
+        (JSC::ProfileNode::Call::elapsedTime):
+        (JSC::ProfileNode::Call::setElapsedTime):
+        (JSC::ProfileNode::operator==):
+        (JSC::ProfileNode::callerCallFrame):
+        (JSC::ProfileNode::callIdentifier):
+        (JSC::ProfileNode::id):
+        (JSC::ProfileNode::functionName):
+        (JSC::ProfileNode::url):
+        (JSC::ProfileNode::lineNumber):
+        (JSC::ProfileNode::columnNumber):
+        (JSC::ProfileNode::parent):
+        (JSC::ProfileNode::setParent):
+        (JSC::ProfileNode::calls):
+        (JSC::ProfileNode::lastCall):
+        (JSC::ProfileNode::appendCall):
+        (JSC::ProfileNode::children):
+        (JSC::ProfileNode::firstChild):
+        (JSC::ProfileNode::lastChild):
+        (JSC::ProfileNode::nextSibling):
+        (JSC::ProfileNode::setNextSibling):
+        (JSC::ProfileNode::forEachNodePostorder):
+        (JSC::CalculateProfileSubtreeDataFunctor::operator()):
+        (JSC::CalculateProfileSubtreeDataFunctor::returnValue):
+        * profiler/ProfilerJettisonReason.cpp:
+        (WTF::printInternal):
+        * profiler/ProfilerJettisonReason.h:
+        * runtime/CodeCache.cpp:
+        (JSC::CodeCache::getGlobalCodeBlock):
+        (JSC::CodeCache::getProgramCodeBlock):
+        (JSC::CodeCache::getEvalCodeBlock):
+        (JSC::CodeCache::getModuleProgramCodeBlock):
+        * runtime/CodeCache.h:
+        * runtime/Executable.cpp:
+        (JSC::ScriptExecutable::newCodeBlockFor):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::~JSGlobalObject):
+        (JSC::JSGlobalObject::hasLegacyProfiler):
+        (JSC::JSGlobalObject::createProgramCodeBlock):
+        (JSC::JSGlobalObject::createEvalCodeBlock):
+        (JSC::JSGlobalObject::createModuleProgramCodeBlock):
+        * runtime/JSGlobalObject.h:
+        (JSC::JSGlobalObject::supportsLegacyProfiling):
+        * runtime/Options.h:
+        * runtime/VM.cpp:
+        (JSC::VM::VM):
+        (JSC::SetEnabledProfilerFunctor::operator()):
+        (JSC::VM::setEnabledProfiler):
+        * runtime/VM.h:
+        (JSC::VM::enabledProfiler):
+        (JSC::VM::enabledProfilerAddress):
+
</ins><span class="cx"> 2016-05-16  Konstantin Tokarev  &lt;annulen@yandex.ru&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, fixed typo in a comment.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreJavaScriptCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1416,6 +1416,14 @@
</span><span class="cx">                 933040040E6A749400786E6A /* SmallStrings.h in Headers */ = {isa = PBXBuildFile; fileRef = 93303FEA0E6A72C000786E6A /* SmallStrings.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 9330402C0E6A764000786E6A /* SmallStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93303FE80E6A72B500786E6A /* SmallStrings.cpp */; };
</span><span class="cx">                 9335F24D12E6765B002B5553 /* StringRecursionChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93345A8712D838C400302BE3 /* StringRecursionChecker.cpp */; };
</span><ins>+                9534AAFB0E5B7A9600B8A45B /* JSProfilerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                95742F650DD11F5A000917FB /* Profile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95742F630DD11F5A000917FB /* Profile.cpp */; };
+                95AB83420DA4322500BC83F3 /* LegacyProfiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */; };
+                95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */; };
+                95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */; };
+                95CD45770E1C4FDD0085358E /* ProfileGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 95CD45750E1C4FDD0085358E /* ProfileGenerator.h */; settings = {ATTRIBUTES = (); }; };
+                95E3BC050E1AE68200B2D1C1 /* CallIdentifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                95F6E6950E5B5F970091E860 /* JSProfilerPrivate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95988BA90E477BEC00D28D4D /* JSProfilerPrivate.cpp */; };
</ins><span class="cx">                 960097A60EBABB58007A7297 /* LabelScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 960097A50EBABB58007A7297 /* LabelScope.h */; };
</span><span class="cx">                 9688CB150ED12B4E001D649F /* AssemblerBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 9688CB130ED12B4E001D649F /* AssemblerBuffer.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 9688CB160ED12B4E001D649F /* X86Assembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 9688CB140ED12B4E001D649F /* X86Assembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -1884,6 +1892,9 @@
</span><span class="cx">                 BC18C4460E16F5CD00B34460 /* ObjectPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = BC2680C90E16D4E900A06E92 /* ObjectPrototype.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC18C4480E16F5CD00B34460 /* Operations.h in Headers */ = {isa = PBXBuildFile; fileRef = F692A8780255597D01FF60F7 /* Operations.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                BC18C4500E16F5CD00B34460 /* Profile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95742F640DD11F5A000917FB /* Profile.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                BC18C4510E16F5CD00B34460 /* ProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB83550DA43B4400BC83F3 /* ProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                BC18C4520E16F5CD00B34460 /* LegacyProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 BC18C4540E16F5CD00B34460 /* PropertyNameArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 65400C100A69BAF200509887 /* PropertyNameArray.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC18C4550E16F5CD00B34460 /* PropertySlot.h in Headers */ = {isa = PBXBuildFile; fileRef = 65621E6C089E859700760F35 /* PropertySlot.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 BC18C4560E16F5CD00B34460 /* Protect.h in Headers */ = {isa = PBXBuildFile; fileRef = 65C02FBB0637462A003E7EE6 /* Protect.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -3624,7 +3635,18 @@
</span><span class="cx">                 93F0B3A909BB4DC00068FCE3 /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Parser.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93F0B3AA09BB4DC00068FCE3 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parser.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93F1981A08245AAE001E9ABC /* Keywords.table */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = Keywords.table; sourceTree = &quot;&lt;group&gt;&quot;; tabWidth = 8; };
</span><ins>+                952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSProfilerPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                95742F630DD11F5A000917FB /* Profile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Profile.cpp; path = profiler/Profile.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                95742F640DD11F5A000917FB /* Profile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Profile.h; path = profiler/Profile.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                95988BA90E477BEC00D28D4D /* JSProfilerPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSProfilerPrivate.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LegacyProfiler.cpp; path = profiler/LegacyProfiler.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LegacyProfiler.h; path = profiler/LegacyProfiler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProfileNode.cpp; path = profiler/ProfileNode.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                95AB83550DA43B4400BC83F3 /* ProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfileNode.h; path = profiler/ProfileNode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSRetainPtr.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProfileGenerator.cpp; path = profiler/ProfileGenerator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                95CD45750E1C4FDD0085358E /* ProfileGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProfileGenerator.h; path = profiler/ProfileGenerator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CallIdentifier.h; path = profiler/CallIdentifier.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 960097A50EBABB58007A7297 /* LabelScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LabelScope.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9688CB130ED12B4E001D649F /* AssemblerBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AssemblerBuffer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9688CB140ED12B4E001D649F /* X86Assembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = X86Assembler.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5246,6 +5268,8 @@
</span><span class="cx">                                 1482B7E20A43076000517CFC /* JSObjectRef.cpp */,
</span><span class="cx">                                 1482B7E10A43076000517CFC /* JSObjectRef.h */,
</span><span class="cx">                                 A79EDB0811531CD60019E912 /* JSObjectRefPrivate.h */,
</span><ins>+                                95988BA90E477BEC00D28D4D /* JSProfilerPrivate.cpp */,
+                                952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */,
</ins><span class="cx">                                 A552C37D1ADDB8FE00139726 /* JSRemoteInspector.cpp */,
</span><span class="cx">                                 A552C37E1ADDB8FE00139726 /* JSRemoteInspector.h */,
</span><span class="cx">                                 95C18D3E0C90E7EF00E72F73 /* JSRetainPtr.h */,
</span><span class="lines">@@ -6409,6 +6433,15 @@
</span><span class="cx">                 95AB831A0DA42C6900BC83F3 /* profiler */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                95E3BC040E1AE68200B2D1C1 /* CallIdentifier.h */,
+                                95AB832E0DA42CAD00BC83F3 /* LegacyProfiler.cpp */,
+                                95AB832F0DA42CAD00BC83F3 /* LegacyProfiler.h */,
+                                95742F630DD11F5A000917FB /* Profile.cpp */,
+                                95742F640DD11F5A000917FB /* Profile.h */,
+                                95CD45740E1C4FDD0085358E /* ProfileGenerator.cpp */,
+                                95CD45750E1C4FDD0085358E /* ProfileGenerator.h */,
+                                95AB83540DA43B4400BC83F3 /* ProfileNode.cpp */,
+                                95AB83550DA43B4400BC83F3 /* ProfileNode.h */,
</ins><span class="cx">                                 0FF72992166AD347000F5BA3 /* ProfilerBytecode.cpp */,
</span><span class="cx">                                 0FF72993166AD347000F5BA3 /* ProfilerBytecode.h */,
</span><span class="cx">                                 0FF72994166AD347000F5BA3 /* ProfilerBytecodes.cpp */,
</span><span class="lines">@@ -7085,6 +7118,7 @@
</span><span class="cx">                                 1429D8DE0ED2205B00B89619 /* CallFrame.h in Headers */,
</span><span class="cx">                                 62EC9BB71B7EB07C00303AD1 /* CallFrameShuffleData.h in Headers */,
</span><span class="cx">                                 62D755D71B84FB4A001801FA /* CallFrameShuffler.h in Headers */,
</span><ins>+                                95E3BC050E1AE68200B2D1C1 /* CallIdentifier.h in Headers */,
</ins><span class="cx">                                 0F0B83B114BCF71800885B4F /* CallLinkInfo.h in Headers */,
</span><span class="cx">                                 0F93329E14CA7DC50085F3C6 /* CallLinkStatus.h in Headers */,
</span><span class="cx">                                 627673241B680C1E00FD9F2E /* CallMode.h in Headers */,
</span><span class="lines">@@ -7703,6 +7737,7 @@
</span><span class="cx">                                 A7280A2811557E3000D56957 /* JSObjectRefPrivate.h in Headers */,
</span><span class="cx">                                 A7F9935F0FD7325100A0B2D0 /* JSONObject.h in Headers */,
</span><span class="cx">                                 BC87CDB910712AD4000614CF /* JSONObject.lut.h in Headers */,
</span><ins>+                                9534AAFB0E5B7A9600B8A45B /* JSProfilerPrivate.h in Headers */,
</ins><span class="cx">                                 7C184E1B17BEDBD3007CB63A /* JSPromise.h in Headers */,
</span><span class="cx">                                 7C184E2317BEE240007CB63A /* JSPromiseConstructor.h in Headers */,
</span><span class="cx">                                 996B731E1BDA08EF00331B84 /* JSPromiseConstructor.lut.h in Headers */,
</span><span class="lines">@@ -7768,6 +7803,7 @@
</span><span class="cx">                                 960097A60EBABB58007A7297 /* LabelScope.h in Headers */,
</span><span class="cx">                                 0FB5467714F59B5C002C2989 /* LazyOperandValueProfile.h in Headers */,
</span><span class="cx">                                 99DA00B01BD5994E00F4575C /* lazywriter.py in Headers */,
</span><ins>+                                BC18C4520E16F5CD00B34460 /* LegacyProfiler.h in Headers */,
</ins><span class="cx">                                 BC18C4310E16F5CD00B34460 /* Lexer.h in Headers */,
</span><span class="cx">                                 BC18C52E0E16FCE100B34460 /* Lexer.lut.h in Headers */,
</span><span class="cx">                                 DCF3D56B1CD29472003D5C65 /* LazyClassStructureInlines.h in Headers */,
</span><span class="lines">@@ -7872,6 +7908,9 @@
</span><span class="cx">                                 0FE834181A6EF97B00D04847 /* PolymorphicCallStubRoutine.h in Headers */,
</span><span class="cx">                                 0F98206116BFE38300240D02 /* PreciseJumpTargets.h in Headers */,
</span><span class="cx">                                 868916B0155F286300CB2B9A /* PrivateName.h in Headers */,
</span><ins>+                                BC18C4500E16F5CD00B34460 /* Profile.h in Headers */,
+                                95CD45770E1C4FDD0085358E /* ProfileGenerator.h in Headers */,
+                                BC18C4510E16F5CD00B34460 /* ProfileNode.h in Headers */,
</ins><span class="cx">                                 0FF729A5166AD351000F5BA3 /* ProfilerBytecode.h in Headers */,
</span><span class="cx">                                 0FF729B9166AD360000F5BA3 /* ProfilerBytecodes.h in Headers */,
</span><span class="cx">                                 0F13912A16771C36009CCB07 /* ProfilerBytecodeSequence.h in Headers */,
</span><span class="lines">@@ -9116,6 +9155,7 @@
</span><span class="cx">                                 147F39D4107EC37600427A48 /* JSObject.cpp in Sources */,
</span><span class="cx">                                 1482B7E40A43076000517CFC /* JSObjectRef.cpp in Sources */,
</span><span class="cx">                                 A7F993600FD7325100A0B2D0 /* JSONObject.cpp in Sources */,
</span><ins>+                                95F6E6950E5B5F970091E860 /* JSProfilerPrivate.cpp in Sources */,
</ins><span class="cx">                                 7C184E1A17BEDBD3007CB63A /* JSPromise.cpp in Sources */,
</span><span class="cx">                                 7C184E2217BEE240007CB63A /* JSPromiseConstructor.cpp in Sources */,
</span><span class="cx">                                 7C008CDA187124BB00955C24 /* JSPromiseDeferred.cpp in Sources */,
</span><span class="lines">@@ -9158,6 +9198,7 @@
</span><span class="cx">                                 14280870107EC1340013E7B2 /* JSWrapperObject.cpp in Sources */,
</span><span class="cx">                                 BCFD8C920EEB2EE700283848 /* JumpTable.cpp in Sources */,
</span><span class="cx">                                 0FB5467914F5C46B002C2989 /* LazyOperandValueProfile.cpp in Sources */,
</span><ins>+                                95AB83420DA4322500BC83F3 /* LegacyProfiler.cpp in Sources */,
</ins><span class="cx">                                 148F21B0107EC5410042EC2C /* Lexer.cpp in Sources */,
</span><span class="cx">                                 0FF4275715914A20004CB9FF /* LinkBuffer.cpp in Sources */,
</span><span class="cx">                                 A7E2EA6C0FB460CF00601F06 /* LiteralParser.cpp in Sources */,
</span><span class="lines">@@ -9225,6 +9266,9 @@
</span><span class="cx">                                 0FE834171A6EF97B00D04847 /* PolymorphicCallStubRoutine.cpp in Sources */,
</span><span class="cx">                                 0F338E141BF0276C0013C88F /* B3ValueKey.cpp in Sources */,
</span><span class="cx">                                 0F98206016BFE38100240D02 /* PreciseJumpTargets.cpp in Sources */,
</span><ins>+                                95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
+                                95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
+                                95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
</ins><span class="cx">                                 0FF729AD166AD35C000F5BA3 /* ProfilerBytecode.cpp in Sources */,
</span><span class="cx">                                 0FF729AE166AD35C000F5BA3 /* ProfilerBytecodes.cpp in Sources */,
</span><span class="cx">                                 0F13912916771C33009CCB07 /* ProfilerBytecodeSequence.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeListjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeList.json (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeList.json        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -123,6 +123,8 @@
</span><span class="cx">             { &quot;name&quot; : &quot;op_throw&quot;, &quot;length&quot; : 2 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_throw_static_error&quot;, &quot;length&quot; : 3 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_debug&quot;, &quot;length&quot; : 3 },
</span><ins>+            { &quot;name&quot; : &quot;op_profile_will_call&quot;, &quot;length&quot; : 2 },
+            { &quot;name&quot; : &quot;op_profile_did_call&quot;, &quot;length&quot; : 2 },
</ins><span class="cx">             { &quot;name&quot; : &quot;op_end&quot;, &quot;length&quot; : 2 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_profile_type&quot;, &quot;length&quot; : 6 },
</span><span class="cx">             { &quot;name&quot; : &quot;op_profile_control_flow&quot;, &quot;length&quot; : 2 },
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeBytecodeUseDefh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/bytecode/BytecodeUseDef.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -62,6 +62,8 @@
</span><span class="cx">     case op_get_scope:
</span><span class="cx">     case op_to_this:
</span><span class="cx">     case op_check_tdz:
</span><ins>+    case op_profile_will_call:
+    case op_profile_did_call:
</ins><span class="cx">     case op_profile_type:
</span><span class="cx">     case op_throw:
</span><span class="cx">     case op_end:
</span><span class="lines">@@ -310,6 +312,8 @@
</span><span class="cx">     case op_copy_rest:
</span><span class="cx">     case op_put_to_scope:
</span><span class="cx">     case op_end:
</span><ins>+    case op_profile_will_call:
+    case op_profile_did_call:
</ins><span class="cx">     case op_throw:
</span><span class="cx">     case op_throw_static_error:
</span><span class="cx">     case op_save:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeCodeBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1654,6 +1654,16 @@
</span><span class="cx">             out.printf(&quot;%s, %d&quot;, registerName(condition).data(), line);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><ins>+        case op_profile_will_call: {
+            int function = (++it)-&gt;u.operand;
+            printLocationOpAndRegisterOperand(out, exec, location, it, &quot;profile_will_call&quot;, function);
+            break;
+        }
+        case op_profile_did_call: {
+            int function = (++it)-&gt;u.operand;
+            printLocationOpAndRegisterOperand(out, exec, location, it, &quot;profile_did_call&quot;, function);
+            break;
+        }
</ins><span class="cx">         case op_end: {
</span><span class="cx">             int r0 = (++it)-&gt;u.operand;
</span><span class="cx">             printLocationOpAndRegisterOperand(out, exec, location, it, &quot;end&quot;, r0);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx"> 
</span><span class="cx"> static UnlinkedFunctionCodeBlock* generateUnlinkedFunctionCodeBlock(
</span><span class="cx">     VM&amp; vm, UnlinkedFunctionExecutable* executable, const SourceCode&amp; source,
</span><del>-    CodeSpecializationKind kind, DebuggerMode debuggerMode,
</del><ins>+    CodeSpecializationKind kind, DebuggerMode debuggerMode, ProfilerMode profilerMode,
</ins><span class="cx">     UnlinkedFunctionKind functionKind, ParserError&amp; error, SourceParseMode parseMode)
</span><span class="cx"> {
</span><span class="cx">     JSParserBuiltinMode builtinMode = executable-&gt;isBuiltinFunction() ? JSParserBuiltinMode::Builtin : JSParserBuiltinMode::NotBuiltin;
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx"> 
</span><span class="cx">     UnlinkedFunctionCodeBlock* result = UnlinkedFunctionCodeBlock::create(&amp;vm, FunctionCode, ExecutableInfo(function-&gt;usesEval(), function-&gt;isStrictMode(), kind == CodeForConstruct, functionKind == UnlinkedBuiltinFunction, executable-&gt;constructorKind(), executable-&gt;superBinding(), parseMode, executable-&gt;derivedContextType(), false, isClassContext, EvalContextType::FunctionEvalContext));
</span><span class="cx"> 
</span><del>-    error = BytecodeGenerator::generate(vm, function.get(), result, debuggerMode, executable-&gt;parentScopeTDZVariables());
</del><ins>+    error = BytecodeGenerator::generate(vm, function.get(), result, debuggerMode, profilerMode, executable-&gt;parentScopeTDZVariables());
</ins><span class="cx"> 
</span><span class="cx">     if (error.isValid())
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -191,7 +191,7 @@
</span><span class="cx"> 
</span><span class="cx"> UnlinkedFunctionCodeBlock* UnlinkedFunctionExecutable::unlinkedCodeBlockFor(
</span><span class="cx">     VM&amp; vm, const SourceCode&amp; source, CodeSpecializationKind specializationKind, 
</span><del>-    DebuggerMode debuggerMode, ParserError&amp; error, SourceParseMode parseMode)
</del><ins>+    DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError&amp; error, SourceParseMode parseMode)
</ins><span class="cx"> {
</span><span class="cx">     switch (specializationKind) {
</span><span class="cx">     case CodeForCall:
</span><span class="lines">@@ -205,7 +205,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     UnlinkedFunctionCodeBlock* result = generateUnlinkedFunctionCodeBlock(
</span><del>-        vm, this, source, specializationKind, debuggerMode, 
</del><ins>+        vm, this, source, specializationKind, debuggerMode, profilerMode, 
</ins><span class="cx">         isBuiltinFunction() ? UnlinkedBuiltinFunction : UnlinkedNormalFunction, 
</span><span class="cx">         error, parseMode);
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecodeUnlinkedFunctionExecutableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/bytecode/UnlinkedFunctionExecutable.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx">     void setInvalidTypeProfilingOffsets();
</span><span class="cx"> 
</span><span class="cx">     UnlinkedFunctionCodeBlock* unlinkedCodeBlockFor(
</span><del>-        VM&amp;, const SourceCode&amp;, CodeSpecializationKind, DebuggerMode,
</del><ins>+        VM&amp;, const SourceCode&amp;, CodeSpecializationKind, DebuggerMode, ProfilerMode, 
</ins><span class="cx">         ParserError&amp;, SourceParseMode);
</span><span class="cx"> 
</span><span class="cx">     static UnlinkedFunctionExecutable* fromGlobalCode(
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -147,8 +147,9 @@
</span><span class="cx">     return ParserError(ParserError::ErrorNone);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-BytecodeGenerator::BytecodeGenerator(VM&amp; vm, ProgramNode* programNode, UnlinkedProgramCodeBlock* codeBlock, DebuggerMode debuggerMode, const VariableEnvironment* parentScopeTDZVariables)
</del><ins>+BytecodeGenerator::BytecodeGenerator(VM&amp; vm, ProgramNode* programNode, UnlinkedProgramCodeBlock* codeBlock, DebuggerMode debuggerMode, ProfilerMode profilerMode, const VariableEnvironment* parentScopeTDZVariables)
</ins><span class="cx">     : m_shouldEmitDebugHooks(Options::forceDebuggerBytecodeGeneration() || debuggerMode == DebuggerOn)
</span><ins>+    , m_shouldEmitProfileHooks(Options::forceProfilerBytecodeGeneration() || profilerMode == ProfilerOn)
</ins><span class="cx">     , m_scopeNode(programNode)
</span><span class="cx">     , m_codeBlock(vm, codeBlock)
</span><span class="cx">     , m_thisRegister(CallFrame::thisArgumentOffset())
</span><span class="lines">@@ -192,8 +193,9 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-BytecodeGenerator::BytecodeGenerator(VM&amp; vm, FunctionNode* functionNode, UnlinkedFunctionCodeBlock* codeBlock, DebuggerMode debuggerMode, const VariableEnvironment* parentScopeTDZVariables)
</del><ins>+BytecodeGenerator::BytecodeGenerator(VM&amp; vm, FunctionNode* functionNode, UnlinkedFunctionCodeBlock* codeBlock, DebuggerMode debuggerMode, ProfilerMode profilerMode, const VariableEnvironment* parentScopeTDZVariables)
</ins><span class="cx">     : m_shouldEmitDebugHooks(Options::forceDebuggerBytecodeGeneration() || debuggerMode == DebuggerOn)
</span><ins>+    , m_shouldEmitProfileHooks(Options::forceProfilerBytecodeGeneration() || profilerMode == ProfilerOn)
</ins><span class="cx">     , m_scopeNode(functionNode)
</span><span class="cx">     , m_codeBlock(vm, codeBlock)
</span><span class="cx">     , m_codeType(FunctionCode)
</span><span class="lines">@@ -205,7 +207,7 @@
</span><span class="cx">     // op_will_call / op_did_call pairs before and after a call, which are not
</span><span class="cx">     // compatible with tail calls (we have no way of emitting op_did_call).
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=148819
</span><del>-    , m_inTailPosition(Options::useTailCalls() &amp;&amp; !isConstructor() &amp;&amp; constructorKind() == ConstructorKind::None &amp;&amp; isStrictMode())
</del><ins>+    , m_inTailPosition(Options::useTailCalls() &amp;&amp; !isConstructor() &amp;&amp; constructorKind() == ConstructorKind::None &amp;&amp; isStrictMode() &amp;&amp; !m_shouldEmitProfileHooks)
</ins><span class="cx">     , m_needsToUpdateArrowFunctionContext(functionNode-&gt;usesArrowFunction() || functionNode-&gt;usesEval())
</span><span class="cx">     , m_derivedContextType(codeBlock-&gt;derivedContextType())
</span><span class="cx"> {
</span><span class="lines">@@ -592,8 +594,9 @@
</span><span class="cx">     pushLexicalScope(m_scopeNode, TDZCheckOptimization::Optimize, NestedScopeType::IsNotNested, nullptr, shouldInitializeBlockScopedFunctions);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-BytecodeGenerator::BytecodeGenerator(VM&amp; vm, EvalNode* evalNode, UnlinkedEvalCodeBlock* codeBlock, DebuggerMode debuggerMode, const VariableEnvironment* parentScopeTDZVariables)
</del><ins>+BytecodeGenerator::BytecodeGenerator(VM&amp; vm, EvalNode* evalNode, UnlinkedEvalCodeBlock* codeBlock, DebuggerMode debuggerMode, ProfilerMode profilerMode, const VariableEnvironment* parentScopeTDZVariables)
</ins><span class="cx">     : m_shouldEmitDebugHooks(Options::forceDebuggerBytecodeGeneration() || debuggerMode == DebuggerOn)
</span><ins>+    , m_shouldEmitProfileHooks(Options::forceProfilerBytecodeGeneration() || profilerMode == ProfilerOn)
</ins><span class="cx">     , m_scopeNode(evalNode)
</span><span class="cx">     , m_codeBlock(vm, codeBlock)
</span><span class="cx">     , m_thisRegister(CallFrame::thisArgumentOffset())
</span><span class="lines">@@ -649,8 +652,9 @@
</span><span class="cx">     pushLexicalScope(m_scopeNode, TDZCheckOptimization::Optimize, NestedScopeType::IsNotNested, nullptr, shouldInitializeBlockScopedFunctions);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-BytecodeGenerator::BytecodeGenerator(VM&amp; vm, ModuleProgramNode* moduleProgramNode, UnlinkedModuleProgramCodeBlock* codeBlock, DebuggerMode debuggerMode, const VariableEnvironment* parentScopeTDZVariables)
</del><ins>+BytecodeGenerator::BytecodeGenerator(VM&amp; vm, ModuleProgramNode* moduleProgramNode, UnlinkedModuleProgramCodeBlock* codeBlock, DebuggerMode debuggerMode, ProfilerMode profilerMode, const VariableEnvironment* parentScopeTDZVariables)
</ins><span class="cx">     : m_shouldEmitDebugHooks(Options::forceDebuggerBytecodeGeneration() || debuggerMode == DebuggerOn)
</span><ins>+    , m_shouldEmitProfileHooks(Options::forceProfilerBytecodeGeneration() || profilerMode == ProfilerOn)
</ins><span class="cx">     , m_scopeNode(moduleProgramNode)
</span><span class="cx">     , m_codeBlock(vm, codeBlock)
</span><span class="cx">     , m_thisRegister(CallFrame::thisArgumentOffset())
</span><span class="lines">@@ -3049,6 +3053,9 @@
</span><span class="cx">     ASSERT(opcodeID == op_call || opcodeID == op_call_eval || opcodeID == op_tail_call);
</span><span class="cx">     ASSERT(func-&gt;refCount());
</span><span class="cx">     
</span><ins>+    if (m_shouldEmitProfileHooks)
+        emitMove(callArguments.profileHookRegister(), func);
+
</ins><span class="cx">     // Generate code for arguments.
</span><span class="cx">     unsigned argument = 0;
</span><span class="cx">     if (callArguments.argumentsNode()) {
</span><span class="lines">@@ -3059,7 +3066,7 @@
</span><span class="cx">             RefPtr&lt;RegisterID&gt; argumentRegister;
</span><span class="cx">             argumentRegister = expression-&gt;emitBytecode(*this, callArguments.argumentRegister(0));
</span><span class="cx">             RefPtr&lt;RegisterID&gt; thisRegister = emitMove(newTemporary(), callArguments.thisRegister());
</span><del>-            return emitCallVarargs(opcodeID == op_tail_call ? op_tail_call_varargs : op_call_varargs, dst, func, callArguments.thisRegister(), argumentRegister.get(), newTemporary(), 0, divot, divotStart, divotEnd);
</del><ins>+            return emitCallVarargs(opcodeID == op_tail_call ? op_tail_call_varargs : op_call_varargs, dst, func, callArguments.thisRegister(), argumentRegister.get(), newTemporary(), 0, callArguments.profileHookRegister(), divot, divotStart, divotEnd);
</ins><span class="cx">         }
</span><span class="cx">         for (; n; n = n-&gt;m_next)
</span><span class="cx">             emitNode(callArguments.argumentRegister(argument++), n);
</span><span class="lines">@@ -3070,6 +3077,11 @@
</span><span class="cx">     for (int i = 0; i &lt; JSStack::CallFrameHeaderSize; ++i)
</span><span class="cx">         callFrame.append(newTemporary());
</span><span class="cx"> 
</span><ins>+    if (m_shouldEmitProfileHooks) {
+        emitOpcode(op_profile_will_call);
+        instructions().append(callArguments.profileHookRegister()-&gt;index());
+    }
+
</ins><span class="cx">     emitExpressionInfo(divot, divotStart, divotEnd);
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;Label&gt; done = newLabel();
</span><span class="lines">@@ -3095,26 +3107,37 @@
</span><span class="cx">     if (expectedFunction != NoExpectedFunction)
</span><span class="cx">         emitLabel(done.get());
</span><span class="cx"> 
</span><ins>+    if (m_shouldEmitProfileHooks) {
+        emitOpcode(op_profile_did_call);
+        instructions().append(callArguments.profileHookRegister()-&gt;index());
+    }
+
</ins><span class="cx">     return dst;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RegisterID* BytecodeGenerator::emitCallVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd)
</del><ins>+RegisterID* BytecodeGenerator::emitCallVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd)
</ins><span class="cx"> {
</span><del>-    return emitCallVarargs(op_call_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, divot, divotStart, divotEnd);
</del><ins>+    return emitCallVarargs(op_call_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, profileHookRegister, divot, divotStart, divotEnd);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RegisterID* BytecodeGenerator::emitCallVarargsInTailPosition(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd)
</del><ins>+RegisterID* BytecodeGenerator::emitCallVarargsInTailPosition(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd)
</ins><span class="cx"> {
</span><del>-    return emitCallVarargs(m_inTailPosition ? op_tail_call_varargs : op_call_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, divot, divotStart, divotEnd);
</del><ins>+    return emitCallVarargs(m_inTailPosition ? op_tail_call_varargs : op_call_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, profileHookRegister, divot, divotStart, divotEnd);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RegisterID* BytecodeGenerator::emitConstructVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd)
</del><ins>+RegisterID* BytecodeGenerator::emitConstructVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd)
</ins><span class="cx"> {
</span><del>-    return emitCallVarargs(op_construct_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, divot, divotStart, divotEnd);
</del><ins>+    return emitCallVarargs(op_construct_varargs, dst, func, thisRegister, arguments, firstFreeRegister, firstVarArgOffset, profileHookRegister, divot, divotStart, divotEnd);
</ins><span class="cx"> }
</span><span class="cx">     
</span><del>-RegisterID* BytecodeGenerator::emitCallVarargs(OpcodeID opcode, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd)
</del><ins>+RegisterID* BytecodeGenerator::emitCallVarargs(OpcodeID opcode, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd)
</ins><span class="cx"> {
</span><ins>+    if (m_shouldEmitProfileHooks) {
+        emitMove(profileHookRegister, func);
+        emitOpcode(op_profile_will_call);
+        instructions().append(profileHookRegister-&gt;index());
+    }
+    
</ins><span class="cx">     emitExpressionInfo(divot, divotStart, divotEnd);
</span><span class="cx"> 
</span><span class="cx">     if (opcode == op_tail_call_varargs)
</span><span class="lines">@@ -3132,6 +3155,10 @@
</span><span class="cx">     instructions().append(firstVarArgOffset);
</span><span class="cx">     instructions().append(arrayProfile);
</span><span class="cx">     instructions().append(profile);
</span><ins>+    if (m_shouldEmitProfileHooks) {
+        emitOpcode(op_profile_did_call);
+        instructions().append(profileHookRegister-&gt;index());
+    }
</ins><span class="cx">     return dst;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3222,6 +3249,9 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(func-&gt;refCount());
</span><span class="cx"> 
</span><ins>+    if (m_shouldEmitProfileHooks)
+        emitMove(callArguments.profileHookRegister(), func);
+
</ins><span class="cx">     // Generate code for arguments.
</span><span class="cx">     unsigned argument = 0;
</span><span class="cx">     if (ArgumentsNode* argumentsNode = callArguments.argumentsNode()) {
</span><span class="lines">@@ -3232,13 +3262,18 @@
</span><span class="cx">             auto expression = static_cast&lt;SpreadExpressionNode*&gt;(n-&gt;m_expr)-&gt;expression();
</span><span class="cx">             RefPtr&lt;RegisterID&gt; argumentRegister;
</span><span class="cx">             argumentRegister = expression-&gt;emitBytecode(*this, callArguments.argumentRegister(0));
</span><del>-            return emitConstructVarargs(dst, func, callArguments.thisRegister(), argumentRegister.get(), newTemporary(), 0, divot, divotStart, divotEnd);
</del><ins>+            return emitConstructVarargs(dst, func, callArguments.thisRegister(), argumentRegister.get(), newTemporary(), 0, callArguments.profileHookRegister(), divot, divotStart, divotEnd);
</ins><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         for (ArgumentListNode* n = argumentsNode-&gt;m_listNode; n; n = n-&gt;m_next)
</span><span class="cx">             emitNode(callArguments.argumentRegister(argument++), n);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (m_shouldEmitProfileHooks) {
+        emitOpcode(op_profile_will_call);
+        instructions().append(callArguments.profileHookRegister()-&gt;index());
+    }
+
</ins><span class="cx">     // Reserve space for call frame.
</span><span class="cx">     Vector&lt;RefPtr&lt;RegisterID&gt;, JSStack::CallFrameHeaderSize, UnsafeVectorOverflow&gt; callFrame;
</span><span class="cx">     for (int i = 0; i &lt; JSStack::CallFrameHeaderSize; ++i)
</span><span class="lines">@@ -3263,6 +3298,11 @@
</span><span class="cx">     if (expectedFunction != NoExpectedFunction)
</span><span class="cx">         emitLabel(done.get());
</span><span class="cx"> 
</span><ins>+    if (m_shouldEmitProfileHooks) {
+        emitOpcode(op_profile_did_call);
+        instructions().append(callArguments.profileHookRegister()-&gt;index());
+    }
+
</ins><span class="cx">     return dst;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -75,9 +75,11 @@
</span><span class="cx">         RegisterID* argumentRegister(unsigned i) { return m_argv[i + 1].get(); }
</span><span class="cx">         unsigned stackOffset() { return -m_argv[0]-&gt;index() + JSStack::CallFrameHeaderSize; }
</span><span class="cx">         unsigned argumentCountIncludingThis() { return m_argv.size() - m_padding; }
</span><ins>+        RegisterID* profileHookRegister() { return m_profileHookRegister.get(); }
</ins><span class="cx">         ArgumentsNode* argumentsNode() { return m_argumentsNode; }
</span><span class="cx"> 
</span><span class="cx">     private:
</span><ins>+        RefPtr&lt;RegisterID&gt; m_profileHookRegister;
</ins><span class="cx">         ArgumentsNode* m_argumentsNode;
</span><span class="cx">         Vector&lt;RefPtr&lt;RegisterID&gt;, 8, UnsafeVectorOverflow&gt; m_argv;
</span><span class="cx">         unsigned m_padding;
</span><span class="lines">@@ -267,10 +269,10 @@
</span><span class="cx">     public:
</span><span class="cx">         typedef DeclarationStacks::FunctionStack FunctionStack;
</span><span class="cx"> 
</span><del>-        BytecodeGenerator(VM&amp;, ProgramNode*, UnlinkedProgramCodeBlock*, DebuggerMode, const VariableEnvironment*);
-        BytecodeGenerator(VM&amp;, FunctionNode*, UnlinkedFunctionCodeBlock*, DebuggerMode, const VariableEnvironment*);
-        BytecodeGenerator(VM&amp;, EvalNode*, UnlinkedEvalCodeBlock*, DebuggerMode, const VariableEnvironment*);
-        BytecodeGenerator(VM&amp;, ModuleProgramNode*, UnlinkedModuleProgramCodeBlock*, DebuggerMode, const VariableEnvironment*);
</del><ins>+        BytecodeGenerator(VM&amp;, ProgramNode*, UnlinkedProgramCodeBlock*, DebuggerMode, ProfilerMode, const VariableEnvironment*);
+        BytecodeGenerator(VM&amp;, FunctionNode*, UnlinkedFunctionCodeBlock*, DebuggerMode, ProfilerMode, const VariableEnvironment*);
+        BytecodeGenerator(VM&amp;, EvalNode*, UnlinkedEvalCodeBlock*, DebuggerMode, ProfilerMode, const VariableEnvironment*);
+        BytecodeGenerator(VM&amp;, ModuleProgramNode*, UnlinkedModuleProgramCodeBlock*, DebuggerMode, ProfilerMode, const VariableEnvironment*);
</ins><span class="cx"> 
</span><span class="cx">         ~BytecodeGenerator();
</span><span class="cx">         
</span><span class="lines">@@ -575,8 +577,8 @@
</span><span class="cx">         RegisterID* emitCall(RegisterID* dst, RegisterID* func, ExpectedFunction, CallArguments&amp;, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
</span><span class="cx">         RegisterID* emitCallInTailPosition(RegisterID* dst, RegisterID* func, ExpectedFunction, CallArguments&amp;, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
</span><span class="cx">         RegisterID* emitCallEval(RegisterID* dst, RegisterID* func, CallArguments&amp;, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
</span><del>-        RegisterID* emitCallVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
-        RegisterID* emitCallVarargsInTailPosition(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
</del><ins>+        RegisterID* emitCallVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
+        RegisterID* emitCallVarargsInTailPosition(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
</ins><span class="cx"> 
</span><span class="cx">         enum PropertyDescriptorOption {
</span><span class="cx">             PropertyConfigurable = 1,
</span><span class="lines">@@ -702,6 +704,7 @@
</span><span class="cx"> 
</span><span class="cx">         CodeType codeType() const { return m_codeType; }
</span><span class="cx"> 
</span><ins>+        bool shouldEmitProfileHooks() { return m_shouldEmitProfileHooks; }
</ins><span class="cx">         bool shouldEmitDebugHooks() { return m_shouldEmitDebugHooks; }
</span><span class="cx">         
</span><span class="cx">         bool isStrictMode() const { return m_codeBlock-&gt;isStrictMode(); }
</span><span class="lines">@@ -846,8 +849,8 @@
</span><span class="cx"> 
</span><span class="cx">         void getVariablesUnderTDZ(VariableEnvironment&amp;);
</span><span class="cx"> 
</span><del>-        RegisterID* emitConstructVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
-        RegisterID* emitCallVarargs(OpcodeID, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
</del><ins>+        RegisterID* emitConstructVarargs(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
+        RegisterID* emitCallVarargs(OpcodeID, RegisterID* dst, RegisterID* func, RegisterID* thisRegister, RegisterID* arguments, RegisterID* firstFreeRegister, int32_t firstVarArgOffset, RegisterID* profileHookRegister, const JSTextPosition&amp; divot, const JSTextPosition&amp; divotStart, const JSTextPosition&amp; divotEnd);
</ins><span class="cx">         
</span><span class="cx">         void emitLogShadowChickenPrologueIfNecessary();
</span><span class="cx">         void emitLogShadowChickenTailIfNecessary();
</span><span class="lines">@@ -869,6 +872,7 @@
</span><span class="cx">         Vector&lt;UnlinkedInstruction, 0, UnsafeVectorOverflow&gt; m_instructions;
</span><span class="cx"> 
</span><span class="cx">         bool m_shouldEmitDebugHooks;
</span><ins>+        bool m_shouldEmitProfileHooks;
</ins><span class="cx"> 
</span><span class="cx">         struct SymbolTableStackEntry {
</span><span class="cx">             SymbolTable* m_symbolTable;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -707,6 +707,9 @@
</span><span class="cx">     : m_argumentsNode(argumentsNode)
</span><span class="cx">     , m_padding(0)
</span><span class="cx"> {
</span><ins>+    if (generator.shouldEmitProfileHooks())
+        m_profileHookRegister = generator.newTemporary();
+
</ins><span class="cx">     size_t argumentCountIncludingThis = 1 + additionalArguments; // 'this' register.
</span><span class="cx">     if (argumentsNode) {
</span><span class="cx">         for (ArgumentListNode* node = argumentsNode-&gt;m_listNode; node; node = node-&gt;m_next)
</span><span class="lines">@@ -1018,13 +1021,16 @@
</span><span class="cx">     RefPtr&lt;RegisterID&gt; returnValue = generator.finalDestination(dst);
</span><span class="cx">     {
</span><span class="cx">         if (m_args-&gt;m_listNode &amp;&amp; m_args-&gt;m_listNode-&gt;m_expr &amp;&amp; m_args-&gt;m_listNode-&gt;m_expr-&gt;isSpreadExpression()) {
</span><ins>+            RefPtr&lt;RegisterID&gt; profileHookRegister;
+            if (generator.shouldEmitProfileHooks())
+                profileHookRegister = generator.newTemporary();
</ins><span class="cx">             SpreadExpressionNode* spread = static_cast&lt;SpreadExpressionNode*&gt;(m_args-&gt;m_listNode-&gt;m_expr);
</span><span class="cx">             ExpressionNode* subject = spread-&gt;expression();
</span><span class="cx">             RefPtr&lt;RegisterID&gt; argumentsRegister;
</span><span class="cx">             argumentsRegister = generator.emitNode(subject);
</span><span class="cx">             generator.emitExpressionInfo(spread-&gt;divot(), spread-&gt;divotStart(), spread-&gt;divotEnd());
</span><span class="cx">             RefPtr&lt;RegisterID&gt; thisRegister = generator.emitGetByVal(generator.newTemporary(), argumentsRegister.get(), generator.emitLoad(0, jsNumber(0)));
</span><del>-            generator.emitCallVarargsInTailPosition(returnValue.get(), base.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 1, divot(), divotStart(), divotEnd());
</del><ins>+            generator.emitCallVarargsInTailPosition(returnValue.get(), base.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 1, profileHookRegister.get(), divot(), divotStart(), divotEnd());
</ins><span class="cx">         } else if (m_args-&gt;m_listNode &amp;&amp; m_args-&gt;m_listNode-&gt;m_expr) {
</span><span class="cx">             ArgumentListNode* oldList = m_args-&gt;m_listNode;
</span><span class="cx">             m_args-&gt;m_listNode = m_args-&gt;m_listNode-&gt;m_next;
</span><span class="lines">@@ -1088,6 +1094,9 @@
</span><span class="cx">             ArgumentListNode* oldList = m_args-&gt;m_listNode;
</span><span class="cx">             if (m_args-&gt;m_listNode-&gt;m_expr-&gt;isSpreadExpression()) {
</span><span class="cx">                 SpreadExpressionNode* spread = static_cast&lt;SpreadExpressionNode*&gt;(m_args-&gt;m_listNode-&gt;m_expr);
</span><ins>+                RefPtr&lt;RegisterID&gt; profileHookRegister;
+                if (generator.shouldEmitProfileHooks())
+                    profileHookRegister = generator.newTemporary();
</ins><span class="cx">                 RefPtr&lt;RegisterID&gt; realFunction = generator.emitMove(generator.newTemporary(), base.get());
</span><span class="cx">                 RefPtr&lt;RegisterID&gt; index = generator.emitLoad(generator.newTemporary(), jsNumber(0));
</span><span class="cx">                 RefPtr&lt;RegisterID&gt; thisRegister = generator.emitLoad(generator.newTemporary(), jsUndefined());
</span><span class="lines">@@ -1111,7 +1120,7 @@
</span><span class="cx">                     generator.emitLabel(end.get());
</span><span class="cx">                 };
</span><span class="cx">                 generator.emitEnumeration(this, spread-&gt;expression(), extractor);
</span><del>-                generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 0, divot(), divotStart(), divotEnd());
</del><ins>+                generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argumentsRegister.get(), generator.newTemporary(), 0, profileHookRegister.get(), divot(), divotStart(), divotEnd());
</ins><span class="cx">             } else if (m_args-&gt;m_listNode-&gt;m_next) {
</span><span class="cx">                 ASSERT(m_args-&gt;m_listNode-&gt;m_next-&gt;m_expr-&gt;isSimpleArray());
</span><span class="cx">                 ASSERT(!m_args-&gt;m_listNode-&gt;m_next-&gt;m_next);
</span><span class="lines">@@ -1136,6 +1145,9 @@
</span><span class="cx">         }
</span><span class="cx">     } else {
</span><span class="cx">         ASSERT(m_args-&gt;m_listNode &amp;&amp; m_args-&gt;m_listNode-&gt;m_next);
</span><ins>+        RefPtr&lt;RegisterID&gt; profileHookRegister;
+        if (generator.shouldEmitProfileHooks())
+            profileHookRegister = generator.newTemporary();
</ins><span class="cx">         RefPtr&lt;RegisterID&gt; realFunction = generator.emitMove(generator.tempDestination(dst), base.get());
</span><span class="cx">         RefPtr&lt;RegisterID&gt; thisRegister = generator.emitNode(m_args-&gt;m_listNode-&gt;m_expr);
</span><span class="cx">         RefPtr&lt;RegisterID&gt; argsRegister;
</span><span class="lines">@@ -1147,7 +1159,7 @@
</span><span class="cx">         while ((args = args-&gt;m_next))
</span><span class="cx">             generator.emitNode(args-&gt;m_expr);
</span><span class="cx"> 
</span><del>-        generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), 0, divot(), divotStart(), divotEnd());
</del><ins>+        generator.emitCallVarargsInTailPosition(returnValue.get(), realFunction.get(), thisRegister.get(), argsRegister.get(), generator.newTemporary(), 0, profileHookRegister.get(), divot(), divotStart(), divotEnd());
</ins><span class="cx">     }
</span><span class="cx">     if (emitCallCheck) {
</span><span class="cx">         generator.emitJump(end.get());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGAbstractInterpreterInlinesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -2844,6 +2844,8 @@
</span><span class="cx">     case LogShadowChickenTail:
</span><span class="cx">         break;
</span><span class="cx"> 
</span><ins>+    case ProfileWillCall:
+    case ProfileDidCall:
</ins><span class="cx">     case ProfileType:
</span><span class="cx">     case ProfileControlFlow:
</span><span class="cx">     case Phantom:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGByteCodeParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -3799,6 +3799,16 @@
</span><span class="cx">             NEXT_OPCODE(op_debug);
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        case op_profile_will_call: {
+            addToGraph(ProfileWillCall);
+            NEXT_OPCODE(op_profile_will_call);
+        }
+
+        case op_profile_did_call: {
+            addToGraph(ProfileDidCall);
+            NEXT_OPCODE(op_profile_did_call);
+        }
+
</ins><span class="cx">         case op_mov: {
</span><span class="cx">             Node* op = get(VirtualRegister(currentInstruction[2].u.operand));
</span><span class="cx">             set(VirtualRegister(currentInstruction[1].u.operand), op);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGCapabilitiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGCapabilities.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -124,6 +124,8 @@
</span><span class="cx">     case op_mod:
</span><span class="cx">     case op_div:
</span><span class="cx">     case op_debug:
</span><ins>+    case op_profile_will_call:
+    case op_profile_did_call:
</ins><span class="cx">     case op_profile_type:
</span><span class="cx">     case op_profile_control_flow:
</span><span class="cx">     case op_mov:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGClobberizeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGClobberize.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGClobberize.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGClobberize.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -372,6 +372,8 @@
</span><span class="cx">     case CheckTierUpAtReturn:
</span><span class="cx">     case CheckTierUpAndOSREnter:
</span><span class="cx">     case LoopHint:
</span><ins>+    case ProfileWillCall:
+    case ProfileDidCall:
</ins><span class="cx">     case ProfileType:
</span><span class="cx">     case ProfileControlFlow:
</span><span class="cx">     case StoreBarrier:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGDoesGCcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -150,6 +150,8 @@
</span><span class="cx">     case ConstructForwardVarargs:
</span><span class="cx">     case TailCallForwardVarargs:
</span><span class="cx">     case TailCallForwardVarargsInlinedCaller:
</span><ins>+    case ProfileWillCall:
+    case ProfileDidCall:
</ins><span class="cx">     case ProfileType:
</span><span class="cx">     case ProfileControlFlow:
</span><span class="cx">     case OverridesHasInstance:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGFixupPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGFixupPhase.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1534,6 +1534,8 @@
</span><span class="cx">         case NewObject:
</span><span class="cx">         case NewArrayBuffer:
</span><span class="cx">         case NewRegexp:
</span><ins>+        case ProfileWillCall:
+        case ProfileDidCall:
</ins><span class="cx">         case DeleteById:
</span><span class="cx">         case DeleteByVal:
</span><span class="cx">         case IsArrayObject:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGNodeTypeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGNodeType.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGNodeType.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGNodeType.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -303,6 +303,8 @@
</span><span class="cx">     macro(MaterializeCreateActivation, NodeResultJS | NodeHasVarArgs) \
</span><span class="cx">     \
</span><span class="cx">     /* Nodes for misc operations. */\
</span><ins>+    macro(ProfileWillCall, NodeMustGenerate) \
+    macro(ProfileDidCall, NodeMustGenerate) \
</ins><span class="cx">     macro(OverridesHasInstance, NodeMustGenerate | NodeResultBoolean) \
</span><span class="cx">     macro(InstanceOf, NodeResultBoolean) \
</span><span class="cx">     macro(InstanceOfCustom, NodeMustGenerate | NodeResultBoolean) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGPredictionPropagationPhasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1035,6 +1035,8 @@
</span><span class="cx">         case DFG::Jump:
</span><span class="cx">         case Branch:
</span><span class="cx">         case Switch:
</span><ins>+        case ProfileWillCall:
+        case ProfileDidCall:
</ins><span class="cx">         case ProfileType:
</span><span class="cx">         case ProfileControlFlow:
</span><span class="cx">         case ThrowReferenceError:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSafeToExecuteh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -250,6 +250,8 @@
</span><span class="cx">     case NewArrayWithSize:
</span><span class="cx">     case NewArrayBuffer:
</span><span class="cx">     case NewRegexp:
</span><ins>+    case ProfileWillCall:
+    case ProfileDidCall:
</ins><span class="cx">     case ProfileType:
</span><span class="cx">     case ProfileControlFlow:
</span><span class="cx">     case CheckTypeInfoFlags:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJIT32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -5197,6 +5197,8 @@
</span><span class="cx">         noResult(node);
</span><span class="cx">         break;
</span><span class="cx"> 
</span><ins>+    case ProfileWillCall:
+    case ProfileDidCall:
</ins><span class="cx">     case PhantomLocal:
</span><span class="cx">     case LoopHint:
</span><span class="cx">         // This is a no-op.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredfgDFGSpeculativeJIT64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -4812,6 +4812,8 @@
</span><span class="cx">         noResult(node);
</span><span class="cx">         break;
</span><span class="cx">         
</span><ins>+    case ProfileWillCall:
+    case ProfileDidCall:
</ins><span class="cx">     case PhantomLocal:
</span><span class="cx">     case LoopHint:
</span><span class="cx">         // This is a no-op.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptBase.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;InspectorValues.h&quot;
</span><span class="cx"> #include &quot;JSCInlines.h&quot;
</span><span class="cx"> #include &quot;JSGlobalObject.h&quot;
</span><ins>+#include &quot;LegacyProfiler.h&quot;
</ins><span class="cx"> #include &quot;ScriptFunctionCall.h&quot;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -71,8 +72,17 @@
</span><span class="cx"> JSC::JSValue InjectedScriptBase::callFunctionWithEvalEnabled(Deprecated::ScriptFunctionCall&amp; function, bool&amp; hadException) const
</span><span class="cx"> {
</span><span class="cx">     JSC::ExecState* scriptState = m_injectedScriptObject.scriptState();
</span><del>-    JSC::DebuggerEvalEnabler evalEnabler(scriptState);
-    return function.call(hadException);
</del><ins>+    JSC::LegacyProfiler::profiler()-&gt;suspendProfiling(scriptState);
+
+    JSC::JSValue resultValue;
+    {
+        JSC::DebuggerEvalEnabler evalEnabler(scriptState);
+        resultValue = function.call(hadException);
+    }
+
+    JSC::LegacyProfiler::profiler()-&gt;unsuspendProfiling(scriptState);
+
+    return resultValue;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InjectedScriptBase::makeCall(Deprecated::ScriptFunctionCall&amp; function, RefPtr&lt;InspectorValue&gt;* result)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolTimelinejson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/inspector/protocol/Timeline.json        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -51,6 +51,40 @@
</span><span class="cx">                 { &quot;name&quot;: &quot;data&quot;, &quot;type&quot;: &quot;object&quot;, &quot;description&quot;: &quot;Event data.&quot; },
</span><span class="cx">                 { &quot;name&quot;: &quot;children&quot;, &quot;type&quot;: &quot;array&quot;, &quot;optional&quot;: true, &quot;items&quot;: { &quot;$ref&quot;: &quot;TimelineEvent&quot; }, &quot;description&quot;: &quot;Nested records.&quot; }
</span><span class="cx">             ]
</span><ins>+        },
+        {
+            &quot;id&quot;: &quot;CPUProfileNodeAggregateCallInfo&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;Aggregate CPU Profile call info. Holds time information for all the calls that happened on a node.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;callCount&quot;, &quot;type&quot;: &quot;number&quot;, &quot;description&quot;: &quot;Total number of calls.&quot; },
+                { &quot;name&quot;: &quot;startTime&quot;, &quot;type&quot;: &quot;number&quot;, &quot;description&quot;: &quot;Start time for the first call.&quot; },
+                { &quot;name&quot;: &quot;endTime&quot;, &quot;type&quot;: &quot;number&quot;, &quot;description&quot;: &quot;End time for the last call.&quot; },
+                { &quot;name&quot;: &quot;totalTime&quot;, &quot;type&quot;: &quot;number&quot;, &quot;description&quot;: &quot;Total execution time for all calls combined.&quot; }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;CPUProfileNode&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;CPU Profile node. Holds callsite information, execution statistics and child nodes.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;id&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;description&quot;: &quot;Unique identifier for this call site.&quot; },
+                { &quot;name&quot;: &quot;callInfo&quot;, &quot;$ref&quot;: &quot;CPUProfileNodeAggregateCallInfo&quot;, &quot;description&quot;: &quot;Aggregate info about all the calls that making up this node.&quot; },
+                { &quot;name&quot;: &quot;functionName&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Function name.&quot; },
+                { &quot;name&quot;: &quot;url&quot;, &quot;type&quot;: &quot;string&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;URL.&quot; },
+                { &quot;name&quot;: &quot;lineNumber&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Line number.&quot; },
+                { &quot;name&quot;: &quot;columnNumber&quot;, &quot;type&quot;: &quot;integer&quot;, &quot;optional&quot;: true, &quot;description&quot;: &quot;Column number.&quot; },
+                { &quot;name&quot;: &quot;children&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;$ref&quot;: &quot;CPUProfileNode&quot; }, &quot;optional&quot;: true, &quot;description&quot;: &quot;Child nodes.&quot; }
+            ]
+        },
+        {
+            &quot;id&quot;: &quot;CPUProfile&quot;,
+            &quot;type&quot;: &quot;object&quot;,
+            &quot;description&quot;: &quot;Profile.&quot;,
+            &quot;properties&quot;: [
+                { &quot;name&quot;: &quot;rootNodes&quot;, &quot;type&quot;: &quot;array&quot;, &quot;items&quot;: { &quot;$ref&quot;: &quot;CPUProfileNode&quot; }, &quot;description&quot;: &quot;Top level nodes in the stack.&quot; },
+                { &quot;name&quot;: &quot;idleTime&quot;, &quot;type&quot;: &quot;number&quot;, &quot;optional&quot;: true }
+            ]
</ins><span class="cx">         }
</span><span class="cx">     ],
</span><span class="cx">     &quot;commands&quot;: [
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinterpreterInterpretercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> #include &quot;JSWithScope.h&quot;
</span><span class="cx"> #include &quot;LLIntCLoop.h&quot;
</span><span class="cx"> #include &quot;LLIntThunks.h&quot;
</span><ins>+#include &quot;LegacyProfiler.h&quot;
</ins><span class="cx"> #include &quot;LiteralParser.h&quot;
</span><span class="cx"> #include &quot;ObjectPrototype.h&quot;
</span><span class="cx"> #include &quot;Parser.h&quot;
</span><span class="lines">@@ -674,6 +675,7 @@
</span><span class="cx">     StackVisitor::Status operator()(StackVisitor&amp; visitor) const
</span><span class="cx">     {
</span><span class="cx">         visitor.unwindToMachineCodeBlockFrame();
</span><ins>+        VM&amp; vm = m_callFrame-&gt;vm();
</ins><span class="cx">         m_callFrame = visitor-&gt;callFrame();
</span><span class="cx">         m_codeBlock = visitor-&gt;codeBlock();
</span><span class="cx"> 
</span><span class="lines">@@ -690,6 +692,9 @@
</span><span class="cx"> 
</span><span class="cx">         bool shouldStopUnwinding = visitor-&gt;callerIsVMEntryFrame();
</span><span class="cx">         if (shouldStopUnwinding) {
</span><ins>+            if (LegacyProfiler* profiler = vm.enabledProfiler())
+                profiler-&gt;exceptionUnwind(m_callFrame);
+
</ins><span class="cx">             copyCalleeSavesToVMEntryFrameCalleeSavesBuffer(visitor);
</span><span class="cx"> 
</span><span class="cx">             return StackVisitor::Done;
</span><span class="lines">@@ -949,9 +954,15 @@
</span><span class="cx">     ProtoCallFrame protoCallFrame;
</span><span class="cx">     protoCallFrame.init(codeBlock, JSCallee::create(vm, scope-&gt;globalObject(), scope), thisObj, 1);
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;willExecute(callFrame, program-&gt;sourceURL(), program-&gt;firstLine(), program-&gt;startColumn());
+
</ins><span class="cx">     // Execute the code:
</span><span class="cx">     JSValue result = program-&gt;generatedJITCode()-&gt;execute(&amp;vm, &amp;protoCallFrame);
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;didExecute(callFrame, program-&gt;sourceURL(), program-&gt;firstLine(), program-&gt;startColumn());
+
</ins><span class="cx">     return checkedReturn(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1000,6 +1011,9 @@
</span><span class="cx">     ProtoCallFrame protoCallFrame;
</span><span class="cx">     protoCallFrame.init(newCodeBlock, function, thisValue, argsCount, args.data());
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;willExecute(callFrame, function);
+
</ins><span class="cx">     JSValue result;
</span><span class="cx">     {
</span><span class="cx">         // Execute the code:
</span><span class="lines">@@ -1012,6 +1026,9 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;didExecute(callFrame, function);
+
</ins><span class="cx">     return checkedReturn(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1062,6 +1079,9 @@
</span><span class="cx">     ProtoCallFrame protoCallFrame;
</span><span class="cx">     protoCallFrame.init(newCodeBlock, constructor, newTarget, argsCount, args.data());
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;willExecute(callFrame, constructor);
+
</ins><span class="cx">     JSValue result;
</span><span class="cx">     {
</span><span class="cx">         // Execute the code.
</span><span class="lines">@@ -1075,6 +1095,9 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;didExecute(callFrame, constructor);
+
</ins><span class="cx">     if (callFrame-&gt;hadException())
</span><span class="cx">         return 0;
</span><span class="cx">     ASSERT(result.isObject());
</span><span class="lines">@@ -1117,12 +1140,18 @@
</span><span class="cx"> 
</span><span class="cx">     StackStats::CheckPoint stackCheckPoint;
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;willExecute(closure.oldCallFrame, closure.function);
+
</ins><span class="cx">     if (UNLIKELY(vm.shouldTriggerTermination(closure.oldCallFrame)))
</span><span class="cx">         return throwTerminatedExecutionException(closure.oldCallFrame);
</span><span class="cx"> 
</span><span class="cx">     // Execute the code:
</span><span class="cx">     JSValue result = closure.functionExecutable-&gt;generatedJITCodeForCall()-&gt;execute(&amp;vm, closure.protoCallFrame);
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;didExecute(closure.oldCallFrame, closure.function);
+
</ins><span class="cx">     return checkedReturn(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1220,9 +1249,15 @@
</span><span class="cx">     ProtoCallFrame protoCallFrame;
</span><span class="cx">     protoCallFrame.init(codeBlock, JSCallee::create(vm, scope-&gt;globalObject(), scope), thisValue, 1);
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;willExecute(callFrame, eval-&gt;sourceURL(), eval-&gt;firstLine(), eval-&gt;startColumn());
+
</ins><span class="cx">     // Execute the code:
</span><span class="cx">     JSValue result = eval-&gt;generatedJITCode()-&gt;execute(&amp;vm, &amp;protoCallFrame);
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;didExecute(callFrame, eval-&gt;sourceURL(), eval-&gt;firstLine(), eval-&gt;startColumn());
+
</ins><span class="cx">     return checkedReturn(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1257,9 +1292,15 @@
</span><span class="cx">     ProtoCallFrame protoCallFrame;
</span><span class="cx">     protoCallFrame.init(codeBlock, JSCallee::create(vm, scope-&gt;globalObject(), scope), jsUndefined(), 1);
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;willExecute(callFrame, executable-&gt;sourceURL(), executable-&gt;firstLine(), executable-&gt;startColumn());
+
</ins><span class="cx">     // Execute the code:
</span><span class="cx">     JSValue result = executable-&gt;generatedJITCode()-&gt;execute(&amp;vm, &amp;protoCallFrame);
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;didExecute(callFrame, executable-&gt;sourceURL(), executable-&gt;firstLine(), executable-&gt;startColumn());
+
</ins><span class="cx">     return checkedReturn(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JIT.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JIT.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/jit/JIT.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -290,6 +290,8 @@
</span><span class="cx">         DEFINE_OP(op_nstricteq)
</span><span class="cx">         DEFINE_OP(op_dec)
</span><span class="cx">         DEFINE_OP(op_inc)
</span><ins>+        DEFINE_OP(op_profile_did_call)
+        DEFINE_OP(op_profile_will_call)
</ins><span class="cx">         DEFINE_OP(op_profile_type)
</span><span class="cx">         DEFINE_OP(op_profile_control_flow)
</span><span class="cx">         DEFINE_OP(op_push_with_scope)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JIT.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JIT.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/jit/JIT.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -560,6 +560,8 @@
</span><span class="cx">         void emit_op_nstricteq(Instruction*);
</span><span class="cx">         void emit_op_dec(Instruction*);
</span><span class="cx">         void emit_op_inc(Instruction*);
</span><ins>+        void emit_op_profile_did_call(Instruction*);
+        void emit_op_profile_will_call(Instruction*);
</ins><span class="cx">         void emit_op_profile_type(Instruction*);
</span><span class="cx">         void emit_op_profile_control_flow(Instruction*);
</span><span class="cx">         void emit_op_push_with_scope(Instruction*);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -774,7 +774,23 @@
</span><span class="cx">     slowPathCall.call();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void JIT::emit_op_profile_will_call(Instruction* currentInstruction)
+{
+    Jump profilerDone = branchTestPtr(Zero, AbsoluteAddress(m_vm-&gt;enabledProfilerAddress()));
+    emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
+    callOperation(operationProfileWillCall, regT0);
+    profilerDone.link(this);
+}
</ins><span class="cx"> 
</span><ins>+void JIT::emit_op_profile_did_call(Instruction* currentInstruction)
+{
+    Jump profilerDone = branchTestPtr(Zero, AbsoluteAddress(m_vm-&gt;enabledProfilerAddress()));
+    emitGetVirtualRegister(currentInstruction[1].u.operand, regT0);
+    callOperation(operationProfileDidCall, regT0);
+    profilerDone.link(this);
+}
+
+
</ins><span class="cx"> // Slow cases
</span><span class="cx"> 
</span><span class="cx"> void JIT::emitSlow_op_to_this(Instruction* currentInstruction, Vector&lt;SlowCaseEntry&gt;::iterator&amp; iter)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOpcodes32_64cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1060,6 +1060,24 @@
</span><span class="cx">     slowPathCall.call();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void JIT::emit_op_profile_will_call(Instruction* currentInstruction)
+{
+    load32(m_vm-&gt;enabledProfilerAddress(), regT0);
+    Jump profilerDone = branchTestPtr(Zero, regT0);
+    emitLoad(currentInstruction[1].u.operand, regT1, regT0);
+    callOperation(operationProfileWillCall, regT1, regT0);
+    profilerDone.link(this);
+}
+
+void JIT::emit_op_profile_did_call(Instruction* currentInstruction)
+{
+    load32(m_vm-&gt;enabledProfilerAddress(), regT0);
+    Jump profilerDone = branchTestPtr(Zero, regT0);
+    emitLoad(currentInstruction[1].u.operand, regT1, regT0);
+    callOperation(operationProfileDidCall, regT1, regT0);
+    profilerDone.link(this);
+}
+
</ins><span class="cx"> void JIT::emit_op_has_structure_property(Instruction* currentInstruction)
</span><span class="cx"> {
</span><span class="cx">     int dst = currentInstruction[1].u.operand;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> #include &quot;JSPropertyNameEnumerator.h&quot;
</span><span class="cx"> #include &quot;JSStackInlines.h&quot;
</span><span class="cx"> #include &quot;JSWithScope.h&quot;
</span><ins>+#include &quot;LegacyProfiler.h&quot;
</ins><span class="cx"> #include &quot;ObjectConstructor.h&quot;
</span><span class="cx"> #include &quot;PolymorphicAccess.h&quot;
</span><span class="cx"> #include &quot;PropertyName.h&quot;
</span><span class="lines">@@ -1241,6 +1242,12 @@
</span><span class="cx">         return encodeResult(0, 0);
</span><span class="cx">     }
</span><span class="cx">     
</span><ins>+    if (vm.enabledProfiler()) {
+        CODEBLOCK_LOG_EVENT(codeBlock, &quot;delayOptimizeToDFG&quot;, (&quot;profiler is enabled&quot;));
+        updateAllPredictionsAndOptimizeAfterWarmUp(codeBlock);
+        return encodeResult(0, 0);
+    }
+
</ins><span class="cx">     Debugger* debugger = codeBlock-&gt;globalObject()-&gt;debugger();
</span><span class="cx">     if (debugger &amp;&amp; (debugger-&gt;isStepping() || codeBlock-&gt;baselineAlternative()-&gt;hasDebuggerRequests())) {
</span><span class="cx">         CODEBLOCK_LOG_EVENT(codeBlock, &quot;delayOptimizeToDFG&quot;, (&quot;debugger is stepping or has requests&quot;));
</span><span class="lines">@@ -1552,6 +1559,24 @@
</span><span class="cx">     exec-&gt;uncheckedR(scopeReg) = scope-&gt;next();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void JIT_OPERATION operationProfileDidCall(ExecState* exec, EncodedJSValue encodedValue)
+{
+    VM&amp; vm = exec-&gt;vm();
+    NativeCallFrameTracer tracer(&amp;vm, exec);
+
+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;didExecute(exec, JSValue::decode(encodedValue));
+}
+
+void JIT_OPERATION operationProfileWillCall(ExecState* exec, EncodedJSValue encodedValue)
+{
+    VM&amp; vm = exec-&gt;vm();
+    NativeCallFrameTracer tracer(&amp;vm, exec);
+
+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;willExecute(exec, JSValue::decode(encodedValue));
+}
+
</ins><span class="cx"> int32_t JIT_OPERATION operationInstanceOfCustom(ExecState* exec, EncodedJSValue encodedValue, JSObject* constructor, EncodedJSValue encodedHasInstance)
</span><span class="cx"> {
</span><span class="cx">     VM&amp; vm = exec-&gt;vm();
</span><span class="lines">@@ -2333,6 +2358,9 @@
</span><span class="cx">     NativeCallFrameTracer tracer(&amp;vm, exec);
</span><span class="cx">     RELEASE_ASSERT(!!vm.exception());
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;exceptionUnwind(exec);
+
</ins><span class="cx">     if (isTerminatedExecutionException(vm.exception())) {
</span><span class="cx">         genericUnwind(&amp;vm, exec);
</span><span class="cx">         return 1;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejitJITOperationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jit/JITOperations.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jit/JITOperations.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/jit/JITOperations.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -370,6 +370,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> void JIT_OPERATION operationPushFunctionNameScope(ExecState*, int32_t, SymbolTable*, EncodedJSValue) WTF_INTERNAL;
</span><span class="cx"> void JIT_OPERATION operationPopScope(ExecState*, int32_t) WTF_INTERNAL;
</span><ins>+void JIT_OPERATION operationProfileDidCall(ExecState*, EncodedJSValue) WTF_INTERNAL;
+void JIT_OPERATION operationProfileWillCall(ExecState*, EncodedJSValue) WTF_INTERNAL;
</ins><span class="cx"> EncodedJSValue JIT_OPERATION operationGetByValOptimize(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript, ByValInfo*) WTF_INTERNAL;
</span><span class="cx"> EncodedJSValue JIT_OPERATION operationGetByValGeneric(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript, ByValInfo*) WTF_INTERNAL;
</span><span class="cx"> EncodedJSValue JIT_OPERATION operationGetByValString(ExecState*, EncodedJSValue encodedBase, EncodedJSValue encodedSubscript, ByValInfo*) WTF_INTERNAL;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorejsccpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/jsc.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/jsc.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/jsc.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -864,7 +864,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo GlobalObject::s_info = { &quot;global&quot;, &amp;JSGlobalObject::s_info, nullptr, CREATE_METHOD_TABLE(GlobalObject) };
</span><del>-const GlobalObjectMethodTable GlobalObject::s_globalObjectMethodTable = { &amp;allowsAccessFrom, &amp;supportsRichSourceInfo, &amp;shouldInterruptScript, &amp;javaScriptRuntimeFlags, 0, &amp;shouldInterruptScriptBeforeTimeout, &amp;moduleLoaderResolve, &amp;moduleLoaderFetch, nullptr, nullptr, nullptr, nullptr };
</del><ins>+const GlobalObjectMethodTable GlobalObject::s_globalObjectMethodTable = { &amp;allowsAccessFrom, &amp;supportsLegacyProfiling, &amp;supportsRichSourceInfo, &amp;shouldInterruptScript, &amp;javaScriptRuntimeFlags, 0, &amp;shouldInterruptScriptBeforeTimeout, &amp;moduleLoaderResolve, &amp;moduleLoaderFetch, nullptr, nullptr, nullptr, nullptr };
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> GlobalObject::GlobalObject(VM&amp; vm, Structure* structure)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -50,6 +50,7 @@
</span><span class="cx"> #include &quot;JSWithScope.h&quot;
</span><span class="cx"> #include &quot;LLIntCommon.h&quot;
</span><span class="cx"> #include &quot;LLIntExceptions.h&quot;
</span><ins>+#include &quot;LegacyProfiler.h&quot;
</ins><span class="cx"> #include &quot;LowLevelInterpreter.h&quot;
</span><span class="cx"> #include &quot;ObjectConstructor.h&quot;
</span><span class="cx"> #include &quot;ProtoCallFrame.h&quot;
</span><span class="lines">@@ -1425,6 +1426,22 @@
</span><span class="cx">     LLINT_END();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+LLINT_SLOW_PATH_DECL(slow_path_profile_will_call)
+{
+    LLINT_BEGIN();
+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;willExecute(exec, LLINT_OP(1).jsValue());
+    LLINT_END();
+}
+
+LLINT_SLOW_PATH_DECL(slow_path_profile_did_call)
+{
+    LLINT_BEGIN();
+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;didExecute(exec, LLINT_OP(1).jsValue());
+    LLINT_END();
+}
+
</ins><span class="cx"> LLINT_SLOW_PATH_DECL(slow_path_handle_exception)
</span><span class="cx"> {
</span><span class="cx">     LLINT_BEGIN_NO_SET_PC();
</span><span class="lines">@@ -1513,6 +1530,9 @@
</span><span class="cx">     LLINT_BEGIN();
</span><span class="cx">     RELEASE_ASSERT(!!vm.exception());
</span><span class="cx"> 
</span><ins>+    if (LegacyProfiler* profiler = vm.enabledProfiler())
+        profiler-&gt;exceptionUnwind(exec);
+
</ins><span class="cx">     if (isTerminatedExecutionException(vm.exception()))
</span><span class="cx">         LLINT_RETURN_TWO(pc, bitwise_cast&lt;void*&gt;(static_cast&lt;uintptr_t&gt;(1)));
</span><span class="cx">     LLINT_RETURN_TWO(pc, 0);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLLIntSlowPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/llint/LLIntSlowPaths.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -117,6 +117,8 @@
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_throw_static_error);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_watchdog_timer);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_debug);
</span><ins>+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_will_call);
+LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_profile_did_call);
</ins><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_handle_exception);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_get_from_scope);
</span><span class="cx"> LLINT_SLOW_PATH_HIDDEN_DECL(slow_path_put_to_scope);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorellintLowLevelInterpreterasm"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/llint/LowLevelInterpreter.asm        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1662,6 +1662,28 @@
</span><span class="cx">     dispatch(3)
</span><span class="cx"> 
</span><span class="cx"> 
</span><ins>+_llint_op_profile_will_call:
+    traceExecution()
+    loadp CodeBlock[cfr], t0
+    loadp CodeBlock::m_vm[t0], t0
+    loadi VM::m_enabledProfiler[t0], t0
+    btpz t0, .opProfilerWillCallDone
+    callSlowPath(_llint_slow_path_profile_will_call)
+.opProfilerWillCallDone:
+    dispatch(2)
+
+
+_llint_op_profile_did_call:
+    traceExecution()
+    loadp CodeBlock[cfr], t0
+    loadp CodeBlock::m_vm[t0], t0
+    loadi VM::m_enabledProfiler[t0], t0
+    btpz t0, .opProfilerDidCallDone
+    callSlowPath(_llint_slow_path_profile_did_call)
+.opProfilerDidCallDone:
+    dispatch(2)
+
+
</ins><span class="cx"> _llint_op_debug:
</span><span class="cx">     traceExecution()
</span><span class="cx">     loadp CodeBlock[cfr], t0
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreparserParserModesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/parser/ParserModes.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/parser/ParserModes.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/parser/ParserModes.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> enum class SuperBinding { Needed, NotNeeded };
</span><span class="cx"> enum class ThisTDZMode { AlwaysCheck, CheckIfNeeded };
</span><span class="cx"> 
</span><ins>+enum ProfilerMode { ProfilerOff, ProfilerOn };
</ins><span class="cx"> enum DebuggerMode { DebuggerOff, DebuggerOn };
</span><span class="cx"> 
</span><span class="cx"> enum class FunctionMode { FunctionExpression, FunctionDeclaration, MethodDefinition };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerCallIdentifierh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/CallIdentifier.h (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/CallIdentifier.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/CallIdentifier.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,112 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2014 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+#ifndef CallIdentifier_h
+#define CallIdentifier_h
+
+#include &lt;wtf/text/CString.h&gt;
+#include &lt;wtf/text/StringHash.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace JSC {
+
+    struct CallIdentifier {
+        WTF_MAKE_FAST_ALLOCATED;
+    public:
+        CallIdentifier()
+            : m_lineNumber(0)
+            , m_columnNumber(0)
+        {
+        }
+
+        CallIdentifier(const String&amp; functionName, const String&amp; url, unsigned lineNumber, unsigned columnNumber)
+            : m_functionName(functionName)
+            , m_url(!url.isNull() ? url : &quot;&quot;)
+            , m_lineNumber(lineNumber)
+            , m_columnNumber(columnNumber)
+        {
+        }
+
+        const String&amp; functionName() const { return m_functionName; }
+
+        const String&amp; url() const { return m_url; }
+        unsigned lineNumber() const { return m_lineNumber; }
+        unsigned columnNumber() const { return m_columnNumber; }
+
+        inline bool operator==(const CallIdentifier&amp; other) const { return other.m_lineNumber == m_lineNumber &amp;&amp; other.m_columnNumber == m_columnNumber &amp;&amp; other.m_functionName == m_functionName &amp;&amp; other.m_url == m_url; }
+        inline bool operator!=(const CallIdentifier&amp; other) const { return !(*this == other); }
+
+        struct Hash {
+            static unsigned hash(const CallIdentifier&amp; key)
+            {
+                unsigned hashCodes[4] = {
+                    key.m_functionName.impl()-&gt;hash(),
+                    key.m_url.impl()-&gt;hash(),
+                    key.m_lineNumber,
+                    key.m_columnNumber
+                };
+                return StringHasher::hashMemory&lt;sizeof(hashCodes)&gt;(hashCodes);
+            }
+
+            static bool equal(const CallIdentifier&amp; a, const CallIdentifier&amp; b) { return a == b; }
+            static const bool safeToCompareToEmptyOrDeleted = true;
+        };
+
+        unsigned hash() const { return Hash::hash(*this); }
+
+#ifndef NDEBUG
+        operator const char*() const { return c_str(); }
+        const char* c_str() const { return m_functionName.utf8().data(); }
+#endif
+
+    private:
+        String m_functionName;
+        String m_url;
+        unsigned m_lineNumber;
+        unsigned m_columnNumber;
+    };
+
+} // namespace JSC
+
+namespace WTF {
+
+    template&lt;&gt; struct DefaultHash&lt;JSC::CallIdentifier&gt; { typedef JSC::CallIdentifier::Hash Hash; };
+
+    template&lt;&gt; struct HashTraits&lt;JSC::CallIdentifier&gt; : GenericHashTraits&lt;JSC::CallIdentifier&gt; {
+        static void constructDeletedValue(JSC::CallIdentifier&amp; slot)
+        {
+            new (NotNull, &amp;slot) JSC::CallIdentifier(String(), String(), std::numeric_limits&lt;unsigned&gt;::max(), std::numeric_limits&lt;unsigned&gt;::max());
+        }
+
+        static bool isDeletedValue(const JSC::CallIdentifier&amp; value)
+        {
+            return value.functionName().isNull() &amp;&amp; value.url().isNull() &amp;&amp; value.lineNumber() == std::numeric_limits&lt;unsigned&gt;::max() &amp;&amp; value.columnNumber() == std::numeric_limits&lt;unsigned&gt;::max();
+        }
+    };
+
+} // namespace WTF
+
+#endif  // CallIdentifier_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerLegacyProfilercpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/LegacyProfiler.cpp (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/LegacyProfiler.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/LegacyProfiler.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,208 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2012, 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;LegacyProfiler.h&quot;
+
+#include &quot;CallFrame.h&quot;
+#include &quot;CodeBlock.h&quot;
+#include &quot;CommonIdentifiers.h&quot;
+#include &quot;InternalFunction.h&quot;
+#include &quot;JSFunction.h&quot;
+#include &quot;JSGlobalObject.h&quot;
+#include &quot;Nodes.h&quot;
+#include &quot;JSCInlines.h&quot;
+#include &quot;Profile.h&quot;
+#include &quot;ProfileGenerator.h&quot;
+#include &quot;ProfileNode.h&quot;
+
+namespace JSC {
+
+static const char* GlobalCodeExecution = &quot;(program)&quot;;
+static const char* AnonymousFunction = &quot;(anonymous function)&quot;;
+static unsigned ProfilesUID = 0;
+
+static CallIdentifier createCallIdentifierFromFunctionImp(ExecState*, JSObject*, const String&amp; defaultSourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber);
+
+LegacyProfiler* LegacyProfiler::s_sharedLegacyProfiler = nullptr;
+
+LegacyProfiler* LegacyProfiler::profiler()
+{
+    if (!s_sharedLegacyProfiler)
+        s_sharedLegacyProfiler = new LegacyProfiler();
+    return s_sharedLegacyProfiler;
+}
+
+void LegacyProfiler::startProfiling(ExecState* exec, const String&amp; title, PassRefPtr&lt;Stopwatch&gt; stopwatch)
+{
+    if (!exec)
+        return;
+
+    // Check if we currently have a Profile for this global ExecState and title.
+    // If so return early and don't create a new Profile.
+    JSGlobalObject* origin = exec-&gt;lexicalGlobalObject();
+
+    for (size_t i = 0; i &lt; m_currentProfiles.size(); ++i) {
+        ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
+        if (profileGenerator-&gt;origin() == origin &amp;&amp; profileGenerator-&gt;title() == title)
+            return;
+    }
+
+    exec-&gt;vm().setEnabledProfiler(this);
+    RefPtr&lt;ProfileGenerator&gt; profileGenerator = ProfileGenerator::create(exec, title, ++ProfilesUID, stopwatch);
+    m_currentProfiles.append(profileGenerator);
+}
+
+RefPtr&lt;Profile&gt; LegacyProfiler::stopProfiling(ExecState* exec, const String&amp; title)
+{
+    if (!exec)
+        return nullptr;
+
+    JSGlobalObject* origin = exec-&gt;lexicalGlobalObject();
+    for (ptrdiff_t i = m_currentProfiles.size() - 1; i &gt;= 0; --i) {
+        ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
+        if (profileGenerator-&gt;origin() == origin &amp;&amp; (title.isNull() || profileGenerator-&gt;title() == title)) {
+            profileGenerator-&gt;stopProfiling();
+            RefPtr&lt;Profile&gt; returnProfile = profileGenerator-&gt;profile();
+
+            m_currentProfiles.remove(i);
+            if (!m_currentProfiles.size())
+                exec-&gt;vm().setEnabledProfiler(nullptr);
+
+            return returnProfile;
+        }
+    }
+
+    return nullptr;
+}
+
+void LegacyProfiler::stopProfiling(JSGlobalObject* origin)
+{
+    for (ptrdiff_t i = m_currentProfiles.size() - 1; i &gt;= 0; --i) {
+        ProfileGenerator* profileGenerator = m_currentProfiles[i].get();
+        if (profileGenerator-&gt;origin() == origin) {
+            profileGenerator-&gt;stopProfiling();
+            m_currentProfiles.remove(i);
+            if (!m_currentProfiles.size())
+                origin-&gt;vm().setEnabledProfiler(nullptr);
+        }
+    }
+}
+
+static inline void callFunctionForProfilesWithGroup(std::function&lt;void(ProfileGenerator*)&gt; callback, const Vector&lt;RefPtr&lt;ProfileGenerator&gt;&gt;&amp; profiles, unsigned targetProfileGroup)
+{
+    for (const RefPtr&lt;ProfileGenerator&gt;&amp; profile : profiles) {
+        if (profile-&gt;profileGroup() == targetProfileGroup || !profile-&gt;origin())
+            callback(profile.get());
+    }
+}
+
+void LegacyProfiler::suspendProfiling(JSC::ExecState* exec)
+{
+    if (!exec)
+        return;
+
+    callFunctionForProfilesWithGroup(std::bind(&amp;ProfileGenerator::setIsSuspended, std::placeholders::_1, true), m_currentProfiles, exec-&gt;lexicalGlobalObject()-&gt;profileGroup());
+}
+
+void LegacyProfiler::unsuspendProfiling(JSC::ExecState* exec)
+{
+    if (!exec)
+        return;
+
+    callFunctionForProfilesWithGroup(std::bind(&amp;ProfileGenerator::setIsSuspended, std::placeholders::_1, false), m_currentProfiles, exec-&gt;lexicalGlobalObject()-&gt;profileGroup());
+}
+
+void LegacyProfiler::willExecute(ExecState* callerCallFrame, JSValue function)
+{
+    ASSERT(!m_currentProfiles.isEmpty());
+
+    CallIdentifier callIdentifier = createCallIdentifier(callerCallFrame, function, StringImpl::empty(), 0, 0);
+
+    callFunctionForProfilesWithGroup(std::bind(&amp;ProfileGenerator::willExecute, std::placeholders::_1, callerCallFrame, callIdentifier), m_currentProfiles, callerCallFrame-&gt;lexicalGlobalObject()-&gt;profileGroup());
+}
+
+void LegacyProfiler::willExecute(ExecState* callerCallFrame, const String&amp; sourceURL, unsigned startingLineNumber, unsigned startingColumnNumber)
+{
+    ASSERT(!m_currentProfiles.isEmpty());
+
+    CallIdentifier callIdentifier = createCallIdentifier(callerCallFrame, JSValue(), sourceURL, startingLineNumber, startingColumnNumber);
+
+    callFunctionForProfilesWithGroup(std::bind(&amp;ProfileGenerator::willExecute, std::placeholders::_1, callerCallFrame, callIdentifier), m_currentProfiles, callerCallFrame-&gt;lexicalGlobalObject()-&gt;profileGroup());
+}
+
+void LegacyProfiler::didExecute(ExecState* callerCallFrame, JSValue function)
+{
+    ASSERT(!m_currentProfiles.isEmpty());
+
+    CallIdentifier callIdentifier = createCallIdentifier(callerCallFrame, function, StringImpl::empty(), 0, 0);
+
+    callFunctionForProfilesWithGroup(std::bind(&amp;ProfileGenerator::didExecute, std::placeholders::_1, callerCallFrame, callIdentifier), m_currentProfiles, callerCallFrame-&gt;lexicalGlobalObject()-&gt;profileGroup());
+}
+
+void LegacyProfiler::didExecute(ExecState* callerCallFrame, const String&amp; sourceURL, unsigned startingLineNumber, unsigned startingColumnNumber)
+{
+    ASSERT(!m_currentProfiles.isEmpty());
+
+    CallIdentifier callIdentifier = createCallIdentifier(callerCallFrame, JSValue(), sourceURL, startingLineNumber, startingColumnNumber);
+
+    callFunctionForProfilesWithGroup(std::bind(&amp;ProfileGenerator::didExecute, std::placeholders::_1, callerCallFrame, callIdentifier), m_currentProfiles, callerCallFrame-&gt;lexicalGlobalObject()-&gt;profileGroup());
+}
+
+void LegacyProfiler::exceptionUnwind(ExecState* handlerCallFrame)
+{
+    ASSERT(!m_currentProfiles.isEmpty());
+
+    CallIdentifier callIdentifier = createCallIdentifier(handlerCallFrame, JSValue(), StringImpl::empty(), 0, 0);
+
+    callFunctionForProfilesWithGroup(std::bind(&amp;ProfileGenerator::exceptionUnwind, std::placeholders::_1, handlerCallFrame, callIdentifier), m_currentProfiles, handlerCallFrame-&gt;lexicalGlobalObject()-&gt;profileGroup());
+}
+
+CallIdentifier LegacyProfiler::createCallIdentifier(ExecState* exec, JSValue functionValue, const String&amp; defaultSourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber)
+{
+    if (!functionValue)
+        return CallIdentifier(ASCIILiteral(GlobalCodeExecution), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
+    if (!functionValue.isObject())
+        return CallIdentifier(ASCIILiteral(&quot;(unknown)&quot;), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
+    if (asObject(functionValue)-&gt;inherits(JSFunction::info()) || asObject(functionValue)-&gt;inherits(InternalFunction::info()))
+        return createCallIdentifierFromFunctionImp(exec, asObject(functionValue), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
+    if (asObject(functionValue)-&gt;inherits(JSCallee::info()))
+        return CallIdentifier(ASCIILiteral(GlobalCodeExecution), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
+    return CallIdentifier(asObject(functionValue)-&gt;methodTable()-&gt;className(asObject(functionValue)), defaultSourceURL, defaultLineNumber, defaultColumnNumber);
+}
+
+CallIdentifier createCallIdentifierFromFunctionImp(ExecState* exec, JSObject* function, const String&amp; defaultSourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber)
+{
+    const String&amp; name = getCalculatedDisplayName(exec, function);
+    JSFunction* jsFunction = jsDynamicCast&lt;JSFunction*&gt;(function);
+    if (jsFunction &amp;&amp; !jsFunction-&gt;isHostOrBuiltinFunction())
+        return CallIdentifier(name.isEmpty() ? ASCIILiteral(AnonymousFunction) : name, jsFunction-&gt;jsExecutable()-&gt;sourceURL(), jsFunction-&gt;jsExecutable()-&gt;firstLine(), jsFunction-&gt;jsExecutable()-&gt;startColumn());
+    return CallIdentifier(name.isEmpty() ? ASCIILiteral(AnonymousFunction) : name, defaultSourceURL, defaultLineNumber, defaultColumnNumber);
+}
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerLegacyProfilerh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/LegacyProfiler.h (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/LegacyProfiler.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/LegacyProfiler.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,77 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2012, 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef LegacyProfiler_h
+#define LegacyProfiler_h
+
+#include &quot;Profile.h&quot;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/Stopwatch.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace JSC {
+
+class ExecState;
+class JSGlobalObject;
+class JSObject;
+class JSValue;
+class ProfileGenerator;
+struct CallIdentifier;
+
+class LegacyProfiler {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    JS_EXPORT_PRIVATE static LegacyProfiler* profiler();
+    static CallIdentifier createCallIdentifier(ExecState*, JSValue, const WTF::String&amp; sourceURL, unsigned defaultLineNumber, unsigned defaultColumnNumber);
+
+    JS_EXPORT_PRIVATE void startProfiling(ExecState*, const WTF::String&amp; title, PassRefPtr&lt;Stopwatch&gt;);
+    JS_EXPORT_PRIVATE RefPtr&lt;Profile&gt; stopProfiling(ExecState*, const WTF::String&amp; title);
+    void stopProfiling(JSGlobalObject*);
+
+    // Used to ignore profile node subtrees rooted at InjectedScript calls.
+    JS_EXPORT_PRIVATE void suspendProfiling(ExecState*);
+    JS_EXPORT_PRIVATE void unsuspendProfiling(ExecState*);
+
+    void willExecute(ExecState* callerCallFrame, JSValue function);
+    void willExecute(ExecState* callerCallFrame, const WTF::String&amp; sourceURL, unsigned startingLineNumber, unsigned startingColumnNumber);
+    void didExecute(ExecState* callerCallFrame, JSValue function);
+    void didExecute(ExecState* callerCallFrame, const WTF::String&amp; sourceURL, unsigned startingLineNumber, unsigned startingColumnNumber);
+
+    void exceptionUnwind(ExecState* handlerCallFrame);
+
+    const Vector&lt;RefPtr&lt;ProfileGenerator&gt;&gt;&amp; currentProfiles() { return m_currentProfiles; };
+
+private:
+    Vector&lt;RefPtr&lt;ProfileGenerator&gt;&gt; m_currentProfiles;
+    static LegacyProfiler* s_sharedLegacyProfiler;
+};
+
+} // namespace JSC
+
+#endif // LegacyProfiler_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/Profile.cpp (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/Profile.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/Profile.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,95 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2014 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Profile.h&quot;
+
+#include &quot;ProfileNode.h&quot;
+#include &lt;wtf/DataLog.h&gt;
+
+namespace JSC {
+
+Ref&lt;Profile&gt; Profile::create(const String&amp; title, unsigned uid, double startTime)
+{
+    return adoptRef(*new Profile(title, uid, startTime));
+}
+
+Profile::Profile(const String&amp; title, unsigned uid, double startTime)
+    : m_title(title)
+    , m_uid(uid)
+{
+    // FIXME: When multi-threading is supported this will be a vector and calls
+    // into the profiler will need to know which thread it is executing on.
+    m_rootNode = ProfileNode::create(nullptr, CallIdentifier(ASCIILiteral(&quot;Thread_1&quot;), String(), 0, 0), nullptr);
+    m_rootNode-&gt;appendCall(ProfileNode::Call(startTime));
+}
+
+Profile::~Profile()
+{
+}
+
+#ifndef NDEBUG
+void Profile::debugPrint()
+{
+    CalculateProfileSubtreeDataFunctor functor;
+    m_rootNode-&gt;forEachNodePostorder(functor);
+    ProfileNode::ProfileSubtreeData data = functor.returnValue();
+
+    dataLogF(&quot;Call graph:\n&quot;);
+    m_rootNode-&gt;debugPrintRecursively(0, data);
+}
+
+typedef WTF::KeyValuePair&lt;FunctionCallHashCount::ValueType, unsigned&gt; NameCountPair;
+
+static inline bool functionNameCountPairComparator(const NameCountPair&amp; a, const NameCountPair&amp; b)
+{
+    return a.value &gt; b.value;
+}
+
+void Profile::debugPrintSampleStyle()
+{
+    typedef Vector&lt;NameCountPair&gt; NameCountPairVector;
+
+    CalculateProfileSubtreeDataFunctor functor;
+    m_rootNode-&gt;forEachNodePostorder(functor);
+    ProfileNode::ProfileSubtreeData data = functor.returnValue();
+
+    FunctionCallHashCount countedFunctions;
+    dataLogF(&quot;Call graph:\n&quot;);
+    m_rootNode-&gt;debugPrintSampleStyleRecursively(0, countedFunctions, data);
+
+    dataLogF(&quot;\nTotal number in stack:\n&quot;);
+    NameCountPairVector sortedFunctions(countedFunctions.size());
+    copyToVector(countedFunctions, sortedFunctions);
+
+    std::sort(sortedFunctions.begin(), sortedFunctions.end(), functionNameCountPairComparator);
+    for (NameCountPairVector::iterator it = sortedFunctions.begin(); it != sortedFunctions.end(); ++it)
+        dataLogF(&quot;        %-12d%s\n&quot;, (*it).value, String((*it).key).utf8().data());
+
+    dataLogF(&quot;\nSort by top of stack, same collapsed (when &gt;= 5):\n&quot;);
+}
+#endif
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilehfromrev200972trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh"></a>
<div class="copfile"><h4>Copied: trunk/Source/JavaScriptCore/profiler/Profile.h (from rev 200972, trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h) (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/Profile.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/Profile.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,66 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2014 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */

+#ifndef Profile_h
+#define Profile_h
+
+#include &quot;ProfileNode.h&quot;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace JSC {
+
+class JS_EXPORT_PRIVATE Profile : public RefCounted&lt;Profile&gt; {
+public:
+    static Ref&lt;Profile&gt; create(const String&amp; title, unsigned uid, double);
+    virtual ~Profile();
+
+    const String&amp; title() const { return m_title; }
+    unsigned uid() const { return m_uid; }
+
+    ProfileNode* rootNode() const { return m_rootNode.get(); }
+    void setRootNode(PassRefPtr&lt;ProfileNode&gt; rootNode) { m_rootNode = rootNode; }
+
+#ifndef NDEBUG
+    void debugPrint();
+    void debugPrintSampleStyle();
+#endif
+
+protected:
+    Profile(const String&amp; title, unsigned uid, double startTime);
+
+private:
+    void removeProfileStart();
+    void removeProfileEnd();
+
+    String m_title;
+    RefPtr&lt;ProfileNode&gt; m_rootNode;
+    unsigned m_uid;
+};
+
+} // namespace JSC
+
+#endif // Profile_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfileGeneratorcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/ProfileGenerator.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,241 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2014, 2016 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ProfileGenerator.h&quot;
+
+#include &quot;CallFrame.h&quot;
+#include &quot;CodeBlock.h&quot;
+#include &quot;JSGlobalObject.h&quot;
+#include &quot;JSStringRef.h&quot;
+#include &quot;JSFunction.h&quot;
+#include &quot;LegacyProfiler.h&quot;
+#include &quot;JSCInlines.h&quot;
+#include &quot;Profile.h&quot;
+#include &quot;StackVisitor.h&quot;
+
+namespace JSC {
+
+Ref&lt;ProfileGenerator&gt; ProfileGenerator::create(ExecState* exec, const String&amp; title, unsigned uid, PassRefPtr&lt;Stopwatch&gt; stopwatch)
+{
+    return adoptRef(*new ProfileGenerator(exec, title, uid, stopwatch));
+}
+
+ProfileGenerator::ProfileGenerator(ExecState* exec, const String&amp; title, unsigned uid, PassRefPtr&lt;Stopwatch&gt; stopwatch)
+    : m_origin(exec ? exec-&gt;lexicalGlobalObject() : nullptr)
+    , m_profileGroup(exec ? exec-&gt;lexicalGlobalObject()-&gt;profileGroup() : 0)
+    , m_stopwatch(stopwatch)
+    , m_foundConsoleStartParent(false)
+    , m_suspended(false)
+{
+    double startTime = m_stopwatch-&gt;elapsedTime();
+    m_profile = Profile::create(title, uid, startTime);
+    m_currentNode = m_rootNode = m_profile-&gt;rootNode();
+    if (exec)
+        addParentForConsoleStart(exec, startTime);
+}
+
+class AddParentForConsoleStartFunctor {
+public:
+    AddParentForConsoleStartFunctor(ExecState* exec, RefPtr&lt;ProfileNode&gt;&amp; rootNode, RefPtr&lt;ProfileNode&gt;&amp; currentNode, double startTime)
+        : m_exec(exec)
+        , m_hasSkippedFirstFrame(false)
+        , m_foundParent(false)
+        , m_rootNode(rootNode)
+        , m_currentNode(currentNode)
+        , m_startTime(startTime)
+    {
+    }
+
+    bool foundParent() const { return m_foundParent; }
+
+    StackVisitor::Status operator()(StackVisitor&amp; visitor) const
+    {
+        if (!m_hasSkippedFirstFrame) {
+            m_hasSkippedFirstFrame = true;
+            return StackVisitor::Continue;
+        }
+
+        unsigned line = 0;
+        unsigned column = 0;
+        visitor-&gt;computeLineAndColumn(line, column);
+        m_currentNode = ProfileNode::create(m_exec, LegacyProfiler::createCallIdentifier(m_exec, visitor-&gt;callee(), visitor-&gt;sourceURL(), line, column), m_rootNode.get());
+        m_currentNode-&gt;appendCall(ProfileNode::Call(m_startTime));
+        m_rootNode-&gt;spliceNode(m_currentNode.get());
+
+        m_foundParent = true;
+        return StackVisitor::Done;
+    }
+
+private:
+    ExecState* m_exec;
+    mutable bool m_hasSkippedFirstFrame;
+    mutable bool m_foundParent;
+    RefPtr&lt;ProfileNode&gt;&amp; m_rootNode;
+    RefPtr&lt;ProfileNode&gt;&amp; m_currentNode;
+    double m_startTime;
+};
+
+void ProfileGenerator::addParentForConsoleStart(ExecState* exec, double startTime)
+{
+    AddParentForConsoleStartFunctor functor(exec, m_rootNode, m_currentNode, startTime);
+    exec-&gt;iterate(functor);
+
+    m_foundConsoleStartParent = functor.foundParent();
+}
+
+const String&amp; ProfileGenerator::title() const
+{
+    return m_profile-&gt;title();
+}
+
+void ProfileGenerator::beginCallEntry(ProfileNode* node, double startTime)
+{
+    ASSERT_ARG(node, node);
+
+    if (std::isnan(startTime))
+        startTime = m_stopwatch-&gt;elapsedTime();
+
+    node-&gt;appendCall(ProfileNode::Call(startTime));
+}
+
+void ProfileGenerator::endCallEntry(ProfileNode* node)
+{
+    ASSERT_ARG(node, node);
+
+    ProfileNode::Call&amp; last = node-&gt;lastCall();
+
+    double previousElapsedTime = std::isnan(last.elapsedTime()) ? 0.0 : last.elapsedTime();
+    double newlyElapsedTime = m_stopwatch-&gt;elapsedTime() - last.startTime();
+    last.setElapsedTime(previousElapsedTime + newlyElapsedTime);
+}
+
+void ProfileGenerator::willExecute(ExecState* callerCallFrame, const CallIdentifier&amp; callIdentifier)
+{
+    if (!m_origin)
+        return;
+
+    if (m_suspended)
+        return;
+
+    RefPtr&lt;ProfileNode&gt; calleeNode = nullptr;
+
+    // Find or create a node for the callee call frame.
+    for (const RefPtr&lt;ProfileNode&gt;&amp; child : m_currentNode-&gt;children()) {
+        if (child-&gt;callIdentifier() == callIdentifier)
+            calleeNode = child;
+    }
+
+    if (!calleeNode) {
+        calleeNode = ProfileNode::create(callerCallFrame, callIdentifier, m_currentNode.get());
+        m_currentNode-&gt;addChild(calleeNode);
+    }
+
+    m_currentNode = calleeNode;
+    beginCallEntry(calleeNode.get(), m_stopwatch-&gt;elapsedTime());
+}
+
+void ProfileGenerator::didExecute(ExecState* callerCallFrame, const CallIdentifier&amp; callIdentifier)
+{
+    if (!m_origin)
+        return;
+
+    if (m_suspended)
+        return;
+
+    // Make a new node if the caller node has never seen this callee call frame before.
+    // This can happen if |console.profile()| is called several frames deep in the call stack.
+    ASSERT(m_currentNode);
+    if (m_currentNode-&gt;callIdentifier() != callIdentifier) {
+        RefPtr&lt;ProfileNode&gt; calleeNode = ProfileNode::create(callerCallFrame, callIdentifier, m_currentNode.get());
+        beginCallEntry(calleeNode.get(), m_currentNode-&gt;lastCall().startTime());
+        endCallEntry(calleeNode.get());
+        m_currentNode-&gt;spliceNode(calleeNode.release());
+        return;
+    }
+
+    endCallEntry(m_currentNode.get());
+    m_currentNode = m_currentNode-&gt;parent();
+}
+
+void ProfileGenerator::exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&amp;)
+{
+    if (m_suspended)
+        return;
+
+    // If the current node was called by the handler (==) or any
+    // more nested function (&gt;) the we have exited early from it.
+    ASSERT(m_currentNode);
+    while (m_currentNode-&gt;callerCallFrame() &gt;= handlerCallFrame) {
+        didExecute(m_currentNode-&gt;callerCallFrame(), m_currentNode-&gt;callIdentifier());
+        ASSERT(m_currentNode);
+    }
+}
+
+void ProfileGenerator::stopProfiling()
+{
+    for (ProfileNode* node = m_currentNode.get(); node != m_profile-&gt;rootNode(); node = node-&gt;parent())
+        endCallEntry(node);
+
+    if (m_foundConsoleStartParent) {
+        removeProfileStart();
+        removeProfileEnd();
+    }
+
+    ASSERT(m_currentNode);
+
+    // Set the current node to the parent, because we are in a call that
+    // will not get didExecute call.
+    m_currentNode = m_currentNode-&gt;parent();
+}
+
+// The console.profile that started this ProfileGenerator will be the first child.
+void ProfileGenerator::removeProfileStart()
+{
+    ProfileNode* currentNode = nullptr;
+    for (ProfileNode* next = m_rootNode.get(); next; next = next-&gt;firstChild())
+        currentNode = next;
+
+    if (currentNode-&gt;callIdentifier().functionName() != &quot;profile&quot;)
+        return;
+
+    currentNode-&gt;parent()-&gt;removeChild(currentNode);
+}
+
+// The console.profileEnd that stopped this ProfileGenerator will be the last child.
+void ProfileGenerator::removeProfileEnd()
+{
+    ProfileNode* currentNode = nullptr;
+    for (ProfileNode* next = m_rootNode.get(); next; next = next-&gt;lastChild())
+        currentNode = next;
+
+    if (currentNode-&gt;callIdentifier().functionName() != &quot;profileEnd&quot;)
+        return;
+
+    ASSERT(currentNode-&gt;callIdentifier() == (currentNode-&gt;parent()-&gt;children()[currentNode-&gt;parent()-&gt;children().size() - 1])-&gt;callIdentifier());
+    currentNode-&gt;parent()-&gt;removeChild(currentNode);
+}
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfileGeneratorh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/ProfileGenerator.h (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfileGenerator.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/ProfileGenerator.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,84 @@
</span><ins>+/*
+ * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ProfileGenerator_h
+#define ProfileGenerator_h
+
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/Stopwatch.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace JSC {
+
+    class DebuggerCallFrame;
+    class ExecState;
+    class JSGlobalObject;
+    class Profile;
+    class ProfileNode;
+    struct CallIdentifier;
+
+    class ProfileGenerator : public RefCounted&lt;ProfileGenerator&gt;  {
+    public:
+        static Ref&lt;ProfileGenerator&gt; create(ExecState*, const WTF::String&amp; title, unsigned uid, PassRefPtr&lt;Stopwatch&gt;);
+
+        // Members
+        const WTF::String&amp; title() const;
+        PassRefPtr&lt;Profile&gt; profile() const { return m_profile; }
+        JSGlobalObject* origin() const { return m_origin; }
+        unsigned profileGroup() const { return m_profileGroup; }
+
+        void willExecute(ExecState* callerCallFrame, const CallIdentifier&amp;);
+        void didExecute(ExecState* callerCallFrame, const CallIdentifier&amp;);
+        void exceptionUnwind(ExecState* handlerCallFrame, const CallIdentifier&amp;);
+
+        void setIsSuspended(bool suspended) { ASSERT(m_suspended != suspended); m_suspended = suspended; }
+
+        void stopProfiling();
+
+    private:
+        ProfileGenerator(ExecState*, const WTF::String&amp; title, unsigned uid, PassRefPtr&lt;Stopwatch&gt;);
+        void addParentForConsoleStart(ExecState*, double);
+
+        void removeProfileStart();
+        void removeProfileEnd();
+
+        void beginCallEntry(ProfileNode*, double startTime);
+        void endCallEntry(ProfileNode*);
+
+        RefPtr&lt;Profile&gt; m_profile;
+        JSGlobalObject* m_origin;
+        unsigned m_profileGroup;
+        RefPtr&lt;Stopwatch&gt; m_stopwatch;
+        RefPtr&lt;ProfileNode&gt; m_rootNode;
+        RefPtr&lt;ProfileNode&gt; m_currentNode;
+        bool m_foundConsoleStartParent;
+        bool m_suspended;
+    };
+
+} // namespace JSC
+
+#endif // ProfileGenerator_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfileNodecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/ProfileNode.cpp (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfileNode.cpp                                (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/ProfileNode.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,199 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ProfileNode.h&quot;
+
+#include &quot;LegacyProfiler.h&quot;
+#include &lt;wtf/DateMath.h&gt;
+#include &lt;wtf/DataLog.h&gt;
+#include &lt;wtf/text/StringHash.h&gt;
+
+using namespace WTF;
+
+namespace JSC {
+
+ProfileNode::ProfileNode(ExecState* callerCallFrame, const CallIdentifier&amp; callIdentifier, ProfileNode* parentNode)
+    : m_callerCallFrame(callerCallFrame)
+    , m_callIdentifier(callIdentifier)
+    , m_parent(parentNode)
+#ifndef NDEBUG
+    , m_nextSibling(nullptr)
+#endif
+{
+}
+
+ProfileNode::ProfileNode(ExecState* callerCallFrame, ProfileNode* nodeToCopy)
+    : m_callerCallFrame(callerCallFrame)
+    , m_callIdentifier(nodeToCopy-&gt;callIdentifier())
+    , m_parent(nodeToCopy-&gt;parent())
+    , m_calls(nodeToCopy-&gt;calls())
+#ifndef NDEBUG
+    , m_nextSibling(nullptr)
+#endif
+{
+}
+
+void ProfileNode::addChild(PassRefPtr&lt;ProfileNode&gt; prpChild)
+{
+    RefPtr&lt;ProfileNode&gt; child = prpChild;
+    child-&gt;setParent(this);
+#ifndef NDEBUG
+    if (m_children.size())
+        m_children.last()-&gt;setNextSibling(child.get());
+#endif
+    m_children.append(child.release());
+}
+
+void ProfileNode::removeChild(ProfileNode* node)
+{
+    if (!node)
+        return;
+
+    m_children.removeFirstMatching([node] (const RefPtr&lt;ProfileNode&gt;&amp; current) {
+        return *node == current.get();
+    });
+
+#ifndef NDEBUG
+    size_t size = m_children.size();
+    for (size_t i = 0; i &lt; size; ++i)
+        m_children[i]-&gt;setNextSibling(i + 1 == size ? nullptr : m_children[i + 1].get());
+#endif
+}
+
+void ProfileNode::spliceNode(PassRefPtr&lt;ProfileNode&gt; prpNode)
+{
+    RefPtr&lt;ProfileNode&gt; node = prpNode;
+
+    for (unsigned i = 0; i &lt; m_children.size(); ++i)
+        node-&gt;addChild(m_children[i].release());
+
+    m_children.clear();
+    m_children.append(node.release());
+}
+
+#ifndef NDEBUG
+ProfileNode* ProfileNode::traverseNextNodePostOrder() const
+{
+    ProfileNode* next = m_nextSibling;
+    if (!next)
+        return m_parent;
+    while (ProfileNode* firstChild = next-&gt;firstChild())
+        next = firstChild;
+    return next;
+}
+
+void ProfileNode::debugPrint()
+{
+    CalculateProfileSubtreeDataFunctor functor;
+    forEachNodePostorder(functor);
+    ProfileNode::ProfileSubtreeData data = functor.returnValue();
+
+    debugPrintRecursively(0, data);
+}
+
+void ProfileNode::debugPrintSampleStyle()
+{
+    FunctionCallHashCount countedFunctions;
+
+    CalculateProfileSubtreeDataFunctor functor;
+    forEachNodePostorder(functor);
+    ProfileNode::ProfileSubtreeData data = functor.returnValue();
+
+    debugPrintSampleStyleRecursively(0, countedFunctions, data);
+}
+
+void ProfileNode::debugPrintRecursively(int indentLevel, const ProfileSubtreeData&amp; data)
+{
+    // Print function names
+    for (int i = 0; i &lt; indentLevel; ++i)
+        dataLogF(&quot;  &quot;);
+
+    auto it = data.selfAndTotalTimes.find(this);
+    ASSERT(it != data.selfAndTotalTimes.end());
+
+    double nodeSelfTime = it-&gt;value.first;
+    double nodeTotalTime = it-&gt;value.second;
+    double rootTotalTime = data.rootTotalTime;
+
+    dataLogF(&quot;Function Name %s %zu SelfTime %.3fms/%.3f%% TotalTime %.3fms/%.3f%% Next Sibling %s\n&quot;,
+        functionName().utf8().data(),
+        m_calls.size(), nodeSelfTime, nodeSelfTime / rootTotalTime * 100.0, nodeTotalTime, nodeTotalTime / rootTotalTime * 100.0,
+        m_nextSibling ? m_nextSibling-&gt;functionName().utf8().data() : &quot;&quot;);
+
+    ++indentLevel;
+
+    // Print children's names and information
+    for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild)
+        (*currentChild)-&gt;debugPrintRecursively(indentLevel, data);
+}
+
+// print the profiled data in a format that matches the tool sample's output.
+double ProfileNode::debugPrintSampleStyleRecursively(int indentLevel, FunctionCallHashCount&amp; countedFunctions, const ProfileSubtreeData&amp; data)
+{
+    dataLogF(&quot;    &quot;);
+
+    auto it = data.selfAndTotalTimes.find(this);
+    ASSERT(it != data.selfAndTotalTimes.end());
+    double nodeTotalTime = it-&gt;value.second;
+
+    // Print function names
+    const char* name = functionName().utf8().data();
+    double sampleCount = nodeTotalTime * 1000;
+    if (indentLevel) {
+        for (int i = 0; i &lt; indentLevel; ++i)
+            dataLogF(&quot;  &quot;);
+
+         countedFunctions.add(functionName().impl());
+
+        dataLogF(&quot;%.0f %s\n&quot;, sampleCount ? sampleCount : 1, name);
+    } else
+        dataLogF(&quot;%s\n&quot;, name);
+
+    ++indentLevel;
+
+    // Print children's names and information
+    double sumOfChildrensCount = 0.0;
+    for (StackIterator currentChild = m_children.begin(); currentChild != m_children.end(); ++currentChild)
+        sumOfChildrensCount += (*currentChild)-&gt;debugPrintSampleStyleRecursively(indentLevel, countedFunctions, data);
+
+    sumOfChildrensCount *= 1000;    //
+    // Print remainder of samples to match sample's output
+    if (sumOfChildrensCount &lt; sampleCount) {
+        dataLogF(&quot;    &quot;);
+        while (indentLevel--)
+            dataLogF(&quot;  &quot;);
+
+        dataLogF(&quot;%.0f %s\n&quot;, sampleCount - sumOfChildrensCount, functionName().utf8().data());
+    }
+
+    return nodeTotalTime;
+}
+#endif
+
+} // namespace JSC
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfileNodeh"></a>
<div class="addfile"><h4>Added: trunk/Source/JavaScriptCore/profiler/ProfileNode.h (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfileNode.h                                (rev 0)
+++ trunk/Source/JavaScriptCore/profiler/ProfileNode.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,194 @@
</span><ins>+/*
+ * Copyright (C) 2008, 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Inc. (&quot;Apple&quot;) nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS &quot;AS IS&quot; AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ProfileNode_h
+#define ProfileNode_h
+
+#include &quot;CallIdentifier.h&quot;
+#include &lt;wtf/HashCountedSet.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+
+namespace JSC {
+
+    class ExecState;
+    class ProfileNode;
+
+    typedef HashCountedSet&lt;StringImpl*&gt; FunctionCallHashCount;
+
+    class ProfileNode : public RefCounted&lt;ProfileNode&gt; {
+    public:
+        static Ref&lt;ProfileNode&gt; create(ExecState* callerCallFrame, const CallIdentifier&amp; callIdentifier, ProfileNode* parentNode)
+        {
+            return adoptRef(*new ProfileNode(callerCallFrame, callIdentifier, parentNode));
+        }
+
+        static Ref&lt;ProfileNode&gt; create(ExecState* callerCallFrame, ProfileNode* node)
+        {
+            return adoptRef(*new ProfileNode(callerCallFrame, node));
+        }
+
+        struct Call {
+        public:
+            Call(double startTime, double elapsedTime = NAN)
+                : m_startTime(startTime)
+                , m_elapsedTime(elapsedTime)
+            {
+            }
+
+            double startTime() const { return m_startTime; }
+            void setStartTime(double time)
+            {
+                ASSERT_ARG(time, time &gt;= 0.0 || std::isnan(time));
+                m_startTime = time;
+            }
+
+            double elapsedTime() const { return m_elapsedTime; }
+            void setElapsedTime(double time)
+            {
+                ASSERT_ARG(time, time &gt;= 0.0 || std::isnan(time));
+                m_elapsedTime = time;
+            }
+
+        private:
+            double m_startTime;
+            double m_elapsedTime;
+        };
+
+        bool operator==(ProfileNode* node) { return m_callIdentifier == node-&gt;callIdentifier(); }
+
+        ExecState* callerCallFrame() const { return m_callerCallFrame; }
+        const CallIdentifier&amp; callIdentifier() const { return m_callIdentifier; }
+        unsigned id() const { return m_callIdentifier.hash(); }
+        const String&amp; functionName() const { return m_callIdentifier.functionName(); }
+        const String&amp; url() const { return m_callIdentifier.url(); }
+        unsigned lineNumber() const { return m_callIdentifier.lineNumber(); }
+        unsigned columnNumber() const { return m_callIdentifier.columnNumber(); }
+
+        ProfileNode* parent() const { return m_parent; }
+        void setParent(ProfileNode* parent) { m_parent = parent; }
+
+        const Vector&lt;Call&gt;&amp; calls() const { return m_calls; }
+        Call&amp; lastCall() { ASSERT(!m_calls.isEmpty()); return m_calls.last(); }
+        void appendCall(Call call) { m_calls.append(call); }
+
+        const Vector&lt;RefPtr&lt;ProfileNode&gt;&gt;&amp; children() const { return m_children; }
+        ProfileNode* firstChild() const { return m_children.size() ? m_children.first().get() : nullptr; }
+        ProfileNode* lastChild() const { return m_children.size() ? m_children.last().get() : nullptr; }
+
+        void removeChild(ProfileNode*);
+        void addChild(PassRefPtr&lt;ProfileNode&gt;);
+        // Reparent our child nodes to the passed node, and make it a child node of |this|.
+        void spliceNode(PassRefPtr&lt;ProfileNode&gt;);
+
+#ifndef NDEBUG
+        struct ProfileSubtreeData {
+            HashMap&lt;ProfileNode*, std::pair&lt;double, double&gt;&gt; selfAndTotalTimes;
+            double rootTotalTime;
+        };
+
+        // Use these functions to dump the subtree rooted at this node.
+        void debugPrint();
+        void debugPrintSampleStyle();
+
+        // These are used to recursively print entire subtrees using precomputed self and total times.
+        template &lt;typename Functor&gt; void forEachNodePostorder(Functor&amp;);
+
+        void debugPrintRecursively(int indentLevel, const ProfileSubtreeData&amp;);
+        double debugPrintSampleStyleRecursively(int indentLevel, FunctionCallHashCount&amp;, const ProfileSubtreeData&amp;);
+#endif
+
+    private:
+        typedef Vector&lt;RefPtr&lt;ProfileNode&gt;&gt;::const_iterator StackIterator;
+
+        ProfileNode(ExecState* callerCallFrame, const CallIdentifier&amp;, ProfileNode* parentNode);
+        ProfileNode(ExecState* callerCallFrame, ProfileNode* nodeToCopy);
+
+#ifndef NDEBUG
+        ProfileNode* nextSibling() const { return m_nextSibling; }
+        void setNextSibling(ProfileNode* nextSibling) { m_nextSibling = nextSibling; }
+
+        ProfileNode* traverseNextNodePostOrder() const;
+#endif
+
+        ExecState* m_callerCallFrame;
+        CallIdentifier m_callIdentifier;
+        ProfileNode* m_parent;
+        Vector&lt;Call&gt; m_calls;
+        Vector&lt;RefPtr&lt;ProfileNode&gt;&gt; m_children;
+
+#ifndef NDEBUG
+        ProfileNode* m_nextSibling;
+#endif
+    };
+
+#ifndef NDEBUG
+    template &lt;typename Functor&gt; inline void ProfileNode::forEachNodePostorder(Functor&amp; functor)
+    {
+        ProfileNode* currentNode = this;
+        // Go down to the first node of the traversal, and slowly walk back up.
+        for (ProfileNode* nextNode = currentNode; nextNode; nextNode = nextNode-&gt;firstChild())
+            currentNode = nextNode;
+
+        ProfileNode* endNode = this;
+        while (currentNode &amp;&amp; currentNode != endNode) {
+            functor(currentNode);
+            currentNode = currentNode-&gt;traverseNextNodePostOrder();
+        }
+
+        functor(endNode);
+    }
+
+    struct CalculateProfileSubtreeDataFunctor {
+        void operator()(ProfileNode* node)
+        {
+            double selfTime = 0.0;
+            for (const ProfileNode::Call&amp; call : node-&gt;calls())
+                selfTime += call.elapsedTime();
+
+            double totalTime = selfTime;
+            for (RefPtr&lt;ProfileNode&gt; child : node-&gt;children()) {
+                auto it = m_data.selfAndTotalTimes.find(child.get());
+                if (it != m_data.selfAndTotalTimes.end())
+                    totalTime += it-&gt;value.second;
+            }
+
+            ASSERT(node);
+            m_data.selfAndTotalTimes.set(node, std::make_pair(selfTime, totalTime));
+        }
+
+        ProfileNode::ProfileSubtreeData returnValue() { return WTFMove(m_data); }
+
+        ProfileNode::ProfileSubtreeData m_data;
+    };
+#endif
+
+} // namespace JSC
+
+#endif // ProfileNode_h
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerJettisonReasoncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -47,6 +47,9 @@
</span><span class="cx">     case JettisonDueToDebuggerStepping:
</span><span class="cx">         out.print(&quot;DebuggerStepping&quot;);
</span><span class="cx">         return;
</span><ins>+    case JettisonDueToLegacyProfiler:
+        out.print(&quot;LegacyProfiler&quot;);
+        return;
</ins><span class="cx">     case JettisonDueToBaselineLoopReoptimizationTrigger:
</span><span class="cx">         out.print(&quot;BaselineLoopReoptimizationTrigger&quot;);
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx">     JettisonDueToWeakReference,
</span><span class="cx">     JettisonDueToDebuggerBreakpoint,
</span><span class="cx">     JettisonDueToDebuggerStepping,
</span><ins>+    JettisonDueToLegacyProfiler,
</ins><span class="cx">     JettisonDueToBaselineLoopReoptimizationTrigger,
</span><span class="cx">     JettisonDueToBaselineLoopReoptimizationTriggerOnOSREntryFail,
</span><span class="cx">     JettisonDueToOSRExit,
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCodeCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CodeCache.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CodeCache.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/runtime/CodeCache.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -81,13 +81,13 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> template &lt;class UnlinkedCodeBlockType, class ExecutableType&gt;
</span><del>-UnlinkedCodeBlockType* CodeCache::getGlobalCodeBlock(VM&amp; vm, ExecutableType* executable, const SourceCode&amp; source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, ThisTDZMode thisTDZMode, DebuggerMode debuggerMode, ParserError&amp; error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
</del><ins>+UnlinkedCodeBlockType* CodeCache::getGlobalCodeBlock(VM&amp; vm, ExecutableType* executable, const SourceCode&amp; source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, ThisTDZMode thisTDZMode, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError&amp; error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
</ins><span class="cx"> {
</span><span class="cx">     SourceCodeKey key = SourceCodeKey(source, String(), CacheTypes&lt;UnlinkedCodeBlockType&gt;::codeType, builtinMode, strictMode, thisTDZMode);
</span><span class="cx">     SourceCodeValue* cache = m_sourceCode.findCacheAndUpdateAge(key);
</span><span class="cx">     // FIXME: We should do something smart for TDZ instead of just disabling caching.
</span><span class="cx">     // https://bugs.webkit.org/show_bug.cgi?id=154010
</span><del>-    bool canCache = debuggerMode == DebuggerOff &amp;&amp; !vm.typeProfiler() &amp;&amp; !vm.controlFlowProfiler() &amp;&amp; !variablesUnderTDZ-&gt;size();
</del><ins>+    bool canCache = debuggerMode == DebuggerOff &amp;&amp; profilerMode == ProfilerOff &amp;&amp; !vm.typeProfiler() &amp;&amp; !vm.controlFlowProfiler() &amp;&amp; !variablesUnderTDZ-&gt;size();
</ins><span class="cx">     if (cache &amp;&amp; canCache) {
</span><span class="cx">         UnlinkedCodeBlockType* unlinkedCodeBlock = jsCast&lt;UnlinkedCodeBlockType*&gt;(cache-&gt;cell.get());
</span><span class="cx">         unsigned firstLine = source.firstLine() + unlinkedCodeBlock-&gt;firstLine();
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">     unlinkedCodeBlock-&gt;setSourceURLDirective(source.provider()-&gt;sourceURL());
</span><span class="cx">     unlinkedCodeBlock-&gt;setSourceMappingURLDirective(source.provider()-&gt;sourceMappingURL());
</span><span class="cx"> 
</span><del>-    error = BytecodeGenerator::generate(vm, rootNode.get(), unlinkedCodeBlock, debuggerMode, variablesUnderTDZ);
</del><ins>+    error = BytecodeGenerator::generate(vm, rootNode.get(), unlinkedCodeBlock, debuggerMode, profilerMode, variablesUnderTDZ);
</ins><span class="cx"> 
</span><span class="cx">     if (error.isValid())
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -132,21 +132,21 @@
</span><span class="cx">     return unlinkedCodeBlock;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-UnlinkedProgramCodeBlock* CodeCache::getProgramCodeBlock(VM&amp; vm, ProgramExecutable* executable, const SourceCode&amp; source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ParserError&amp; error)
</del><ins>+UnlinkedProgramCodeBlock* CodeCache::getProgramCodeBlock(VM&amp; vm, ProgramExecutable* executable, const SourceCode&amp; source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError&amp; error)
</ins><span class="cx"> {
</span><span class="cx">     VariableEnvironment emptyParentTDZVariables;
</span><del>-    return getGlobalCodeBlock&lt;UnlinkedProgramCodeBlock&gt;(vm, executable, source, builtinMode, strictMode, ThisTDZMode::CheckIfNeeded, debuggerMode, error, EvalContextType::None, &amp;emptyParentTDZVariables);
</del><ins>+    return getGlobalCodeBlock&lt;UnlinkedProgramCodeBlock&gt;(vm, executable, source, builtinMode, strictMode, ThisTDZMode::CheckIfNeeded, debuggerMode, profilerMode, error, EvalContextType::None, &amp;emptyParentTDZVariables);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-UnlinkedEvalCodeBlock* CodeCache::getEvalCodeBlock(VM&amp; vm, EvalExecutable* executable, const SourceCode&amp; source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, ThisTDZMode thisTDZMode, DebuggerMode debuggerMode, ParserError&amp; error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
</del><ins>+UnlinkedEvalCodeBlock* CodeCache::getEvalCodeBlock(VM&amp; vm, EvalExecutable* executable, const SourceCode&amp; source, JSParserBuiltinMode builtinMode, JSParserStrictMode strictMode, ThisTDZMode thisTDZMode, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError&amp; error, EvalContextType evalContextType, const VariableEnvironment* variablesUnderTDZ)
</ins><span class="cx"> {
</span><del>-    return getGlobalCodeBlock&lt;UnlinkedEvalCodeBlock&gt;(vm, executable, source, builtinMode, strictMode, thisTDZMode, debuggerMode, error, evalContextType, variablesUnderTDZ);
</del><ins>+    return getGlobalCodeBlock&lt;UnlinkedEvalCodeBlock&gt;(vm, executable, source, builtinMode, strictMode, thisTDZMode, debuggerMode, profilerMode, error, evalContextType, variablesUnderTDZ);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-UnlinkedModuleProgramCodeBlock* CodeCache::getModuleProgramCodeBlock(VM&amp; vm, ModuleProgramExecutable* executable, const SourceCode&amp; source, JSParserBuiltinMode builtinMode, DebuggerMode debuggerMode, ParserError&amp; error)
</del><ins>+UnlinkedModuleProgramCodeBlock* CodeCache::getModuleProgramCodeBlock(VM&amp; vm, ModuleProgramExecutable* executable, const SourceCode&amp; source, JSParserBuiltinMode builtinMode, DebuggerMode debuggerMode, ProfilerMode profilerMode, ParserError&amp; error)
</ins><span class="cx"> {
</span><span class="cx">     VariableEnvironment emptyParentTDZVariables;
</span><del>-    return getGlobalCodeBlock&lt;UnlinkedModuleProgramCodeBlock&gt;(vm, executable, source, builtinMode, JSParserStrictMode::Strict, ThisTDZMode::CheckIfNeeded, debuggerMode, error, EvalContextType::None, &amp;emptyParentTDZVariables);
</del><ins>+    return getGlobalCodeBlock&lt;UnlinkedModuleProgramCodeBlock&gt;(vm, executable, source, builtinMode, JSParserStrictMode::Strict, ThisTDZMode::CheckIfNeeded, debuggerMode, profilerMode, error, EvalContextType::None, &amp;emptyParentTDZVariables);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // FIXME: There's no need to add the function's name to the key here. It's already in the source code.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeCodeCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/CodeCache.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/CodeCache.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/runtime/CodeCache.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -187,9 +187,9 @@
</span><span class="cx">     CodeCache();
</span><span class="cx">     ~CodeCache();
</span><span class="cx"> 
</span><del>-    UnlinkedProgramCodeBlock* getProgramCodeBlock(VM&amp;, ProgramExecutable*, const SourceCode&amp;, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ParserError&amp;);
-    UnlinkedEvalCodeBlock* getEvalCodeBlock(VM&amp;, EvalExecutable*, const SourceCode&amp;, JSParserBuiltinMode, JSParserStrictMode, ThisTDZMode, DebuggerMode, ParserError&amp;, EvalContextType, const VariableEnvironment*);
-    UnlinkedModuleProgramCodeBlock* getModuleProgramCodeBlock(VM&amp;, ModuleProgramExecutable*, const SourceCode&amp;, JSParserBuiltinMode, DebuggerMode, ParserError&amp;);
</del><ins>+    UnlinkedProgramCodeBlock* getProgramCodeBlock(VM&amp;, ProgramExecutable*, const SourceCode&amp;, JSParserBuiltinMode, JSParserStrictMode, DebuggerMode, ProfilerMode, ParserError&amp;);
+    UnlinkedEvalCodeBlock* getEvalCodeBlock(VM&amp;, EvalExecutable*, const SourceCode&amp;, JSParserBuiltinMode, JSParserStrictMode, ThisTDZMode, DebuggerMode, ProfilerMode, ParserError&amp;, EvalContextType, const VariableEnvironment*);
+    UnlinkedModuleProgramCodeBlock* getModuleProgramCodeBlock(VM&amp;, ModuleProgramExecutable*, const SourceCode&amp;, JSParserBuiltinMode, DebuggerMode, ProfilerMode, ParserError&amp;);
</ins><span class="cx">     UnlinkedFunctionExecutable* getFunctionExecutableFromGlobalCode(VM&amp;, const Identifier&amp;, const SourceCode&amp;, ParserError&amp;);
</span><span class="cx"> 
</span><span class="cx">     void clear()
</span><span class="lines">@@ -199,7 +199,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     template &lt;class UnlinkedCodeBlockType, class ExecutableType&gt; 
</span><del>-    UnlinkedCodeBlockType* getGlobalCodeBlock(VM&amp;, ExecutableType*, const SourceCode&amp;, JSParserBuiltinMode, JSParserStrictMode, ThisTDZMode, DebuggerMode, ParserError&amp;, EvalContextType, const VariableEnvironment*);
</del><ins>+    UnlinkedCodeBlockType* getGlobalCodeBlock(VM&amp;, ExecutableType*, const SourceCode&amp;, JSParserBuiltinMode, JSParserStrictMode, ThisTDZMode, DebuggerMode, ProfilerMode, ParserError&amp;, EvalContextType, const VariableEnvironment*);
</ins><span class="cx"> 
</span><span class="cx">     CodeCacheMap m_sourceCode;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeExecutablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Executable.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Executable.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/runtime/Executable.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -312,9 +312,10 @@
</span><span class="cx">     JSGlobalObject* globalObject = scope-&gt;globalObject();
</span><span class="cx">     ParserError error;
</span><span class="cx">     DebuggerMode debuggerMode = globalObject-&gt;hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
</span><ins>+    ProfilerMode profilerMode = globalObject-&gt;hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
</ins><span class="cx">     UnlinkedFunctionCodeBlock* unlinkedCodeBlock = 
</span><span class="cx">         executable-&gt;m_unlinkedExecutable-&gt;unlinkedCodeBlockFor(
</span><del>-            *vm, executable-&gt;m_source, kind, debuggerMode, error, 
</del><ins>+            *vm, executable-&gt;m_source, kind, debuggerMode, profilerMode, error, 
</ins><span class="cx">             executable-&gt;parseMode());
</span><span class="cx">     recordParse(
</span><span class="cx">         executable-&gt;m_unlinkedExecutable-&gt;features(), 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -112,6 +112,7 @@
</span><span class="cx"> #include &quot;JSWithScope.h&quot;
</span><span class="cx"> #include &quot;LazyClassStructureInlines.h&quot;
</span><span class="cx"> #include &quot;LazyPropertyInlines.h&quot;
</span><ins>+#include &quot;LegacyProfiler.h&quot;
</ins><span class="cx"> #include &quot;Lookup.h&quot;
</span><span class="cx"> #include &quot;MapConstructor.h&quot;
</span><span class="cx"> #include &quot;MapIteratorPrototype.h&quot;
</span><span class="lines">@@ -207,7 +208,7 @@
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo JSGlobalObject::s_info = { &quot;GlobalObject&quot;, &amp;Base::s_info, &amp;globalObjectTable, CREATE_METHOD_TABLE(JSGlobalObject) };
</span><span class="cx"> 
</span><del>-const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &amp;allowsAccessFrom, &amp;supportsRichSourceInfo, &amp;shouldInterruptScript, &amp;javaScriptRuntimeFlags, nullptr, &amp;shouldInterruptScriptBeforeTimeout, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
</del><ins>+const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &amp;allowsAccessFrom, &amp;supportsLegacyProfiling, &amp;supportsRichSourceInfo, &amp;shouldInterruptScript, &amp;javaScriptRuntimeFlags, nullptr, &amp;shouldInterruptScriptBeforeTimeout, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
</ins><span class="cx"> 
</span><span class="cx"> /* Source for JSGlobalObject.lut.h
</span><span class="cx"> @begin globalObjectTable
</span><span class="lines">@@ -296,6 +297,9 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_debugger)
</span><span class="cx">         m_debugger-&gt;detach(this, Debugger::GlobalObjectIsDestructing);
</span><ins>+
+    if (LegacyProfiler* profiler = vm().enabledProfiler())
+        profiler-&gt;stopProfiling(this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSGlobalObject::destroy(JSCell* cell)
</span><span class="lines">@@ -833,6 +837,11 @@
</span><span class="cx">     resetPrototype(vm, getPrototypeDirect());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool JSGlobalObject::hasLegacyProfiler() const
+{
+    return globalObjectMethodTable()-&gt;supportsLegacyProfiling(this);
+}
+
</ins><span class="cx"> bool JSGlobalObject::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot&amp; slot)
</span><span class="cx"> {
</span><span class="cx">     JSGlobalObject* thisObject = jsCast&lt;JSGlobalObject*&gt;(cell);
</span><span class="lines">@@ -1222,9 +1231,10 @@
</span><span class="cx">     ParserError error;
</span><span class="cx">     JSParserStrictMode strictMode = executable-&gt;isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
</span><span class="cx">     DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
</span><ins>+    ProfilerMode profilerMode = hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
</ins><span class="cx">     UnlinkedProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()-&gt;getProgramCodeBlock(
</span><span class="cx">         vm(), executable, executable-&gt;source(), JSParserBuiltinMode::NotBuiltin, strictMode, 
</span><del>-        debuggerMode, error);
</del><ins>+        debuggerMode, profilerMode, error);
</ins><span class="cx"> 
</span><span class="cx">     if (hasDebugger())
</span><span class="cx">         debugger()-&gt;sourceParsed(callFrame, executable-&gt;source().provider(), error.line(), error.message());
</span><span class="lines">@@ -1244,8 +1254,9 @@
</span><span class="cx">     DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
</span><span class="cx">     EvalContextType evalContextType = executable-&gt;executableInfo().evalContextType();
</span><span class="cx">     
</span><ins>+    ProfilerMode profilerMode = hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
</ins><span class="cx">     UnlinkedEvalCodeBlock* unlinkedCodeBlock = vm().codeCache()-&gt;getEvalCodeBlock(
</span><del>-        vm(), executable, executable-&gt;source(), JSParserBuiltinMode::NotBuiltin, strictMode, thisTDZMode, debuggerMode, error, evalContextType, variablesUnderTDZ);
</del><ins>+        vm(), executable, executable-&gt;source(), JSParserBuiltinMode::NotBuiltin, strictMode, thisTDZMode, debuggerMode, profilerMode, error, evalContextType, variablesUnderTDZ);
</ins><span class="cx"> 
</span><span class="cx">     if (hasDebugger())
</span><span class="cx">         debugger()-&gt;sourceParsed(callFrame, executable-&gt;source().provider(), error.line(), error.message());
</span><span class="lines">@@ -1262,8 +1273,9 @@
</span><span class="cx"> {
</span><span class="cx">     ParserError error;
</span><span class="cx">     DebuggerMode debuggerMode = hasInteractiveDebugger() ? DebuggerOn : DebuggerOff;
</span><ins>+    ProfilerMode profilerMode = hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
</ins><span class="cx">     UnlinkedModuleProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()-&gt;getModuleProgramCodeBlock(
</span><del>-        vm(), executable, executable-&gt;source(), JSParserBuiltinMode::NotBuiltin, debuggerMode, error);
</del><ins>+        vm(), executable, executable-&gt;source(), JSParserBuiltinMode::NotBuiltin, debuggerMode, profilerMode, error);
</ins><span class="cx"> 
</span><span class="cx">     if (hasDebugger())
</span><span class="cx">         debugger()-&gt;sourceParsed(callFrame, executable-&gt;source().provider(), error.line(), error.message());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -151,6 +151,9 @@
</span><span class="cx">     typedef bool (*AllowsAccessFromFunctionPtr)(const JSGlobalObject*, ExecState*);
</span><span class="cx">     AllowsAccessFromFunctionPtr allowsAccessFrom;
</span><span class="cx"> 
</span><ins>+    typedef bool (*SupportsLegacyProfilingFunctionPtr)(const JSGlobalObject*);
+    SupportsLegacyProfilingFunctionPtr supportsLegacyProfiling;
+
</ins><span class="cx">     typedef bool (*SupportsRichSourceInfoFunctionPtr)(const JSGlobalObject*);
</span><span class="cx">     SupportsRichSourceInfoFunctionPtr supportsRichSourceInfo;
</span><span class="cx"> 
</span><span class="lines">@@ -404,6 +407,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool hasDebugger() const;
</span><span class="cx">     bool hasInteractiveDebugger() const;
</span><ins>+    bool hasLegacyProfiler() const;
</ins><span class="cx">     const RuntimeFlags&amp; runtimeFlags() const { return m_runtimeFlags; }
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="lines">@@ -713,6 +717,7 @@
</span><span class="cx">     const GlobalObjectMethodTable* globalObjectMethodTable() const { return m_globalObjectMethodTable; }
</span><span class="cx"> 
</span><span class="cx">     static bool allowsAccessFrom(const JSGlobalObject*, ExecState*) { return true; }
</span><ins>+    static bool supportsLegacyProfiling(const JSGlobalObject*) { return false; }
</ins><span class="cx">     static bool supportsRichSourceInfo(const JSGlobalObject*) { return true; }
</span><span class="cx"> 
</span><span class="cx">     JS_EXPORT_PRIVATE ExecState* globalExec();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeOptionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Options.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Options.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/runtime/Options.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -131,6 +131,7 @@
</span><span class="cx">     v(bool, dumpBytecodeLivenessResults, false, Normal, nullptr) \
</span><span class="cx">     v(bool, validateBytecode, false, Normal, nullptr) \
</span><span class="cx">     v(bool, forceDebuggerBytecodeGeneration, false, Normal, nullptr) \
</span><ins>+    v(bool, forceProfilerBytecodeGeneration, false, Normal, nullptr) \
</ins><span class="cx">     \
</span><span class="cx">     v(bool, useFunctionDotArguments, true, Normal, nullptr) \
</span><span class="cx">     v(bool, useTailCalls, true, Normal, nullptr) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -194,6 +194,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     , m_inDefineOwnProperty(false)
</span><span class="cx">     , m_codeCache(std::make_unique&lt;CodeCache&gt;())
</span><ins>+    , m_enabledProfiler(nullptr)
</ins><span class="cx">     , m_builtinExecutables(std::make_unique&lt;BuiltinExecutables&gt;(*this))
</span><span class="cx">     , m_typeProfilerEnabledCount(0)
</span><span class="cx">     , m_controlFlowProfilerEnabledCount(0)
</span><span class="lines">@@ -776,6 +777,25 @@
</span><span class="cx">         watchpointSet-&gt;fireAll(&quot;Impure property added&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class SetEnabledProfilerFunctor {
+public:
+    bool operator()(CodeBlock* codeBlock) const
+    {
+        if (JITCode::isOptimizingJIT(codeBlock-&gt;jitType()))
+            codeBlock-&gt;jettison(Profiler::JettisonDueToLegacyProfiler);
+        return false;
+    }
+};
+
+void VM::setEnabledProfiler(LegacyProfiler* profiler)
+{
+    m_enabledProfiler = profiler;
+    if (m_enabledProfiler) {
+        SetEnabledProfilerFunctor functor;
+        heap.forEachCodeBlock(functor);
+    }
+}
+
</ins><span class="cx"> static bool enableProfilerWithRespectToCount(unsigned&amp; counter, std::function&lt;void()&gt; doEnableWork)
</span><span class="cx"> {
</span><span class="cx">     bool needsToRecompile = false;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/JavaScriptCore/runtime/VM.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -92,6 +92,7 @@
</span><span class="cx"> class JSGlobalObject;
</span><span class="cx"> class JSObject;
</span><span class="cx"> class LLIntOffsetsExtractor;
</span><ins>+class LegacyProfiler;
</ins><span class="cx"> class NativeExecutable;
</span><span class="cx"> class RegExpCache;
</span><span class="cx"> class RegisterAtOffsetList;
</span><span class="lines">@@ -354,6 +355,11 @@
</span><span class="cx">         return m_inDefineOwnProperty;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    LegacyProfiler* enabledProfiler() { return m_enabledProfiler; }
+    void setEnabledProfiler(LegacyProfiler*);
+
+    void* enabledProfilerAddress() { return &amp;m_enabledProfiler; }
+
</ins><span class="cx"> #if ENABLE(JIT)
</span><span class="cx">     bool canUseJIT() { return m_canUseJIT; }
</span><span class="cx"> #else
</span><span class="lines">@@ -651,6 +657,7 @@
</span><span class="cx">     bool m_globalConstRedeclarationShouldThrow { true };
</span><span class="cx">     bool m_shouldBuildPCToCodeOriginMapping { false };
</span><span class="cx">     std::unique_ptr&lt;CodeCache&gt; m_codeCache;
</span><ins>+    LegacyProfiler* m_enabledProfiler;
</ins><span class="cx">     std::unique_ptr&lt;BuiltinExecutables&gt; m_builtinExecutables;
</span><span class="cx">     HashMap&lt;String, RefPtr&lt;WatchpointSet&gt;&gt; m_impurePropertyWatchpointSets;
</span><span class="cx">     std::unique_ptr&lt;TypeProfiler&gt; m_typeProfiler;
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -591,6 +591,8 @@
</span><span class="cx"> 
</span><span class="cx">     inspector/CommandLineAPIHost.idl
</span><span class="cx">     inspector/InspectorFrontendHost.idl
</span><ins>+    inspector/ScriptProfile.idl
+    inspector/ScriptProfileNode.idl
</ins><span class="cx"> 
</span><span class="cx">     loader/appcache/DOMApplicationCache.idl
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/ChangeLog        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1,3 +1,77 @@
</span><ins>+2016-05-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Unreviewed rollout r200924. Caused js/regress/string-replace-generic.html to fail.
+
+        Tests: fast/profiler/*
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * ForwardingHeaders/profiler/LegacyProfiler.h: Added.
+        * ForwardingHeaders/profiler/Profile.h: Added.
+        * ForwardingHeaders/profiler/ProfileNode.h: Added.
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSCustomXPathNSResolver.cpp:
+        * bindings/js/JSDOMWindowBase.cpp:
+        (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
+        (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
+        * bindings/js/JSDOMWindowBase.h:
+        * bindings/js/JSWorkerGlobalScopeBase.cpp:
+        (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
+        * bindings/js/JSWorkerGlobalScopeBase.h:
+        * bindings/js/ScriptCachedFrameData.cpp:
+        * bindings/js/ScriptController.cpp:
+        (WebCore::ScriptController::clearWindowShell):
+        * bindings/js/ScriptProfile.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
+        * bindings/js/ScriptProfileNode.h: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (AddClassForwardIfNeeded):
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg):
+        (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence):
+        * bindings/scripts/test/TestObj.idl:
+        * css/CSSParser.cpp:
+        * dom/Document.cpp:
+        * inspector/InspectorConsoleInstrumentation.h:
+        (WebCore::InspectorInstrumentation::stopProfiling):
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::legacyProfilerEnabled):
+        (WebCore::InspectorController::setLegacyProfilerEnabled):
+        * inspector/InspectorController.h:
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::stopProfilingImpl):
+        * inspector/InspectorInstrumentation.h:
+        * inspector/InspectorTimelineAgent.cpp:
+        (WebCore::InspectorTimelineAgent::startFromConsole):
+        (WebCore::InspectorTimelineAgent::stopFromConsole):
+        * inspector/InspectorTimelineAgent.h:
+        * inspector/PageDebuggerAgent.cpp:
+        * inspector/PageRuntimeAgent.cpp:
+        * inspector/ScriptProfile.idl: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
+        * inspector/ScriptProfileNode.idl: Copied from Source/JavaScriptCore/profiler/ProfilerJettisonReason.h.
+        * inspector/TimelineRecordFactory.cpp:
+        (WebCore::buildAggregateCallInfoInspectorObject):
+        (WebCore::buildInspectorObject):
+        (WebCore::buildProfileInspectorObject):
+        (WebCore::TimelineRecordFactory::appendProfile):
+        * inspector/TimelineRecordFactory.h:
+        * page/DOMWindow.cpp:
+        * page/Page.cpp:
+        * page/PageConsoleClient.cpp:
+        (WebCore::PageConsoleClient::profileEnd):
+        (WebCore::PageConsoleClient::clearProfiles):
+        * page/PageConsoleClient.h:
+        * testing/Internals.cpp:
+        (WebCore::Internals::resetToConsistentState):
+        (WebCore::Internals::consoleProfiles):
+        (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+        * testing/js/WebCoreTestSupport.cpp:
+        * xml/XSLStyleSheetLibxslt.cpp:
+        * xml/XSLTProcessorLibxslt.cpp:
+
</ins><span class="cx"> 2016-05-16  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         RenderLayer::hitTestList could mutate the list of candidate layers.
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/DerivedSources.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -422,6 +422,8 @@
</span><span class="cx"> #include &quot;JSRTCTrackEvent.cpp&quot;
</span><span class="cx"> #include &quot;JSScreen.cpp&quot;
</span><span class="cx"> #include &quot;JSScriptProcessorNode.cpp&quot;
</span><ins>+#include &quot;JSScriptProfile.cpp&quot;
+#include &quot;JSScriptProfileNode.cpp&quot;
</ins><span class="cx"> #if ENABLE(CSP_NEXT)
</span><span class="cx"> #include &quot;JSSecurityPolicyViolationEvent.cpp&quot;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/DerivedSources.make        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -505,6 +505,8 @@
</span><span class="cx">     $(WebCore)/html/track/VTTCue.idl \
</span><span class="cx">     $(WebCore)/inspector/CommandLineAPIHost.idl \
</span><span class="cx">     $(WebCore)/inspector/InspectorFrontendHost.idl \
</span><ins>+    $(WebCore)/inspector/ScriptProfile.idl \
+    $(WebCore)/inspector/ScriptProfileNode.idl \
</ins><span class="cx">     $(WebCore)/loader/appcache/DOMApplicationCache.idl \
</span><span class="cx">     $(WebCore)/page/AbstractView.idl \
</span><span class="cx">     $(WebCore)/page/BarProp.idl \
</span></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersprofilerLegacyProfilerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/profiler/LegacyProfiler.h (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/profiler/LegacyProfiler.h                                (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/profiler/LegacyProfiler.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+#ifndef WebCore_FWD_LegacyProfiler_h
+#define WebCore_FWD_LegacyProfiler_h
+#include &lt;JavaScriptCore/LegacyProfiler.h&gt;
+#endif
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersprofilerProfileh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/profiler/Profile.h (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/profiler/Profile.h                                (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/profiler/Profile.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+#ifndef WebCore_FWD_Profile_h
+#define WebCore_FWD_Profile_h
+#include &lt;JavaScriptCore/Profile.h&gt;
+#endif
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreForwardingHeadersprofilerProfileNodeh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/ForwardingHeaders/profiler/ProfileNode.h (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ForwardingHeaders/profiler/ProfileNode.h                                (rev 0)
+++ trunk/Source/WebCore/ForwardingHeaders/profiler/ProfileNode.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+#ifndef WebCore_FWD_ProfileNode_h
+#define WebCore_FWD_ProfileNode_h
+#include &lt;JavaScriptCore/ProfileNode.h&gt;
+#endif
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -4057,6 +4057,12 @@
</span><span class="cx">                 9DAC7C541AF2CAA100437C44 /* CSSContentDistributionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9DAC7C521AF2CAA100437C44 /* CSSContentDistributionValue.cpp */; };
</span><span class="cx">                 9DAC7C551AF2CAA200437C44 /* CSSContentDistributionValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DAC7C531AF2CAA100437C44 /* CSSContentDistributionValue.h */; };
</span><span class="cx">                 9DAC7C571AF2CB6400437C44 /* StyleContentAlignmentData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9DAC7C561AF2CB6400437C44 /* StyleContentAlignmentData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F72304C11184B4100AD0126 /* ScriptProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                9FA37EE41172FC8000C4CD55 /* ScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EE31172FC8000C4CD55 /* ScriptProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                9FA37EFA1172FDA600C4CD55 /* JSScriptProfile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37EF61172FD9300C4CD55 /* JSScriptProfile.cpp */; };
+                9FA37EFB1172FDA600C4CD55 /* JSScriptProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */; };
+                9FA37EFC1172FDA600C4CD55 /* JSScriptProfileNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */; };
+                9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */; };
</ins><span class="cx">                 A07D3355152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A07D3353152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp */; };
</span><span class="cx">                 A07D3356152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A07D3354152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h */; };
</span><span class="cx">                 A07D3358152B632D001B6393 /* WebGLShaderPrecisionFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = A07D3357152B632D001B6393 /* WebGLShaderPrecisionFormat.h */; };
</span><span class="lines">@@ -11775,6 +11781,14 @@
</span><span class="cx">                 9DAC7C521AF2CAA100437C44 /* CSSContentDistributionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSContentDistributionValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9DAC7C531AF2CAA100437C44 /* CSSContentDistributionValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSContentDistributionValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9DAC7C561AF2CB6400437C44 /* StyleContentAlignmentData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleContentAlignmentData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                9F72304C11184B4100AD0126 /* ScriptProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfile.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9FA37EE31172FC8000C4CD55 /* ScriptProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptProfileNode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9FA37EEF1172FD4100C4CD55 /* ScriptProfile.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScriptProfile.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9FA37EF01172FD4100C4CD55 /* ScriptProfileNode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ScriptProfileNode.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9FA37EF61172FD9300C4CD55 /* JSScriptProfile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptProfile.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptProfile.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSScriptProfileNode.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSScriptProfileNode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 A07D3353152B630E001B6393 /* JSWebGLShaderPrecisionFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWebGLShaderPrecisionFormat.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A07D3354152B630E001B6393 /* JSWebGLShaderPrecisionFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWebGLShaderPrecisionFormat.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 A07D3357152B632D001B6393 /* WebGLShaderPrecisionFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebGLShaderPrecisionFormat.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -16288,6 +16302,10 @@
</span><span class="cx">                                 A584FE3A1864E2D800843B10 /* JSCommandLineAPIHost.h */,
</span><span class="cx">                                 7A0E771C10C00DB100A0276E /* JSInspectorFrontendHost.cpp */,
</span><span class="cx">                                 7A0E771D10C00DB100A0276E /* JSInspectorFrontendHost.h */,
</span><ins>+                                9FA37EF61172FD9300C4CD55 /* JSScriptProfile.cpp */,
+                                9FA37EF71172FD9300C4CD55 /* JSScriptProfile.h */,
+                                9FA37EF81172FD9300C4CD55 /* JSScriptProfileNode.cpp */,
+                                9FA37EF91172FD9300C4CD55 /* JSScriptProfileNode.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         name = Inspector;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -16372,6 +16390,8 @@
</span><span class="cx">                                 F382088D147D35F90010BC06 /* PageRuntimeAgent.h */,
</span><span class="cx">                                 A5F36D3818F758720054C024 /* PageScriptDebugServer.cpp */,
</span><span class="cx">                                 A5F36D3918F758720054C024 /* PageScriptDebugServer.h */,
</span><ins>+                                9FA37EEF1172FD4100C4CD55 /* ScriptProfile.idl */,
+                                9FA37EF01172FD4100C4CD55 /* ScriptProfileNode.idl */,
</ins><span class="cx">                                 7553CFE7108F473F00EA281E /* TimelineRecordFactory.cpp */,
</span><span class="cx">                                 7553CFE6108F473F00EA281E /* TimelineRecordFactory.h */,
</span><span class="cx">                                 A56C5B98189F34570082D13C /* WebConsoleAgent.cpp */,
</span><span class="lines">@@ -22360,6 +22380,8 @@
</span><span class="cx">                                 A83E1C720E49042B00140B9C /* ScriptControllerMac.mm */,
</span><span class="cx">                                 41F066E30F64BCF600A07EAC /* ScriptGlobalObject.cpp */,
</span><span class="cx">                                 41F066E20F64BCF600A07EAC /* ScriptGlobalObject.h */,
</span><ins>+                                9F72304C11184B4100AD0126 /* ScriptProfile.h */,
+                                9FA37EE31172FC8000C4CD55 /* ScriptProfileNode.h */,
</ins><span class="cx">                                 934CC1090EDB223900A658F2 /* ScriptSourceCode.h */,
</span><span class="cx">                                 4127D5360F8AAB1D00E424F5 /* ScriptState.cpp */,
</span><span class="cx">                                 41C760B00EDE03D300C1655F /* ScriptState.h */,
</span><span class="lines">@@ -26838,6 +26860,8 @@
</span><span class="cx">                                 5E2C436C1BCF071E0001E2BC /* JSRTCTrackEvent.h in Headers */,
</span><span class="cx">                                 BCEC01C30C274DDD009F4EC9 /* JSScreen.h in Headers */,
</span><span class="cx">                                 FDA15ECE12B03F61003A583A /* JSScriptProcessorNode.h in Headers */,
</span><ins>+                                9FA37EFB1172FDA600C4CD55 /* JSScriptProfile.h in Headers */,
+                                9FA37EFD1172FDA600C4CD55 /* JSScriptProfileNode.h in Headers */,
</ins><span class="cx">                                 CED06AD11C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.h in Headers */,
</span><span class="cx">                                 9BDA64D81B975CF2009C4387 /* JSShadowRoot.h in Headers */,
</span><span class="cx">                                 CD9DE17B17AAC75B00EA386D /* JSSourceBuffer.h in Headers */,
</span><span class="lines">@@ -27829,6 +27853,8 @@
</span><span class="cx">                                 E11C9D9B0EB3681200E409DB /* ScriptExecutionContext.h in Headers */,
</span><span class="cx">                                 41F066E40F64BCF600A07EAC /* ScriptGlobalObject.h in Headers */,
</span><span class="cx">                                 FD31603612B0267600C1A359 /* ScriptProcessorNode.h in Headers */,
</span><ins>+                                9F72304F11184B4100AD0126 /* ScriptProfile.h in Headers */,
+                                9FA37EE41172FC8000C4CD55 /* ScriptProfileNode.h in Headers */,
</ins><span class="cx">                                 8A413AE01207BBA50082016E /* ScriptRunner.h in Headers */,
</span><span class="cx">                                 934CC10A0EDB223900A658F2 /* ScriptSourceCode.h in Headers */,
</span><span class="cx">                                 41C760B10EDE03D300C1655F /* ScriptState.h in Headers */,
</span><span class="lines">@@ -30602,6 +30628,8 @@
</span><span class="cx">                                 5E2C436B1BCF071E0001E2BC /* JSRTCTrackEvent.cpp in Sources */,
</span><span class="cx">                                 BCEC01C20C274DDD009F4EC9 /* JSScreen.cpp in Sources */,
</span><span class="cx">                                 FDA15ECD12B03F61003A583A /* JSScriptProcessorNode.cpp in Sources */,
</span><ins>+                                9FA37EFA1172FDA600C4CD55 /* JSScriptProfile.cpp in Sources */,
+                                9FA37EFC1172FDA600C4CD55 /* JSScriptProfileNode.cpp in Sources */,
</ins><span class="cx">                                 CED06AD01C77754800FDFAF1 /* JSSecurityPolicyViolationEvent.cpp in Sources */,
</span><span class="cx">                                 9BDA64D71B975CE5009C4387 /* JSShadowRoot.cpp in Sources */,
</span><span class="cx">                                 CD9DE17A17AAC75B00EA386D /* JSSourceBuffer.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSCustomXPathNSResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/js/JSCustomXPathNSResolver.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PageConsoleClient.h&quot;
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><ins>+#include &lt;profiler/Profile.h&gt;
</ins><span class="cx"> #include &lt;runtime/JSLock.h&gt;
</span><span class="cx"> #include &lt;wtf/Ref.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo JSDOMWindowBase::s_info = { &quot;Window&quot;, &amp;JSDOMGlobalObject::s_info, 0, CREATE_METHOD_TABLE(JSDOMWindowBase) };
</span><span class="cx"> 
</span><del>-const GlobalObjectMethodTable JSDOMWindowBase::s_globalObjectMethodTable = { &amp;shouldAllowAccessFrom, &amp;supportsRichSourceInfo, &amp;shouldInterruptScript, &amp;javaScriptRuntimeFlags, &amp;queueTaskToEventLoop, &amp;shouldInterruptScriptBeforeTimeout, &amp;moduleLoaderResolve, &amp;moduleLoaderFetch, nullptr, nullptr, &amp;moduleLoaderEvaluate, &amp;defaultLanguage };
</del><ins>+const GlobalObjectMethodTable JSDOMWindowBase::s_globalObjectMethodTable = { &amp;shouldAllowAccessFrom, &amp;supportsLegacyProfiling, &amp;supportsRichSourceInfo, &amp;shouldInterruptScript, &amp;javaScriptRuntimeFlags, &amp;queueTaskToEventLoop, &amp;shouldInterruptScriptBeforeTimeout, &amp;moduleLoaderResolve, &amp;moduleLoaderFetch, nullptr, nullptr, &amp;moduleLoaderEvaluate, &amp;defaultLanguage };
</ins><span class="cx"> 
</span><span class="cx"> JSDOMWindowBase::JSDOMWindowBase(VM&amp; vm, Structure* structure, PassRefPtr&lt;DOMWindow&gt; window, JSDOMWindowShell* shell)
</span><span class="cx">     : JSDOMGlobalObject(vm, structure, &amp;shell-&gt;world(), &amp;s_globalObjectMethodTable)
</span><span class="lines">@@ -125,6 +125,20 @@
</span><span class="cx">     printErrorMessageForFrame(wrapped().frame(), message);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool JSDOMWindowBase::supportsLegacyProfiling(const JSGlobalObject* object)
+{
+    const JSDOMWindowBase* thisObject = static_cast&lt;const JSDOMWindowBase*&gt;(object);
+    Frame* frame = thisObject-&gt;wrapped().frame();
+    if (!frame)
+        return false;
+
+    Page* page = frame-&gt;page();
+    if (!page)
+        return false;
+
+    return page-&gt;inspectorController().legacyProfilerEnabled();
+}
+
</ins><span class="cx"> bool JSDOMWindowBase::supportsRichSourceInfo(const JSGlobalObject* object)
</span><span class="cx"> {
</span><span class="cx">     const JSDOMWindowBase* thisObject = static_cast&lt;const JSDOMWindowBase*&gt;(object);
</span><span class="lines">@@ -138,6 +152,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool enabled = page-&gt;inspectorController().enabled();
</span><span class="cx">     ASSERT(enabled || !thisObject-&gt;debugger());
</span><ins>+    ASSERT(enabled || !supportsLegacyProfiling(thisObject));
</ins><span class="cx">     return enabled;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> 
</span><span class="cx">         static const JSC::GlobalObjectMethodTable s_globalObjectMethodTable;
</span><span class="cx"> 
</span><ins>+        static bool supportsLegacyProfiling(const JSC::JSGlobalObject*);
</ins><span class="cx">         static bool supportsRichSourceInfo(const JSC::JSGlobalObject*);
</span><span class="cx">         static bool shouldInterruptScript(const JSC::JSGlobalObject*);
</span><span class="cx">         static bool shouldInterruptScriptBeforeTimeout(const JSC::JSGlobalObject*);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWorkerGlobalScopeBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo JSWorkerGlobalScopeBase::s_info = { &quot;WorkerGlobalScope&quot;, &amp;JSDOMGlobalObject::s_info, 0, CREATE_METHOD_TABLE(JSWorkerGlobalScopeBase) };
</span><span class="cx"> 
</span><del>-const GlobalObjectMethodTable JSWorkerGlobalScopeBase::s_globalObjectMethodTable = { &amp;allowsAccessFrom, &amp;supportsRichSourceInfo, &amp;shouldInterruptScript, &amp;javaScriptRuntimeFlags, &amp;queueTaskToEventLoop, &amp;shouldInterruptScriptBeforeTimeout, nullptr, nullptr, nullptr, nullptr, nullptr, &amp;defaultLanguage };
</del><ins>+const GlobalObjectMethodTable JSWorkerGlobalScopeBase::s_globalObjectMethodTable = { &amp;allowsAccessFrom, &amp;supportsLegacyProfiling, &amp;supportsRichSourceInfo, &amp;shouldInterruptScript, &amp;javaScriptRuntimeFlags, &amp;queueTaskToEventLoop, &amp;shouldInterruptScriptBeforeTimeout, nullptr, nullptr, nullptr, nullptr, nullptr, &amp;defaultLanguage };
</ins><span class="cx"> 
</span><span class="cx"> JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase(JSC::VM&amp; vm, JSC::Structure* structure, PassRefPtr&lt;WorkerGlobalScope&gt; impl)
</span><span class="cx">     : JSDOMGlobalObject(vm, structure, &amp;normalWorld(vm), &amp;s_globalObjectMethodTable)
</span><span class="lines">@@ -73,6 +73,11 @@
</span><span class="cx">     return JSGlobalObject::allowsAccessFrom(object, exec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool JSWorkerGlobalScopeBase::supportsLegacyProfiling(const JSGlobalObject* object)
+{
+    return JSGlobalObject::supportsLegacyProfiling(object);
+}
+
</ins><span class="cx"> bool JSWorkerGlobalScopeBase::supportsRichSourceInfo(const JSGlobalObject* object)
</span><span class="cx"> {
</span><span class="cx">     return JSGlobalObject::supportsRichSourceInfo(object);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWorkerGlobalScopeBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx">         static const JSC::GlobalObjectMethodTable s_globalObjectMethodTable;
</span><span class="cx"> 
</span><span class="cx">         static bool allowsAccessFrom(const JSC::JSGlobalObject*, JSC::ExecState*);
</span><ins>+        static bool supportsLegacyProfiling(const JSC::JSGlobalObject*);
</ins><span class="cx">         static bool supportsRichSourceInfo(const JSC::JSGlobalObject*);
</span><span class="cx">         static bool shouldInterruptScript(const JSC::JSGlobalObject*);
</span><span class="cx">         static bool shouldInterruptScriptBeforeTimeout(const JSC::JSGlobalObject*);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptCachedFrameDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/js/ScriptCachedFrameData.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;PageGroup.h&quot;
</span><span class="cx"> #include &quot;ScriptController.h&quot;
</span><span class="cx"> #include &lt;heap/StrongInlines.h&gt;
</span><ins>+#include &lt;profiler/Profile.h&gt;
</ins><span class="cx"> #include &lt;runtime/JSLock.h&gt;
</span><span class="cx"> #include &lt;runtime/WeakGCMapInlines.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/ScriptController.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptController.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/js/ScriptController.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -52,6 +52,7 @@
</span><span class="cx"> #include &lt;debugger/Debugger.h&gt;
</span><span class="cx"> #include &lt;heap/StrongInlines.h&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><ins>+#include &lt;profiler/Profile.h&gt;
</ins><span class="cx"> #include &lt;runtime/InitializeThreading.h&gt;
</span><span class="cx"> #include &lt;runtime/JSLock.h&gt;
</span><span class="cx"> #include &lt;wtf/Threading.h&gt;
</span><span class="lines">@@ -214,6 +215,13 @@
</span><span class="cx">         attachDebugger(windowShell, nullptr);
</span><span class="cx">         windowShell-&gt;window()-&gt;setConsoleClient(nullptr);
</span><span class="cx"> 
</span><ins>+        // FIXME: We should clear console profiles for each frame as soon as the frame is destroyed.
+        // Instead of clearing all of them when the main frame is destroyed.
+        if (m_frame.isMainFrame()) {
+            if (Page* page = m_frame.page())
+                page-&gt;console().clearProfiles();
+        }
+
</ins><span class="cx">         windowShell-&gt;window()-&gt;willRemoveFromWindowShell();
</span><span class="cx">         windowShell-&gt;setWindow(newDOMWindow);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptProfilehfromrev200972trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/js/ScriptProfile.h (from rev 200972, trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h) (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptProfile.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/ScriptProfile.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2010, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScriptProfile_h
+#define ScriptProfile_h
+
+#include &lt;profiler/Profile.h&gt;
+
+namespace WebCore {
+
+typedef JSC::Profile ScriptProfile;
+
+} // namespace WebCore
+
+#endif // ScriptProfile_h
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsjsScriptProfileNodehfromrev200972trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/bindings/js/ScriptProfileNode.h (from rev 200972, trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h) (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/ScriptProfileNode.h                                (rev 0)
+++ trunk/Source/WebCore/bindings/js/ScriptProfileNode.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScriptProfileNode_h
+#define ScriptProfileNode_h
+
+#include &lt;profiler/ProfileNode.h&gt;
+
+namespace WebCore {
+
+typedef JSC::ProfileNode ScriptProfileNode;
+
+} // namespace WebCore
+
+#endif // ScriptProfileNode_h
</ins></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -264,6 +264,12 @@
</span><span class="cx"> {
</span><span class="cx">     my $interfaceName = shift;
</span><span class="cx"> 
</span><ins>+    if ($interfaceName eq &quot;ScriptProfileNode&quot;) {
+        $headerIncludes{&quot;&lt;profiler/ProfileNode.h&gt;&quot;} = 1;
+        push(@headerContent, &quot;typedef JSC::ProfileNode ScriptProfileNode;\n\n&quot;);
+        return;
+    }
+
</ins><span class="cx">     # SVGAnimatedLength/Number/etc. are typedefs and should not be forward-declared as classes.
</span><span class="cx">     return if $codeGenerator-&gt;IsSVGAnimatedType($interfaceName);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;JSNode.h&quot;
</span><span class="cx"> #include &quot;JSSVGDocument.h&quot;
</span><span class="cx"> #include &quot;JSSVGPoint.h&quot;
</span><ins>+#include &quot;JSScriptProfile.h&quot;
</ins><span class="cx"> #include &quot;JSTestCallback.h&quot;
</span><span class="cx"> #include &quot;JSTestCallbackFunction.h&quot;
</span><span class="cx"> #include &quot;JSTestNode.h&quot;
</span><span class="lines">@@ -53,6 +54,7 @@
</span><span class="cx"> #include &quot;SVGDocument.h&quot;
</span><span class="cx"> #include &quot;SVGPoint.h&quot;
</span><span class="cx"> #include &quot;SVGStaticPropertyTearOff.h&quot;
</span><ins>+#include &quot;ScriptProfile.h&quot;
</ins><span class="cx"> #include &quot;SerializedScriptValue.h&quot;
</span><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;TestObj.h&quot;
</span><span class="lines">@@ -595,6 +597,8 @@
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionNullableStringMethod(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjConstructorFunctionNullableStringStaticMethod(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionNullableStringSpecialMethod(JSC::ExecState*);
</span><ins>+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithSequenceArg(JSC::ExecState*);
+JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodReturningSequence(JSC::ExecState*);
</ins><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithEnumArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalEnumArg(JSC::ExecState*);
</span><span class="cx"> JSC::EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue(JSC::ExecState*);
</span><span class="lines">@@ -1165,6 +1169,8 @@
</span><span class="cx">     { &quot;methodWithXPathNSResolverParameter&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter), (intptr_t) (1) } },
</span><span class="cx">     { &quot;nullableStringMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionNullableStringMethod), (intptr_t) (0) } },
</span><span class="cx">     { &quot;nullableStringSpecialMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionNullableStringSpecialMethod), (intptr_t) (1) } },
</span><ins>+    { &quot;methodWithSequenceArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithSequenceArg), (intptr_t) (1) } },
+    { &quot;methodReturningSequence&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodReturningSequence), (intptr_t) (1) } },
</ins><span class="cx">     { &quot;methodWithEnumArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithEnumArg), (intptr_t) (1) } },
</span><span class="cx">     { &quot;methodWithOptionalEnumArg&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithOptionalEnumArg), (intptr_t) (0) } },
</span><span class="cx">     { &quot;methodWithOptionalEnumArgAndDefaultValue&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue), (intptr_t) (0) } },
</span><span class="lines">@@ -4194,6 +4200,40 @@
</span><span class="cx">     return JSValue::encode(result);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithSequenceArg(ExecState* state)
+{
+    JSValue thisValue = state-&gt;thisValue();
+    auto castedThis = jsDynamicCast&lt;JSTestObj*&gt;(thisValue);
+    if (UNLIKELY(!castedThis))
+        return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodWithSequenceArg&quot;);
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+    auto&amp; impl = castedThis-&gt;wrapped();
+    if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
+        return throwVMError(state, createNotEnoughArgumentsError(state));
+    auto sequenceArg = (toRefPtrNativeArray&lt;ScriptProfile, JSScriptProfile&gt;(state, state-&gt;argument(0), &amp;JSScriptProfile::toWrapped));
+    if (UNLIKELY(state-&gt;hadException()))
+        return JSValue::encode(jsUndefined());
+    impl.methodWithSequenceArg(WTFMove(sequenceArg));
+    return JSValue::encode(jsUndefined());
+}
+
+EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodReturningSequence(ExecState* state)
+{
+    JSValue thisValue = state-&gt;thisValue();
+    auto castedThis = jsDynamicCast&lt;JSTestObj*&gt;(thisValue);
+    if (UNLIKELY(!castedThis))
+        return throwThisTypeError(*state, &quot;TestObj&quot;, &quot;methodReturningSequence&quot;);
+    ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
+    auto&amp; impl = castedThis-&gt;wrapped();
+    if (UNLIKELY(state-&gt;argumentCount() &lt; 1))
+        return throwVMError(state, createNotEnoughArgumentsError(state));
+    auto longArg = convert&lt;int32_t&gt;(*state, state-&gt;argument(0), NormalConversion);
+    if (UNLIKELY(state-&gt;hadException()))
+        return JSValue::encode(jsUndefined());
+    JSValue result = jsArray(state, castedThis-&gt;globalObject(), impl.methodReturningSequence(WTFMove(longArg)));
+    return JSValue::encode(result);
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL jsTestObjPrototypeFunctionMethodWithEnumArg(ExecState* state)
</span><span class="cx"> {
</span><span class="cx">     JSValue thisValue = state-&gt;thisValue();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -117,6 +117,9 @@
</span><span class="cx">     static DOMString? nullableStringStaticMethod();
</span><span class="cx">     getter DOMString? nullableStringSpecialMethod(unsigned long index);
</span><span class="cx"> 
</span><ins>+    void methodWithSequenceArg(sequence&lt;ScriptProfile&gt; sequenceArg);
+    sequence&lt;ScriptProfile&gt; methodReturningSequence(long longArg);
+
</ins><span class="cx">     void methodWithEnumArg(TestEnumType enumArg);
</span><span class="cx">     void methodWithOptionalEnumArg(optional TestEnumType enumArg);
</span><span class="cx">     void methodWithOptionalEnumArgAndDefaultValue(optional TestEnumType enumArg = &quot;EnumValue1&quot;);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx"> #include &quot;WebKitCSSFilterValue.h&quot;
</span><span class="cx"> #include &quot;WebKitCSSRegionRule.h&quot;
</span><span class="cx"> #include &quot;WebKitCSSTransformValue.h&quot;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;bitset&gt;
</span><span class="cx"> #include &lt;limits.h&gt;
</span><span class="cx"> #include &lt;wtf/HexNumber.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -182,6 +182,7 @@
</span><span class="cx"> #include &quot;XPathNSResolver.h&quot;
</span><span class="cx"> #include &quot;XPathResult.h&quot;
</span><span class="cx"> #include &quot;htmlediting.h&quot;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;ctime&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorConsoleInstrumentationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorConsoleInstrumentation.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorConsoleInstrumentation.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/InspectorConsoleInstrumentation.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #define InspectorConsoleInstrumentation_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;InspectorInstrumentation.h&quot;
</span><ins>+#include &quot;ScriptProfile.h&quot;
</ins><span class="cx"> #include &lt;inspector/ScriptArguments.h&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -84,9 +85,9 @@
</span><span class="cx">     startProfilingImpl(instrumentingAgentsForPage(page), exec, title);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void InspectorInstrumentation::stopProfiling(Page&amp; page, JSC::ExecState* exec, const String &amp;title)
</del><ins>+inline RefPtr&lt;JSC::Profile&gt; InspectorInstrumentation::stopProfiling(Page&amp; page, JSC::ExecState* exec, const String &amp;title)
</ins><span class="cx"> {
</span><del>-    stopProfilingImpl(instrumentingAgentsForPage(page), exec, title);
</del><ins>+    return stopProfilingImpl(instrumentingAgentsForPage(page), exec, title);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/InspectorController.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -72,6 +72,7 @@
</span><span class="cx"> #include &lt;inspector/agents/InspectorAgent.h&gt;
</span><span class="cx"> #include &lt;inspector/agents/InspectorHeapAgent.h&gt;
</span><span class="cx"> #include &lt;inspector/agents/InspectorScriptProfilerAgent.h&gt;
</span><ins>+#include &lt;profiler/LegacyProfiler.h&gt;
</ins><span class="cx"> #include &lt;runtime/JSLock.h&gt;
</span><span class="cx"> #include &lt;wtf/Stopwatch.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -170,11 +171,14 @@
</span><span class="cx">     m_instrumentingAgents-&gt;setWebConsoleAgent(consoleAgentPtr.get());
</span><span class="cx">     m_agents.append(WTFMove(consoleAgentPtr));
</span><span class="cx"> 
</span><ins>+    auto timelineAgentPtr = std::make_unique&lt;InspectorTimelineAgent&gt;(pageContext, scriptProfilerAgent, heapAgent, pageAgent);
+    m_timelineAgent = timelineAgentPtr.get();
+    m_agents.append(WTFMove(timelineAgentPtr));
+
</ins><span class="cx">     auto debuggerAgentPtr = std::make_unique&lt;PageDebuggerAgent&gt;(pageContext, pageAgent, m_overlay.get());
</span><span class="cx">     PageDebuggerAgent* debuggerAgent = debuggerAgentPtr.get();
</span><span class="cx">     m_agents.append(WTFMove(debuggerAgentPtr));
</span><span class="cx"> 
</span><del>-    m_agents.append(std::make_unique&lt;InspectorTimelineAgent&gt;(pageContext, scriptProfilerAgent, heapAgent, pageAgent));
</del><span class="cx">     m_agents.append(std::make_unique&lt;InspectorDOMDebuggerAgent&gt;(pageContext, m_domAgent, debuggerAgent));
</span><span class="cx">     m_agents.append(std::make_unique&lt;InspectorApplicationCacheAgent&gt;(pageContext, pageAgent));
</span><span class="cx">     m_agents.append(std::make_unique&lt;InspectorLayerTreeAgent&gt;(pageContext));
</span><span class="lines">@@ -410,6 +414,27 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool InspectorController::legacyProfilerEnabled() const
+{
+    return m_legacyProfilerEnabled;
+}
+
+void InspectorController::setLegacyProfilerEnabled(bool enable)
+{
+    m_legacyProfilerEnabled = enable;
+
+    ErrorString unused;
+    if (enable) {
+        m_instrumentingAgents-&gt;setPersistentInspectorTimelineAgent(m_timelineAgent);
+        m_scriptDebugServer.recompileAllJSFunctions();
+        m_timelineAgent-&gt;start(unused);
+    } else {
+        m_instrumentingAgents-&gt;setPersistentInspectorTimelineAgent(nullptr);
+        m_scriptDebugServer.recompileAllJSFunctions();
+        m_timelineAgent-&gt;stop(unused);
+    }
+}
+
</ins><span class="cx"> bool InspectorController::developerExtrasEnabled() const
</span><span class="cx"> {
</span><span class="cx">     return m_page.settings().developerExtrasEnabled();
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorController.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorController.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/InspectorController.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -63,6 +63,7 @@
</span><span class="cx"> class InspectorFrontendClient;
</span><span class="cx"> class InspectorInstrumentation;
</span><span class="cx"> class InspectorPageAgent;
</span><ins>+class InspectorTimelineAgent;
</ins><span class="cx"> class InstrumentingAgents;
</span><span class="cx"> class Node;
</span><span class="cx"> class Page;
</span><span class="lines">@@ -110,6 +111,9 @@
</span><span class="cx">     void setIsUnderTest(bool isUnderTest) { m_isUnderTest = isUnderTest; }
</span><span class="cx">     WEBCORE_EXPORT void evaluateForTestInFrontend(const String&amp; script);
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT bool legacyProfilerEnabled() const;
+    WEBCORE_EXPORT void setLegacyProfilerEnabled(bool);
+
</ins><span class="cx">     InspectorClient* inspectorClient() const { return m_inspectorClient; }
</span><span class="cx">     InspectorFrontendClient* inspectorFrontendClient() const { return m_inspectorFrontendClient; }
</span><span class="cx">     InspectorPageAgent* pageAgent() const { return m_pageAgent; }
</span><span class="lines">@@ -144,9 +148,11 @@
</span><span class="cx">     Inspector::InspectorAgent* m_inspectorAgent { nullptr };
</span><span class="cx">     InspectorDOMAgent* m_domAgent { nullptr };
</span><span class="cx">     InspectorPageAgent* m_pageAgent { nullptr };
</span><ins>+    InspectorTimelineAgent* m_timelineAgent { nullptr };
</ins><span class="cx"> 
</span><span class="cx">     bool m_isUnderTest { false };
</span><span class="cx">     bool m_isAutomaticInspection { false };
</span><ins>+    bool m_legacyProfilerEnabled { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorInstrumentationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -67,6 +67,7 @@
</span><span class="cx"> #include &lt;inspector/ScriptArguments.h&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><span class="cx"> #include &lt;inspector/agents/InspectorDebuggerAgent.h&gt;
</span><ins>+#include &lt;profiler/Profile.h&gt;
</ins><span class="cx"> #include &lt;runtime/ConsoleTypes.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="lines">@@ -893,10 +894,11 @@
</span><span class="cx">         timelineAgent-&gt;startFromConsole(exec, title);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorInstrumentation::stopProfilingImpl(InstrumentingAgents&amp; instrumentingAgents, JSC::ExecState* exec, const String&amp; title)
</del><ins>+RefPtr&lt;JSC::Profile&gt; InspectorInstrumentation::stopProfilingImpl(InstrumentingAgents&amp; instrumentingAgents, JSC::ExecState* exec, const String&amp; title)
</ins><span class="cx"> {
</span><span class="cx">     if (InspectorTimelineAgent* timelineAgent = instrumentingAgents.persistentInspectorTimelineAgent())
</span><del>-        timelineAgent-&gt;stopFromConsole(exec, title);
</del><ins>+        return timelineAgent-&gt;stopFromConsole(exec, title);
+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorInstrumentation::didOpenDatabaseImpl(InstrumentingAgents&amp; instrumentingAgents, RefPtr&lt;Database&gt;&amp;&amp; database, const String&amp; domain, const String&amp; name, const String&amp; version)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorInstrumentationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -61,6 +61,10 @@
</span><span class="cx"> class ScriptCallStack;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+namespace JSC {
+class Profile;
+}
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CSSRule;
</span><span class="lines">@@ -214,7 +218,7 @@
</span><span class="cx">     static void didFireAnimationFrame(const InspectorInstrumentationCookie&amp;);
</span><span class="cx"> 
</span><span class="cx">     static void startProfiling(Page&amp;, JSC::ExecState*, const String&amp; title);
</span><del>-    static void stopProfiling(Page&amp;, JSC::ExecState*, const String&amp; title);
</del><ins>+    static RefPtr&lt;JSC::Profile&gt; stopProfiling(Page&amp;, JSC::ExecState*, const String&amp; title);
</ins><span class="cx"> 
</span><span class="cx">     static void didOpenDatabase(ScriptExecutionContext*, RefPtr&lt;Database&gt;&amp;&amp;, const String&amp; domain, const String&amp; name, const String&amp; version);
</span><span class="cx"> 
</span><span class="lines">@@ -383,7 +387,7 @@
</span><span class="cx">     static void didFireAnimationFrameImpl(const InspectorInstrumentationCookie&amp;);
</span><span class="cx"> 
</span><span class="cx">     static void startProfilingImpl(InstrumentingAgents&amp;, JSC::ExecState*, const String&amp; title);
</span><del>-    static void stopProfilingImpl(InstrumentingAgents&amp;, JSC::ExecState*, const String&amp; title);
</del><ins>+    static RefPtr&lt;JSC::Profile&gt; stopProfilingImpl(InstrumentingAgents&amp;, JSC::ExecState*, const String&amp; title);
</ins><span class="cx"> 
</span><span class="cx">     static void didOpenDatabaseImpl(InstrumentingAgents&amp;, RefPtr&lt;Database&gt;&amp;&amp;, const String&amp; domain, const String&amp; name, const String&amp; version);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> #include &lt;inspector/agents/InspectorDebuggerAgent.h&gt;
</span><span class="cx"> #include &lt;inspector/agents/InspectorHeapAgent.h&gt;
</span><span class="cx"> #include &lt;inspector/agents/InspectorScriptProfilerAgent.h&gt;
</span><ins>+#include &lt;profiler/LegacyProfiler.h&gt;
</ins><span class="cx"> #include &lt;wtf/Stopwatch.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -241,14 +242,58 @@
</span><span class="cx">     return m_environment.executionStopwatch()-&gt;elapsedTime();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorTimelineAgent::startFromConsole(JSC::ExecState*, const String&amp;)
</del><ins>+void InspectorTimelineAgent::startFromConsole(JSC::ExecState* exec, const String &amp;title)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: &lt;https://webkit.org/b/153499&gt; Web Inspector: console.profile should use the new Sampling Profiler
</span><ins>+
+    // Only allow recording of a profile if it is anonymous (empty title) or does not match
+    // the title of an already recording profile.
+    if (!title.isEmpty()) {
+        for (const TimelineRecordEntry&amp; record : m_pendingConsoleProfileRecords) {
+            String recordTitle;
+            record.data-&gt;getString(ASCIILiteral(&quot;title&quot;), recordTitle);
+            if (recordTitle == title)
+                return;
+        }
+    }
+
+    if (!m_enabled &amp;&amp; m_pendingConsoleProfileRecords.isEmpty())
+        internalStart();
+
+    JSC::LegacyProfiler::profiler()-&gt;startProfiling(exec, title, m_environment.executionStopwatch());
+
+    m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorTimelineAgent::stopFromConsole(JSC::ExecState*, const String&amp;)
</del><ins>+RefPtr&lt;JSC::Profile&gt; InspectorTimelineAgent::stopFromConsole(JSC::ExecState* exec, const String&amp; title)
</ins><span class="cx"> {
</span><span class="cx">     // FIXME: &lt;https://webkit.org/b/153499&gt; Web Inspector: console.profile should use the new Sampling Profiler
</span><ins>+
+    // Stop profiles in reverse order. If the title is empty, then stop the last profile.
+    // Otherwise, match the title of the profile to stop.
+    for (ptrdiff_t i = m_pendingConsoleProfileRecords.size() - 1; i &gt;= 0; --i) {
+        const TimelineRecordEntry&amp; record = m_pendingConsoleProfileRecords[i];
+
+        String recordTitle;
+        record.data-&gt;getString(ASCIILiteral(&quot;title&quot;), recordTitle);
+
+        if (title.isEmpty() || recordTitle == title) {
+            RefPtr&lt;JSC::Profile&gt; profile = JSC::LegacyProfiler::profiler()-&gt;stopProfiling(exec, title);
+            if (profile)
+                TimelineRecordFactory::appendProfile(record.data.get(), profile.copyRef());
+
+            didCompleteRecordEntry(record);
+
+            m_pendingConsoleProfileRecords.remove(i);
+
+            if (!m_enabledFromFrontend &amp;&amp; m_pendingConsoleProfileRecords.isEmpty())
+                internalStop();
+
+            return profile;
+        }
+    }
+
+    return nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorTimelineAgent::willCallFunction(const String&amp; scriptName, int scriptLine, Frame* frame)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorTimelineAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorTimelineAgent.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/InspectorTimelineAgent.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -41,6 +41,10 @@
</span><span class="cx"> #include &lt;inspector/ScriptDebugListener.h&gt;
</span><span class="cx"> #include &lt;wtf/Vector.h&gt;
</span><span class="cx"> 
</span><ins>+namespace JSC {
+class Profile;
+}
+
</ins><span class="cx"> namespace Inspector {
</span><span class="cx"> class InspectorHeapAgent;
</span><span class="cx"> class InspectorScriptProfilerAgent;
</span><span class="lines">@@ -110,7 +114,7 @@
</span><span class="cx"> 
</span><span class="cx">     // Methods called from WebCore.
</span><span class="cx">     void startFromConsole(JSC::ExecState*, const String &amp;title);
</span><del>-    void stopFromConsole(JSC::ExecState*, const String&amp; title);
</del><ins>+    RefPtr&lt;JSC::Profile&gt; stopFromConsole(JSC::ExecState*, const String&amp; title);
</ins><span class="cx"> 
</span><span class="cx">     // InspectorInstrumentation callbacks.
</span><span class="cx">     void didInstallTimer(int timerId, std::chrono::milliseconds timeout, bool singleShot, Frame*);
</span><span class="lines">@@ -203,6 +207,8 @@
</span><span class="cx">     int m_id { 1 };
</span><span class="cx">     int m_maxCallStackDepth { 5 };
</span><span class="cx"> 
</span><ins>+    Vector&lt;TimelineRecordEntry&gt; m_pendingConsoleProfileRecords;
+
</ins><span class="cx">     bool m_enabled { false };
</span><span class="cx">     bool m_enabledFromFrontend { false };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageDebuggerAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/PageDebuggerAgent.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> #include &lt;inspector/InjectedScriptManager.h&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStackFactory.h&gt;
</span><ins>+#include &lt;profiler/Profile.h&gt;
</ins><span class="cx"> #include &lt;wtf/NeverDestroyed.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace Inspector;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/PageRuntimeAgent.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> #include &quot;SecurityOrigin.h&quot;
</span><span class="cx"> #include &lt;inspector/InjectedScript.h&gt;
</span><span class="cx"> #include &lt;inspector/InjectedScriptManager.h&gt;
</span><ins>+#include &lt;profiler/Profile.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using Inspector::Protocol::Runtime::ExecutionContextDescription;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorScriptProfileidlfromrev200972trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/inspector/ScriptProfile.idl (from rev 200972, trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h) (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/ScriptProfile.idl                                (rev 0)
+++ trunk/Source/WebCore/inspector/ScriptProfile.idl        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    NoInterfaceObject,
+    SkipVTableValidation,
+    ExportMacro=WEBCORE_EXPORT,
+] interface ScriptProfile {
+    readonly attribute DOMString title;
+    readonly attribute unsigned long uid;
+    readonly attribute ScriptProfileNode rootNode;
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreinspectorScriptProfileNodeidlfromrev200972trunkSourceJavaScriptCoreprofilerProfilerJettisonReasonh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/inspector/ScriptProfileNode.idl (from rev 200972, trunk/Source/JavaScriptCore/profiler/ProfilerJettisonReason.h) (0 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/ScriptProfileNode.idl                                (rev 0)
+++ trunk/Source/WebCore/inspector/ScriptProfileNode.idl        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    NoInterfaceObject,
+    ImplementationLacksVTable,
+    ExportMacro=WEBCORE_EXPORT,
+] interface ScriptProfileNode {
+    readonly attribute unsigned long id;
+
+    readonly attribute DOMString functionName;
+
+    readonly attribute DOMString url;
+    readonly attribute unsigned long lineNumber;
+    readonly attribute unsigned long columnNumber;
+
+    sequence&lt;ScriptProfileNode&gt; children();
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreinspectorTimelineRecordFactorycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -39,6 +39,7 @@
</span><span class="cx"> #include &lt;inspector/ScriptBreakpoint.h&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStackFactory.h&gt;
</span><ins>+#include &lt;profiler/Profile.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace Inspector;
</span><span class="cx"> 
</span><span class="lines">@@ -151,4 +152,63 @@
</span><span class="cx">     data-&gt;setArray(ASCIILiteral(&quot;root&quot;), createQuad(quad));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static Ref&lt;Protocol::Timeline::CPUProfileNodeAggregateCallInfo&gt; buildAggregateCallInfoInspectorObject(const JSC::ProfileNode* node)
+{
+    double startTime = node-&gt;calls()[0].startTime();
+    double endTime = node-&gt;calls().last().startTime() + node-&gt;calls().last().elapsedTime();
+
+    double totalTime = 0;
+    for (const JSC::ProfileNode::Call&amp; call : node-&gt;calls())
+        totalTime += call.elapsedTime();
+
+    return Protocol::Timeline::CPUProfileNodeAggregateCallInfo::create()
+        .setCallCount(node-&gt;calls().size())
+        .setStartTime(startTime)
+        .setEndTime(endTime)
+        .setTotalTime(totalTime)
+        .release();
+}
+
+static Ref&lt;Protocol::Timeline::CPUProfileNode&gt; buildInspectorObject(const JSC::ProfileNode* node)
+{
+    auto result = Protocol::Timeline::CPUProfileNode::create()
+        .setId(node-&gt;id())
+        .setCallInfo(buildAggregateCallInfoInspectorObject(node))
+        .release();
+
+    if (!node-&gt;functionName().isEmpty())
+        result-&gt;setFunctionName(node-&gt;functionName());
+
+    if (!node-&gt;url().isEmpty()) {
+        result-&gt;setUrl(node-&gt;url());
+        result-&gt;setLineNumber(node-&gt;lineNumber());
+        result-&gt;setColumnNumber(node-&gt;columnNumber());
+    }
+
+    if (!node-&gt;children().isEmpty()) {
+        auto children = Protocol::Array&lt;Protocol::Timeline::CPUProfileNode&gt;::create();
+        for (RefPtr&lt;JSC::ProfileNode&gt; profileNode : node-&gt;children())
+            children-&gt;addItem(buildInspectorObject(profileNode.get()));
+        result-&gt;setChildren(WTFMove(children));
+    }
+
+    return result;
+}
+
+static Ref&lt;Protocol::Timeline::CPUProfile&gt; buildProfileInspectorObject(const JSC::Profile* profile)
+{
+    auto rootNodes = Protocol::Array&lt;Protocol::Timeline::CPUProfileNode&gt;::create();
+    for (RefPtr&lt;JSC::ProfileNode&gt; profileNode : profile-&gt;rootNode()-&gt;children())
+        rootNodes-&gt;addItem(buildInspectorObject(profileNode.get()));
+
+    return Protocol::Timeline::CPUProfile::create()
+        .setRootNodes(WTFMove(rootNodes))
+        .release();
+}
+
+void TimelineRecordFactory::appendProfile(InspectorObject* data, RefPtr&lt;JSC::Profile&gt;&amp;&amp; profile)
+{
+    data-&gt;setValue(ASCIILiteral(&quot;profile&quot;), buildProfileInspectorObject(profile.get()));
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorTimelineRecordFactoryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/TimelineRecordFactory.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/TimelineRecordFactory.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/inspector/TimelineRecordFactory.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -36,6 +36,10 @@
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><ins>+namespace JSC {
+class Profile;
+}
+
</ins><span class="cx"> namespace Inspector {
</span><span class="cx"> struct ScriptBreakpointAction;
</span><span class="cx"> }
</span><span class="lines">@@ -61,6 +65,7 @@
</span><span class="cx">     static Ref&lt;Inspector::InspectorObject&gt; createPaintData(const FloatQuad&amp;);
</span><span class="cx"> 
</span><span class="cx">     static void appendLayoutRoot(Inspector::InspectorObject* data, const FloatQuad&amp;);
</span><ins>+    static void appendProfile(Inspector::InspectorObject*, RefPtr&lt;JSC::Profile&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     TimelineRecordFactory() { }
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -101,6 +101,7 @@
</span><span class="cx"> #include &quot;WebKitPoint.h&quot;
</span><span class="cx"> #include &quot;WindowFeatures.h&quot;
</span><span class="cx"> #include &quot;WindowFocusAllowedIndicator.h&quot;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;algorithm&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStackFactory.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/page/Page.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -96,6 +96,7 @@
</span><span class="cx"> #include &quot;VisitedLinkStore.h&quot;
</span><span class="cx"> #include &quot;VoidCallback.h&quot;
</span><span class="cx"> #include &quot;Widget.h&quot;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;wtf/HashMap.h&gt;
</span><span class="cx"> #include &lt;wtf/RefCountedLeakCounter.h&gt;
</span><span class="cx"> #include &lt;wtf/StdLibExtras.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConsoleClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConsoleClient.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConsoleClient.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/page/PageConsoleClient.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -191,7 +191,8 @@
</span><span class="cx"> void PageConsoleClient::profileEnd(JSC::ExecState* exec, const String&amp; title)
</span><span class="cx"> {
</span><span class="cx">     // FIXME: &lt;https://webkit.org/b/153499&gt; Web Inspector: console.profile should use the new Sampling Profiler
</span><del>-    InspectorInstrumentation::stopProfiling(m_page, exec, title);
</del><ins>+    if (RefPtr&lt;JSC::Profile&gt; profile = InspectorInstrumentation::stopProfiling(m_page, exec, title))
+        m_profiles.append(WTFMove(profile));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageConsoleClient::takeHeapSnapshot(JSC::ExecState*, const String&amp; title)
</span><span class="lines">@@ -215,4 +216,9 @@
</span><span class="cx">     InspectorInstrumentation::consoleTimeStamp(m_page.mainFrame(), WTFMove(arguments));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void PageConsoleClient::clearProfiles()
+{
+    m_profiles.clear();
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageConsoleClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageConsoleClient.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageConsoleClient.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/page/PageConsoleClient.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> #define PageConsoleClient_h
</span><span class="cx"> 
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><ins>+#include &lt;profiler/Profile.h&gt;
</ins><span class="cx"> #include &lt;runtime/ConsoleClient.h&gt;
</span><span class="cx"> #include &lt;wtf/Forward.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -42,6 +43,8 @@
</span><span class="cx"> class Document;
</span><span class="cx"> class Page;
</span><span class="cx"> 
</span><ins>+typedef Vector&lt;RefPtr&lt;JSC::Profile&gt;&gt; ProfilesArray;
+
</ins><span class="cx"> class WEBCORE_EXPORT PageConsoleClient final : public JSC::ConsoleClient {
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -58,6 +61,9 @@
</span><span class="cx">     void addMessage(MessageSource, MessageLevel, const String&amp; message, RefPtr&lt;Inspector::ScriptCallStack&gt;&amp;&amp;);
</span><span class="cx">     void addMessage(MessageSource, MessageLevel, const String&amp; message, unsigned long requestIdentifier = 0, Document* = nullptr);
</span><span class="cx"> 
</span><ins>+    const ProfilesArray&amp; profiles() const { return m_profiles; }
+    void clearProfiles();
+
</ins><span class="cx"> protected:
</span><span class="cx">     void messageWithTypeAndLevel(MessageType, MessageLevel, JSC::ExecState*, RefPtr&lt;Inspector::ScriptArguments&gt;&amp;&amp;) override;
</span><span class="cx">     void count(JSC::ExecState*, RefPtr&lt;Inspector::ScriptArguments&gt;&amp;&amp;) override;
</span><span class="lines">@@ -70,6 +76,7 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     Page&amp; m_page;
</span><ins>+    ProfilesArray m_profiles;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/testing/Internals.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -125,6 +125,7 @@
</span><span class="cx"> #include &quot;WebCoreJSClientData.h&quot;
</span><span class="cx"> #include &quot;WorkerThread.h&quot;
</span><span class="cx"> #include &quot;XMLHttpRequest.h&quot;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;bytecode/CodeBlock.h&gt;
</span><span class="cx"> #include &lt;inspector/InspectorAgentBase.h&gt;
</span><span class="cx"> #include &lt;inspector/InspectorFrontendChannel.h&gt;
</span><span class="lines">@@ -388,6 +389,7 @@
</span><span class="cx">     WebCore::overrideUserPreferredLanguages(Vector&lt;String&gt;());
</span><span class="cx">     WebCore::Settings::setUsesOverlayScrollbars(false);
</span><span class="cx">     WebCore::Settings::setUsesMockScrollAnimator(false);
</span><ins>+    page.inspectorController().setLegacyProfilerEnabled(false);
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx">     page.group().captionPreferences().setCaptionsStyleSheetOverride(emptyString());
</span><span class="cx">     page.group().captionPreferences().setTestingMode(false);
</span><span class="lines">@@ -1732,6 +1734,11 @@
</span><span class="cx">     return document-&gt;frame()-&gt;editor().countMatchesForText(text, nullptr, findOptions, 1000, mark, nullptr);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const ProfilesArray&amp; Internals::consoleProfiles() const
+{
+    return contextDocument()-&gt;page()-&gt;console().profiles();
+}
+
</ins><span class="cx"> unsigned Internals::numberOfLiveNodes() const
</span><span class="cx"> {
</span><span class="cx">     unsigned nodeCount = 0;
</span><span class="lines">@@ -1760,6 +1767,17 @@
</span><span class="cx">     m_inspectorFrontend = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Internals::setLegacyJavaScriptProfilingEnabled(bool enabled, ExceptionCode&amp; ec)
+{
+    Page* page = contextDocument()-&gt;frame()-&gt;page();
+    if (!page) {
+        ec = INVALID_ACCESS_ERR;
+        return;
+    }
+
+    page-&gt;inspectorController().setLegacyProfilerEnabled(enabled);
+}
+
</ins><span class="cx"> void Internals::setInspectorIsUnderTest(bool isUnderTest, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     Page* page = contextDocument()-&gt;frame()-&gt;page();
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/testing/Internals.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -267,11 +267,14 @@
</span><span class="cx">     void insertAuthorCSS(const String&amp;, ExceptionCode&amp;) const;
</span><span class="cx">     void insertUserCSS(const String&amp;, ExceptionCode&amp;) const;
</span><span class="cx"> 
</span><ins>+    const ProfilesArray&amp; consoleProfiles() const;
+
</ins><span class="cx">     unsigned numberOfLiveNodes() const;
</span><span class="cx">     unsigned numberOfLiveDocuments() const;
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;DOMWindow&gt; openDummyInspectorFrontend(const String&amp; url);
</span><span class="cx">     void closeDummyInspectorFrontend();
</span><ins>+    void setLegacyJavaScriptProfilingEnabled(bool enabled, ExceptionCode&amp;);
</ins><span class="cx">     void setInspectorIsUnderTest(bool isUnderTest, ExceptionCode&amp;);
</span><span class="cx"> 
</span><span class="cx">     String counterValue(Element&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.idl (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.idl        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/testing/Internals.idl        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -260,10 +260,16 @@
</span><span class="cx">     [RaisesException] void setDeviceProximity(DOMString eventType, unrestricted double value, unrestricted double min, unrestricted double max);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    // As per spec: http://www.w3.org/TR/WebIDL/#idl-sequence
+    // &quot;Sequences must not be used as the type of an attribute, constant or exception field.&quot;
+    // FIXME: this will lead to BUG internals.consoleProfiles !== internals.consoleProfiles as profile will always returns new array.
+    readonly attribute ScriptProfile[] consoleProfiles;
+
</ins><span class="cx">     unsigned long numberOfLiveNodes();
</span><span class="cx">     unsigned long numberOfLiveDocuments();
</span><span class="cx">     DOMWindow openDummyInspectorFrontend(DOMString url);
</span><span class="cx">     void closeDummyInspectorFrontend();
</span><ins>+    [RaisesException] void setLegacyJavaScriptProfilingEnabled(boolean enabled);
</ins><span class="cx">     [RaisesException] void setInspectorIsUnderTest(boolean isUnderTest);
</span><span class="cx"> 
</span><span class="cx">     DOMString counterValue(Element element);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingjsWebCoreTestSupportcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/testing/js/WebCoreTestSupport.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #include &quot;WheelEventTestTrigger.h&quot;
</span><span class="cx"> #include &lt;JavaScriptCore/APICast.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/JSValueRef.h&gt;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;interpreter/CallFrame.h&gt;
</span><span class="cx"> #include &lt;runtime/IdentifierInlines.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXSLStyleSheetLibxsltcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XSLStyleSheetLibxslt.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XSLStyleSheetLibxslt.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/xml/XSLStyleSheetLibxslt.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;XMLDocumentParserScope.h&quot;
</span><span class="cx"> #include &quot;XSLImportRule.h&quot;
</span><span class="cx"> #include &quot;XSLTProcessor.h&quot;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;libxml/uri.h&gt;
</span><span class="cx"> #include &lt;libxslt/xsltutils.h&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXSLTProcessorLibxsltcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebCore/xml/XSLTProcessorLibxslt.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;XSLTExtensions.h&quot;
</span><span class="cx"> #include &quot;XSLTUnicodeSort.h&quot;
</span><span class="cx"> #include &quot;markup.h&quot;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;libxslt/imports.h&gt;
</span><span class="cx"> #include &lt;libxslt/security.h&gt;
</span><span class="cx"> #include &lt;libxslt/variables.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebKit/win/ChangeLog        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-05-16  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Unreviewed rollout r200924. Caused js/regress/string-replace-generic.html to fail.
+
+        * Interfaces/IWebInspector.idl:
+        * WebCoreStatistics.cpp:
+        * WebInspector.cpp:
+        (WebInspector::isJavaScriptProfilingEnabled):
+        (WebInspector::setJavaScriptProfilingEnabled):
+        * WebInspector.h:
+        * WebView.cpp:
+
</ins><span class="cx"> 2016-05-14  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove LegacyProfiler
</span></span></pre></div>
<a id="trunkSourceWebKitwinInterfacesIWebInspectoridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/Interfaces/IWebInspector.idl (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/Interfaces/IWebInspector.idl        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebKit/win/Interfaces/IWebInspector.idl        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -52,6 +52,9 @@
</span><span class="cx">     HRESULT isProfilingJavaScript(BOOL* isProfiling);
</span><span class="cx">     HRESULT toggleProfilingJavaScript();
</span><span class="cx"> 
</span><ins>+    HRESULT isJavaScriptProfilingEnabled(BOOL* isProfilingEnabled);
+    HRESULT setJavaScriptProfilingEnabled(BOOL enabled);
+
</ins><span class="cx">     HRESULT isTimelineProfilingEnabled(BOOL* isEnabled);
</span><span class="cx">     HRESULT setTimelineProfilingEnabled(BOOL enabled);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreStatisticscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreStatistics.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreStatistics.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebKit/win/WebCoreStatistics.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;COMPropertyBag.h&quot;
</span><span class="cx"> #include &lt;JavaScriptCore/JSLock.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/MemoryStatistics.h&gt;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;WebCore/DOMWindow.h&gt;
</span><span class="cx"> #include &lt;WebCore/FontCache.h&gt;
</span><span class="cx"> #include &lt;WebCore/GCController.h&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebInspectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebInspector.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebInspector.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebKit/win/WebInspector.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -202,6 +202,38 @@
</span><span class="cx">     return S_OK;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+HRESULT WebInspector::isJavaScriptProfilingEnabled(_Out_ BOOL* isProfilingEnabled)
+{
+    if (!isProfilingEnabled)
+        return E_POINTER;
+
+    *isProfilingEnabled = FALSE;
+
+    if (!m_inspectedWebView)
+        return S_OK;
+
+    Page* inspectedPage = m_inspectedWebView-&gt;page();
+    if (!inspectedPage)
+        return S_OK;
+
+    *isProfilingEnabled = inspectedPage-&gt;inspectorController().legacyProfilerEnabled();
+    return S_OK;
+}
+
+HRESULT WebInspector::setJavaScriptProfilingEnabled(BOOL enabled)
+{
+    if (!m_inspectedWebView)
+        return S_OK;
+
+    Page* inspectedPage = m_inspectedWebView-&gt;page();
+    if (!inspectedPage)
+        return S_OK;
+
+    inspectedPage-&gt;inspectorController().setLegacyProfilerEnabled(enabled);
+
+    return S_OK;
+}
+
</ins><span class="cx"> HRESULT WebInspector::evaluateInFrontend(_In_ BSTR bScript)
</span><span class="cx"> {
</span><span class="cx">     if (!m_inspectedWebView)
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebInspectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebInspector.h (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebInspector.h        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebKit/win/WebInspector.h        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -60,6 +60,9 @@
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE isProfilingJavaScript(_Out_ BOOL*);
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE toggleProfilingJavaScript();
</span><span class="cx"> 
</span><ins>+    virtual HRESULT STDMETHODCALLTYPE isJavaScriptProfilingEnabled(_Out_ BOOL*);
+    virtual HRESULT STDMETHODCALLTYPE setJavaScriptProfilingEnabled(BOOL);
+
</ins><span class="cx">     virtual HRESULT STDMETHODCALLTYPE evaluateInFrontend(_In_ BSTR script);
</span><span class="cx"> 
</span><span class="cx">     virtual HRESULT STDMETHODCALLTYPE isTimelineProfilingEnabled(_Out_ BOOL*);
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (200972 => 200973)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2016-05-16 22:20:16 UTC (rev 200972)
+++ trunk/Source/WebKit/win/WebView.cpp        2016-05-16 22:31:13 UTC (rev 200973)
</span><span class="lines">@@ -78,6 +78,7 @@
</span><span class="cx"> #include &lt;JavaScriptCore/InitializeThreading.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/JSCJSValue.h&gt;
</span><span class="cx"> #include &lt;JavaScriptCore/JSLock.h&gt;
</span><ins>+#include &lt;JavaScriptCore/Profile.h&gt;
</ins><span class="cx"> #include &lt;WebCore/AXObjectCache.h&gt;
</span><span class="cx"> #include &lt;WebCore/ApplicationCacheStorage.h&gt;
</span><span class="cx"> #include &lt;WebCore/BString.h&gt;
</span><span class="lines">@@ -120,6 +121,7 @@
</span><span class="cx"> #include &lt;WebCore/HitTestResult.h&gt;
</span><span class="cx"> #include &lt;WebCore/IntRect.h&gt;
</span><span class="cx"> #include &lt;WebCore/JSElement.h&gt;
</span><ins>+#include &lt;WebCore/JSScriptProfile.h&gt;
</ins><span class="cx"> #include &lt;WebCore/KeyboardEvent.h&gt;
</span><span class="cx"> #include &lt;WebCore/Logging.h&gt;
</span><span class="cx"> #include &lt;WebCore/MIMETypeRegistry.h&gt;
</span></span></pre>
</div>
</div>

</body>
</html>