Changeset 195799 in webkit


Ignore:
Timestamp:
Jan 28, 2016 7:46:16 PM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
https://bugs.webkit.org/show_bug.cgi?id=153500
<rdar://problem/24352458>

Patch by Joseph Pecoraro <Joseph Pecoraro> on 2016-01-28
Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Be more explicit about enabling legacy profiling.

  • jsc.cpp:
  • runtime/Executable.cpp:

(JSC::ScriptExecutable::newCodeBlockFor):

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::hasLegacyProfiler):
(JSC::JSGlobalObject::createProgramCodeBlock):
(JSC::JSGlobalObject::createEvalCodeBlock):
(JSC::JSGlobalObject::createModuleProgramCodeBlock):
(JSC::JSGlobalObject::hasProfiler): Deleted.

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::supportsLegacyProfiling):
(JSC::JSGlobalObject::supportsProfiling): Deleted.

Source/WebCore:

  • bindings/js/JSDOMWindowBase.cpp:

(WebCore::JSDOMWindowBase::supportsLegacyProfiling):
(WebCore::JSDOMWindowBase::supportsRichSourceInfo):
(WebCore::JSDOMWindowBase::supportsProfiling): Deleted.

  • bindings/js/JSDOMWindowBase.h:
  • bindings/js/JSWorkerGlobalScopeBase.cpp:

(WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
(WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.

  • bindings/js/JSWorkerGlobalScopeBase.h:
  • inspector/InspectorController.h:
  • inspector/InspectorController.cpp:

(WebCore::InspectorController::legacyProfilerEnabled):
(WebCore::InspectorController::setLegacyProfilerEnabled):
Be more explicit about enabling legacy profiling.

  • inspector/InspectorTimelineAgent.cpp:

(WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
TimelineAgent doesn't need to recompile if using the sampling profiler.
This breaks console.profile, but console.profile should move to using
the sampling profiler as well.

(WebCore::InspectorTimelineAgent::startFromConsole):
(WebCore::InspectorTimelineAgent::stopFromConsole):
(WebCore::startProfiling): Deleted.
(WebCore::stopProfiling): Deleted.
Inlined the use once static functions.

  • page/PageConsoleClient.cpp:

(WebCore::PageConsoleClient::profile):
(WebCore::PageConsoleClient::profileEnd):
Added FIXMEs for improving console.profile and profileEnd.

  • testing/Internals.cpp:

(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
(WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.

  • testing/Internals.h:
  • testing/Internals.idl:

Be more explicit about enabling legacy profiling.

LayoutTests:

  • fast/profiler/*.html

Be more explicit about enabling legacy profiling.

  • inspector/sampling-profiler/eval-source-url.html

Remove an inner loop that was causing tail call optimizations
to eliminate the sourceURL we were expecting.

Location:
trunk
Files:
62 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r195796 r195799  
     12016-01-28  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
     4        https://bugs.webkit.org/show_bug.cgi?id=153500
     5        <rdar://problem/24352458>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * fast/profiler/*.html
     10        Be more explicit about enabling legacy profiling.
     11
     12        * inspector/sampling-profiler/eval-source-url.html
     13        Remove an inner loop that was causing tail call optimizations
     14        to eliminate the sourceURL we were expecting.
     15
    1162016-01-28  Brady Eidson  <beidson@apple.com>
    217
  • trunk/LayoutTests/fast/profiler/anonymous-event-handler.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/anonymous-function-called-from-different-contexts.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/anonymous-function-calls-built-in-functions.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/anonymous-function-calls-eval.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/anonymous-functions-with-display-names.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function anonymousFunctionGenerator(iterations)
  • trunk/LayoutTests/fast/profiler/apply.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/built-in-function-calls-anonymous.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/built-in-function-calls-user-defined-function.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/call-register-leak.html

    r132700 r195799  
    55    testRunner.dumpAsText();
    66if (window.internals)
    7     internals.setJavaScriptProfilingEnabled(true);
     7    internals.setLegacyJavaScriptProfilingEnabled(true);
    88
    99function log(s)
  • trunk/LayoutTests/fast/profiler/call.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/calling-the-function-that-started-the-profiler-from-another-scope.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/compare-multiple-profiles.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010var j = 0;
  • trunk/LayoutTests/fast/profiler/constructor.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/dead-time.html

    r132700 r195799  
    88}
    99if (window.internals)
    10     internals.setJavaScriptProfilingEnabled(true);
     10    internals.setLegacyJavaScriptProfilingEnabled(true);
    1111
    1212function startTest()
  • trunk/LayoutTests/fast/profiler/document-dot-write.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/event-handler.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/execution-context-and-eval-on-same-line.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/inline-event-handler.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/many-calls-in-the-same-scope.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-anonymous-function-calls.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/multiple-and-different-scoped-function-calls.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/multiple-anonymous-functions-called-from-the-same-function.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/multiple-frames.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/named-functions-with-display-names.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function function0()
  • trunk/LayoutTests/fast/profiler/nested-anonymous-functon.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/nested-start-and-stop-profiler.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/no-execution-context.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99</script>
    1010</head>
  • trunk/LayoutTests/fast/profiler/one-execution-context.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/profile-calls-in-included-file.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/profile-with-no-title.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location-but-stop-profiling-outside-the-nesting.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/profiling-from-a-nested-location.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/simple-event-call.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/simple-no-level-change.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/start-and-stop-profiler-multiple-times.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/start-and-stop-profiling-in-the-same-function.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/start-but-dont-stop-profiling.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/stop-profiling-after-setTimeout.html

    r132700 r195799  
    88}
    99if (window.internals)
    10     internals.setJavaScriptProfilingEnabled(true);
     10    internals.setLegacyJavaScriptProfilingEnabled(true);
    1111
    1212function startTest()
  • trunk/LayoutTests/fast/profiler/stop-then-function-call.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010var j = 0;
  • trunk/LayoutTests/fast/profiler/throw-exception-from-eval.html-disabled

    r124410 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.settings.setJavaScriptProfilingEnabled(true);
     8    internals.settings.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010console.profile("Throw within an eval.");
  • trunk/LayoutTests/fast/profiler/two-execution-contexts.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/user-defined-function-calls-built-in-functions.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/fast/profiler/window-dot-eval.html

    r132700 r195799  
    66    testRunner.dumpAsText();
    77if (window.internals)
    8     internals.setJavaScriptProfilingEnabled(true);
     8    internals.setLegacyJavaScriptProfilingEnabled(true);
    99
    1010function startTest()
  • trunk/LayoutTests/inspector/sampling-profiler/eval-source-url.html

    r195376 r195799  
    2222
    2323function bar() {
    24     for (let i = 0; i < 2; i++)
    25         eval("//# sourceURL=eval.js\nfoo();");
     24    eval("//# sourceURL=eval.js\nfoo();");
    2625}
    2726noInline(bar);
  • trunk/Source/JavaScriptCore/ChangeLog

    r195788 r195799  
     12016-01-28  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
     4        https://bugs.webkit.org/show_bug.cgi?id=153500
     5        <rdar://problem/24352458>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        Be more explicit about enabling legacy profiling.
     10
     11        * jsc.cpp:
     12        * runtime/Executable.cpp:
     13        (JSC::ScriptExecutable::newCodeBlockFor):
     14        * runtime/JSGlobalObject.cpp:
     15        (JSC::JSGlobalObject::hasLegacyProfiler):
     16        (JSC::JSGlobalObject::createProgramCodeBlock):
     17        (JSC::JSGlobalObject::createEvalCodeBlock):
     18        (JSC::JSGlobalObject::createModuleProgramCodeBlock):
     19        (JSC::JSGlobalObject::hasProfiler): Deleted.
     20        * runtime/JSGlobalObject.h:
     21        (JSC::JSGlobalObject::supportsLegacyProfiling):
     22        (JSC::JSGlobalObject::supportsProfiling): Deleted.
     23
    1242016-01-28  Yusuke Suzuki  <utatane.tea@gmail.com>
    225
  • trunk/Source/JavaScriptCore/jsc.cpp

    r195376 r195799  
    778778
    779779const ClassInfo GlobalObject::s_info = { "global", &JSGlobalObject::s_info, nullptr, CREATE_METHOD_TABLE(GlobalObject) };
    780 const GlobalObjectMethodTable GlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptRuntimeFlags, 0, &shouldInterruptScriptBeforeTimeout, &moduleLoaderResolve, &moduleLoaderFetch, nullptr, nullptr, nullptr };
     780const GlobalObjectMethodTable GlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsLegacyProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptRuntimeFlags, 0, &shouldInterruptScriptBeforeTimeout, &moduleLoaderResolve, &moduleLoaderFetch, nullptr, nullptr, nullptr };
    781781
    782782
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r194449 r195799  
    298298    ParserError error;
    299299    DebuggerMode debuggerMode = globalObject->hasDebugger() ? DebuggerOn : DebuggerOff;
    300     ProfilerMode profilerMode = globalObject->hasProfiler() ? ProfilerOn : ProfilerOff;
     300    ProfilerMode profilerMode = globalObject->hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
    301301    UnlinkedFunctionCodeBlock* unlinkedCodeBlock =
    302302        executable->m_unlinkedExecutable->unlinkedCodeBlockFor(
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp

    r195460 r195799  
    174174const ClassInfo JSGlobalObject::s_info = { "GlobalObject", &Base::s_info, &globalObjectTable, CREATE_METHOD_TABLE(JSGlobalObject) };
    175175
    176 const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptRuntimeFlags, nullptr, &shouldInterruptScriptBeforeTimeout, nullptr, nullptr, nullptr, nullptr, nullptr };
     176const GlobalObjectMethodTable JSGlobalObject::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsLegacyProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptRuntimeFlags, nullptr, &shouldInterruptScriptBeforeTimeout, nullptr, nullptr, nullptr, nullptr, nullptr };
    177177
    178178/* Source for JSGlobalObject.lut.h
     
    613613}
    614614
    615 bool JSGlobalObject::hasProfiler() const
    616 {
    617     if (m_debugger && m_debugger->hasProfilingClient())
    618         return true;
    619 
    620     return globalObjectMethodTable()->supportsProfiling(this);
     615bool JSGlobalObject::hasLegacyProfiler() const
     616{
     617    return globalObjectMethodTable()->supportsLegacyProfiling(this);
    621618}
    622619
     
    980977    JSParserStrictMode strictMode = executable->isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
    981978    DebuggerMode debuggerMode = hasDebugger() ? DebuggerOn : DebuggerOff;
    982     ProfilerMode profilerMode = hasProfiler() ? ProfilerOn : ProfilerOff;
     979    ProfilerMode profilerMode = hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
    983980    UnlinkedProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()->getProgramCodeBlock(
    984981        vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, strictMode,
     
    1001998    JSParserStrictMode strictMode = executable->isStrictMode() ? JSParserStrictMode::Strict : JSParserStrictMode::NotStrict;
    1002999    DebuggerMode debuggerMode = hasDebugger() ? DebuggerOn : DebuggerOff;
    1003     ProfilerMode profilerMode = hasProfiler() ? ProfilerOn : ProfilerOff;
     1000    ProfilerMode profilerMode = hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
    10041001    UnlinkedEvalCodeBlock* unlinkedCodeBlock = vm().codeCache()->getEvalCodeBlock(
    10051002        vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, strictMode, thisTDZMode, isArrowFunctionContext, debuggerMode, profilerMode, error, variablesUnderTDZ);
     
    10201017    ParserError error;
    10211018    DebuggerMode debuggerMode = hasDebugger() ? DebuggerOn : DebuggerOff;
    1022     ProfilerMode profilerMode = hasProfiler() ? ProfilerOn : ProfilerOff;
     1019    ProfilerMode profilerMode = hasLegacyProfiler() ? ProfilerOn : ProfilerOff;
    10231020    UnlinkedModuleProgramCodeBlock* unlinkedCodeBlock = vm().codeCache()->getModuleProgramCodeBlock(
    10241021        vm(), executable, executable->source(), JSParserBuiltinMode::NotBuiltin, debuggerMode, profilerMode, error);
  • trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h

    r194869 r195799  
    142142    AllowsAccessFromFunctionPtr allowsAccessFrom;
    143143
    144     typedef bool (*SupportsProfilingFunctionPtr)(const JSGlobalObject*);
    145     SupportsProfilingFunctionPtr supportsProfiling;
     144    typedef bool (*SupportsLegacyProfilingFunctionPtr)(const JSGlobalObject*);
     145    SupportsLegacyProfilingFunctionPtr supportsLegacyProfiling;
    146146
    147147    typedef bool (*SupportsRichSourceInfoFunctionPtr)(const JSGlobalObject*);
     
    361361
    362362    bool hasDebugger() const { return m_debugger; }
    363     bool hasProfiler() const;
     363    bool hasLegacyProfiler() const;
    364364    const RuntimeFlags& runtimeFlags() const { return m_runtimeFlags; }
    365365
     
    620620
    621621    static bool allowsAccessFrom(const JSGlobalObject*, ExecState*) { return true; }
    622     static bool supportsProfiling(const JSGlobalObject*) { return false; }
     622    static bool supportsLegacyProfiling(const JSGlobalObject*) { return false; }
    623623    static bool supportsRichSourceInfo(const JSGlobalObject*) { return true; }
    624624
  • trunk/Source/WebCore/ChangeLog

    r195798 r195799  
     12016-01-28  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        Web Inspector: InspectorTimelineAgent doesn't need to recompile functions because it now uses the sampling profiler
     4        https://bugs.webkit.org/show_bug.cgi?id=153500
     5        <rdar://problem/24352458>
     6
     7        Reviewed by Timothy Hatcher.
     8
     9        * bindings/js/JSDOMWindowBase.cpp:
     10        (WebCore::JSDOMWindowBase::supportsLegacyProfiling):
     11        (WebCore::JSDOMWindowBase::supportsRichSourceInfo):
     12        (WebCore::JSDOMWindowBase::supportsProfiling): Deleted.
     13        * bindings/js/JSDOMWindowBase.h:
     14        * bindings/js/JSWorkerGlobalScopeBase.cpp:
     15        (WebCore::JSWorkerGlobalScopeBase::supportsLegacyProfiling):
     16        (WebCore::JSWorkerGlobalScopeBase::supportsProfiling): Deleted.
     17        * bindings/js/JSWorkerGlobalScopeBase.h:
     18        * inspector/InspectorController.h:
     19        * inspector/InspectorController.cpp:
     20        (WebCore::InspectorController::legacyProfilerEnabled):
     21        (WebCore::InspectorController::setLegacyProfilerEnabled):
     22        Be more explicit about enabling legacy profiling.
     23
     24        * inspector/InspectorTimelineAgent.cpp:
     25        (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
     26        (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend): Deleted.
     27        TimelineAgent doesn't need to recompile if using the sampling profiler.
     28        This breaks console.profile, but console.profile should move to using
     29        the sampling profiler as well.
     30
     31        (WebCore::InspectorTimelineAgent::startFromConsole):
     32        (WebCore::InspectorTimelineAgent::stopFromConsole):
     33        (WebCore::startProfiling): Deleted.
     34        (WebCore::stopProfiling): Deleted.
     35        Inlined the use once static functions.
     36
     37        * page/PageConsoleClient.cpp:
     38        (WebCore::PageConsoleClient::profile):
     39        (WebCore::PageConsoleClient::profileEnd):
     40        Added FIXMEs for improving console.profile and profileEnd.
     41
     42        * testing/Internals.cpp:
     43        (WebCore::Internals::resetToConsistentState):
     44        (WebCore::Internals::setLegacyJavaScriptProfilingEnabled):
     45        (WebCore::Internals::setJavaScriptProfilingEnabled): Deleted.
     46        * testing/Internals.h:
     47        * testing/Internals.idl:
     48        Be more explicit about enabling legacy profiling.
     49
    1502016-01-28  Chris Dumez  <cdumez@apple.com>
    251
  • trunk/Source/WebCore/bindings/js/JSDOMWindowBase.cpp

    r194960 r195799  
    6464const ClassInfo JSDOMWindowBase::s_info = { "Window", &JSDOMGlobalObject::s_info, 0, CREATE_METHOD_TABLE(JSDOMWindowBase) };
    6565
    66 const GlobalObjectMethodTable JSDOMWindowBase::s_globalObjectMethodTable = { &shouldAllowAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptRuntimeFlags, &queueTaskToEventLoop, &shouldInterruptScriptBeforeTimeout, &moduleLoaderResolve, &moduleLoaderFetch, nullptr, nullptr, &moduleLoaderEvaluate };
     66const GlobalObjectMethodTable JSDOMWindowBase::s_globalObjectMethodTable = { &shouldAllowAccessFrom, &supportsLegacyProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptRuntimeFlags, &queueTaskToEventLoop, &shouldInterruptScriptBeforeTimeout, &moduleLoaderResolve, &moduleLoaderFetch, nullptr, nullptr, &moduleLoaderEvaluate };
    6767
    6868JSDOMWindowBase::JSDOMWindowBase(VM& vm, Structure* structure, PassRefPtr<DOMWindow> window, JSDOMWindowShell* shell)
     
    116116}
    117117
    118 bool JSDOMWindowBase::supportsProfiling(const JSGlobalObject* object)
     118bool JSDOMWindowBase::supportsLegacyProfiling(const JSGlobalObject* object)
    119119{
    120120    const JSDOMWindowBase* thisObject = static_cast<const JSDOMWindowBase*>(object);
     
    127127        return false;
    128128
    129     return page->inspectorController().profilerEnabled();
     129    return page->inspectorController().legacyProfilerEnabled();
    130130}
    131131
     
    143143    bool enabled = page->inspectorController().enabled();
    144144    ASSERT(enabled || !thisObject->debugger());
    145     ASSERT(enabled || !supportsProfiling(thisObject));
     145    ASSERT(enabled || !supportsLegacyProfiling(thisObject));
    146146    return enabled;
    147147}
  • trunk/Source/WebCore/bindings/js/JSDOMWindowBase.h

    r194960 r195799  
    6161        static const JSC::GlobalObjectMethodTable s_globalObjectMethodTable;
    6262
    63         static bool supportsProfiling(const JSC::JSGlobalObject*);
     63        static bool supportsLegacyProfiling(const JSC::JSGlobalObject*);
    6464        static bool supportsRichSourceInfo(const JSC::JSGlobalObject*);
    6565        static bool shouldInterruptScript(const JSC::JSGlobalObject*);
  • trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.cpp

    r193366 r195799  
    4444const ClassInfo JSWorkerGlobalScopeBase::s_info = { "WorkerGlobalScope", &JSDOMGlobalObject::s_info, 0, CREATE_METHOD_TABLE(JSWorkerGlobalScopeBase) };
    4545
    46 const GlobalObjectMethodTable JSWorkerGlobalScopeBase::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptRuntimeFlags, &queueTaskToEventLoop, &shouldInterruptScriptBeforeTimeout, nullptr, nullptr, nullptr, nullptr, nullptr };
     46const GlobalObjectMethodTable JSWorkerGlobalScopeBase::s_globalObjectMethodTable = { &allowsAccessFrom, &supportsLegacyProfiling, &supportsRichSourceInfo, &shouldInterruptScript, &javaScriptRuntimeFlags, &queueTaskToEventLoop, &shouldInterruptScriptBeforeTimeout, nullptr, nullptr, nullptr, nullptr, nullptr };
    4747
    4848JSWorkerGlobalScopeBase::JSWorkerGlobalScopeBase(JSC::VM& vm, JSC::Structure* structure, PassRefPtr<WorkerGlobalScope> impl)
     
    7373}
    7474
    75 bool JSWorkerGlobalScopeBase::supportsProfiling(const JSGlobalObject* object)
     75bool JSWorkerGlobalScopeBase::supportsLegacyProfiling(const JSGlobalObject* object)
    7676{
    77     return JSGlobalObject::supportsProfiling(object);
     77    return JSGlobalObject::supportsLegacyProfiling(object);
    7878}
    7979
  • trunk/Source/WebCore/bindings/js/JSWorkerGlobalScopeBase.h

    r191887 r195799  
    5454
    5555        static bool allowsAccessFrom(const JSC::JSGlobalObject*, JSC::ExecState*);
    56         static bool supportsProfiling(const JSC::JSGlobalObject*);
     56        static bool supportsLegacyProfiling(const JSC::JSGlobalObject*);
    5757        static bool supportsRichSourceInfo(const JSC::JSGlobalObject*);
    5858        static bool shouldInterruptScript(const JSC::JSGlobalObject*);
  • trunk/Source/WebCore/inspector/InspectorController.cpp

    r194496 r195799  
    404404}
    405405
    406 bool InspectorController::profilerEnabled() const
    407 {
    408     return m_instrumentingAgents->persistentInspectorTimelineAgent();
    409 }
    410 
    411 void InspectorController::setProfilerEnabled(bool enable)
    412 {
    413     ErrorString unused;
    414 
    415     if (enable) {
    416         m_instrumentingAgents->setPersistentInspectorTimelineAgent(m_timelineAgent);
    417         m_timelineAgent->start(unused);
    418     } else {
    419         m_instrumentingAgents->setPersistentInspectorTimelineAgent(nullptr);
    420         m_timelineAgent->stop(unused);
    421     }
     406bool InspectorController::legacyProfilerEnabled() const
     407{
     408    return m_legacyProfilerEnabled;
     409}
     410
     411void InspectorController::setLegacyProfilerEnabled(bool enable)
     412{
     413    m_legacyProfilerEnabled = enable;
     414
     415    m_instrumentingAgents->setPersistentInspectorTimelineAgent(enable ? m_timelineAgent : nullptr);
     416    m_scriptDebugServer.recompileAllJSFunctions();
    422417}
    423418
  • trunk/Source/WebCore/inspector/InspectorController.h

    r194242 r195799  
    112112    WEBCORE_EXPORT void evaluateForTestInFrontend(const String& script);
    113113
    114     WEBCORE_EXPORT bool profilerEnabled() const;
    115     WEBCORE_EXPORT void setProfilerEnabled(bool);
     114    WEBCORE_EXPORT bool legacyProfilerEnabled() const;
     115    WEBCORE_EXPORT void setLegacyProfilerEnabled(bool);
    116116
    117117    InspectorClient* inspectorClient() const { return m_inspectorClient; }
     
    152152    bool m_isUnderTest { false };
    153153    bool m_isAutomaticInspection { false };
     154    bool m_legacyProfilerEnabled { false };
    154155};
    155156
  • trunk/Source/WebCore/inspector/InspectorTimelineAgent.cpp

    r194871 r195799  
    8585{
    8686    m_instrumentingAgents.setPersistentInspectorTimelineAgent(this);
    87 
    88     // Recompile to include profiling information.
    89     // FIXME: This doesn't seem like the most appropriate place.
    90     m_environment.scriptDebugServer().recompileAllJSFunctions();
    91 }
    92 
    93 void InspectorTimelineAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason reason)
     87}
     88
     89void InspectorTimelineAgent::willDestroyFrontendAndBackend(Inspector::DisconnectReason)
    9490{
    9591    m_instrumentingAgents.setPersistentInspectorTimelineAgent(nullptr);
    96 
    97     if (reason != Inspector::DisconnectReason::InspectedTargetDestroyed)
    98         m_environment.scriptDebugServer().recompileAllJSFunctions();
    9992
    10093    ErrorString unused;
     
    204197}
    205198
    206 static inline void startProfiling(JSC::ExecState* exec, const String& title, RefPtr<Stopwatch>&& stopwatch)
    207 {
    208     JSC::LegacyProfiler::profiler()->startProfiling(exec, title, WTFMove(stopwatch));
    209 }
    210 
    211 static inline RefPtr<JSC::Profile> stopProfiling(JSC::ExecState* exec, const String& title)
    212 {
    213     return JSC::LegacyProfiler::profiler()->stopProfiling(exec, title);
    214 }
    215 
    216199void InspectorTimelineAgent::startFromConsole(JSC::ExecState* exec, const String &title)
    217200{
     201    // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler
     202
    218203    // Only allow recording of a profile if it is anonymous (empty title) or does not match
    219204    // the title of an already recording profile.
     
    230215        internalStart();
    231216
    232     startProfiling(exec, title, m_environment.executionStopwatch());
     217    JSC::LegacyProfiler::profiler()->startProfiling(exec, title, m_environment.executionStopwatch());
    233218
    234219    m_pendingConsoleProfileRecords.append(createRecordEntry(TimelineRecordFactory::createConsoleProfileData(title), TimelineRecordType::ConsoleProfile, true, frameFromExecState(exec)));
     
    237222RefPtr<JSC::Profile> InspectorTimelineAgent::stopFromConsole(JSC::ExecState* exec, const String& title)
    238223{
     224    // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler
     225
    239226    // Stop profiles in reverse order. If the title is empty, then stop the last profile.
    240227    // Otherwise, match the title of the profile to stop.
     
    246233
    247234        if (title.isEmpty() || recordTitle == title) {
    248             RefPtr<JSC::Profile> profile = stopProfiling(exec, title);
     235            RefPtr<JSC::Profile> profile = JSC::LegacyProfiler::profiler()->stopProfiling(exec, title);
    249236            if (profile)
    250237                TimelineRecordFactory::appendProfile(record.data.get(), profile.copyRef());
  • trunk/Source/WebCore/page/PageConsoleClient.cpp

    r194496 r195799  
    185185void PageConsoleClient::profile(JSC::ExecState* exec, const String& title)
    186186{
     187    // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler
    187188    InspectorInstrumentation::startProfiling(m_page, exec, title);
    188189}
     
    190191void PageConsoleClient::profileEnd(JSC::ExecState* exec, const String& title)
    191192{
     193    // FIXME: <https://webkit.org/b/153499> Web Inspector: console.profile should use the new Sampling Profiler
    192194    if (RefPtr<JSC::Profile> profile = InspectorInstrumentation::stopProfiling(m_page, exec, title))
    193195        m_profiles.append(WTFMove(profile));
  • trunk/Source/WebCore/testing/Internals.cpp

    r195685 r195799  
    373373    WebCore::overrideUserPreferredLanguages(Vector<String>());
    374374    WebCore::Settings::setUsesOverlayScrollbars(false);
    375     page->inspectorController().setProfilerEnabled(false);
     375    page->inspectorController().setLegacyProfilerEnabled(false);
    376376#if ENABLE(VIDEO_TRACK)
    377377    page->group().captionPreferences()->setCaptionsStyleSheetOverride(emptyString());
     
    18401840}
    18411841
    1842 void Internals::setJavaScriptProfilingEnabled(bool enabled, ExceptionCode& ec)
     1842void Internals::setLegacyJavaScriptProfilingEnabled(bool enabled, ExceptionCode& ec)
    18431843{
    18441844    Page* page = contextDocument()->frame()->page();
     
    18481848    }
    18491849
    1850     page->inspectorController().setProfilerEnabled(enabled);
     1850    page->inspectorController().setLegacyProfilerEnabled(enabled);
    18511851}
    18521852
  • trunk/Source/WebCore/testing/Internals.h

    r195685 r195799  
    279279    RefPtr<DOMWindow> openDummyInspectorFrontend(const String& url);
    280280    void closeDummyInspectorFrontend();
    281     void setJavaScriptProfilingEnabled(bool enabled, ExceptionCode&);
     281    void setLegacyJavaScriptProfilingEnabled(bool enabled, ExceptionCode&);
    282282    void setInspectorIsUnderTest(bool isUnderTest, ExceptionCode&);
    283283
  • trunk/Source/WebCore/testing/Internals.idl

    r195685 r195799  
    264264    DOMWindow openDummyInspectorFrontend(DOMString url);
    265265    void closeDummyInspectorFrontend();
    266     [RaisesException] void setJavaScriptProfilingEnabled(boolean creates);
     266    [RaisesException] void setLegacyJavaScriptProfilingEnabled(boolean enabled);
    267267    [RaisesException] void setInspectorIsUnderTest(boolean isUnderTest);
    268268
Note: See TracChangeset for help on using the changeset viewer.