<!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>[188810] trunk/Source</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/188810">188810</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-21 17:53:55 -0700 (Fri, 21 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/188792">r188792</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/188803">r188803</a>.
https://bugs.webkit.org/show_bug.cgi?id=148347

broke lots of tests, ggaren is going to investigate and reland
(Requested by thorton on #webkit).

Reverted changesets:

&quot;Unify code paths for manually deleting all code&quot;
https://bugs.webkit.org/show_bug.cgi?id=148280
http://trac.webkit.org/changeset/188792

&quot;Debugger's VM should never be null&quot;
https://bugs.webkit.org/show_bug.cgi?id=148341
http://trac.webkit.org/changeset/188803</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggercpp">trunk/Source/JavaScriptCore/debugger/Debugger.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerh">trunk/Source/JavaScriptCore/debugger/Debugger.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeaph">trunk/Source/JavaScriptCore/heap/Heap.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServercpp">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServerh">trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptDebugServercpp">trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptDebugServerh">trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp">trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp</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="#trunkSourceJavaScriptCoreruntimeVMEntryScopecpp">trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeVMEntryScopeh">trunk/Source/JavaScriptCore/runtime/VMEntryScope.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsWorkerScriptDebugServercpp">trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorPageScriptDebugServercpp">trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebScriptDebuggermm">trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-08-21  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r188792 and r188803.
+        https://bugs.webkit.org/show_bug.cgi?id=148347
+
+        broke lots of tests, ggaren is going to investigate and reland
+        (Requested by thorton on #webkit).
+
+        Reverted changesets:
+
+        &quot;Unify code paths for manually deleting all code&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=148280
+        http://trac.webkit.org/changeset/188792
+
+        &quot;Debugger's VM should never be null&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=148341
+        http://trac.webkit.org/changeset/188803
+
</ins><span class="cx"> 2015-08-21  Sukolsak Sakshuwong  &lt;sukolsak@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Parse control flow statements in WebAssembly
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.cpp (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -35,6 +35,72 @@
</span><span class="cx"> #include &quot;Protect.h&quot;
</span><span class="cx"> #include &quot;VMEntryScope.h&quot;
</span><span class="cx"> 
</span><ins>+namespace {
+
+using namespace JSC;
+
+class Recompiler : public MarkedBlock::VoidFunctor {
+public:
+    Recompiler(JSC::Debugger*);
+    ~Recompiler();
+    IterationStatus operator()(JSCell*);
+
+private:
+    typedef HashSet&lt;FunctionExecutable*&gt; FunctionExecutableSet;
+    typedef HashMap&lt;SourceProvider*, ExecState*&gt; SourceProviderMap;
+    
+    void visit(JSCell*);
+    
+    JSC::Debugger* m_debugger;
+    FunctionExecutableSet m_functionExecutables;
+    SourceProviderMap m_sourceProviders;
+};
+
+inline Recompiler::Recompiler(JSC::Debugger* debugger)
+    : m_debugger(debugger)
+{
+}
+
+inline Recompiler::~Recompiler()
+{
+    // Call sourceParsed() after reparsing all functions because it will execute
+    // JavaScript in the inspector.
+    SourceProviderMap::const_iterator end = m_sourceProviders.end();
+    for (SourceProviderMap::const_iterator iter = m_sourceProviders.begin(); iter != end; ++iter)
+        m_debugger-&gt;sourceParsed(iter-&gt;value, iter-&gt;key, -1, String());
+}
+
+inline void Recompiler::visit(JSCell* cell)
+{
+    if (!cell-&gt;inherits(JSFunction::info()))
+        return;
+
+    JSFunction* function = jsCast&lt;JSFunction*&gt;(cell);
+    if (function-&gt;executable()-&gt;isHostFunction())
+        return;
+
+    FunctionExecutable* executable = function-&gt;jsExecutable();
+
+    // Check if the function is already in the set - if so,
+    // we've already retranslated it, nothing to do here.
+    if (!m_functionExecutables.add(executable).isNewEntry)
+        return;
+
+    ExecState* exec = function-&gt;scope()-&gt;globalObject()-&gt;JSGlobalObject::globalExec();
+    executable-&gt;clearCode();
+    executable-&gt;clearUnlinkedCodeForRecompilation();
+    if (m_debugger == function-&gt;scope()-&gt;globalObject()-&gt;debugger())
+        m_sourceProviders.add(executable-&gt;source().provider(), exec);
+}
+
+inline IterationStatus Recompiler::operator()(JSCell* cell)
+{
+    visit(cell);
+    return IterationStatus::Continue;
+}
+
+} // namespace
+
</ins><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="cx"> class DebuggerPausedScope {
</span><span class="lines">@@ -79,8 +145,8 @@
</span><span class="cx">     Debugger&amp; m_debugger;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-Debugger::Debugger(VM&amp; vm, bool isInWorkerThread)
-    : m_vm(vm)
</del><ins>+Debugger::Debugger(bool isInWorkerThread)
+    : m_vm(nullptr)
</ins><span class="cx">     , m_pauseOnExceptionsState(DontPauseOnExceptions)
</span><span class="cx">     , m_pauseOnNextStatement(false)
</span><span class="cx">     , m_isPaused(false)
</span><span class="lines">@@ -108,17 +174,12 @@
</span><span class="cx"> void Debugger::attach(JSGlobalObject* globalObject)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!globalObject-&gt;debugger());
</span><ins>+    if (!m_vm)
+        m_vm = &amp;globalObject-&gt;vm();
+    else
+        ASSERT(m_vm == &amp;globalObject-&gt;vm());
</ins><span class="cx">     globalObject-&gt;setDebugger(this);
</span><span class="cx">     m_globalObjects.add(globalObject);
</span><del>-
-    // Call sourceParsed() because it will execute JavaScript in the inspector.
-    for (size_t i = 0; i &lt; m_vm.heap.compiledCode().size(); ++i) {
-        ExecutableBase* base = m_vm.heap.compiledCode()[i];
-        if (!base-&gt;isFunctionExecutable())
-            continue;
-        FunctionExecutable* executable = static_cast&lt;FunctionExecutable*&gt;(base);
-        sourceParsed(globalObject-&gt;globalExec(), executable-&gt;source().provider(), -1, String());
-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Debugger::detach(JSGlobalObject* globalObject, ReasonForDetach reason)
</span><span class="lines">@@ -142,6 +203,8 @@
</span><span class="cx">         clearDebuggerRequests(globalObject);
</span><span class="cx"> 
</span><span class="cx">     globalObject-&gt;setDebugger(0);
</span><ins>+    if (!m_globalObjects.size())
+        m_vm = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Debugger::isAttached(JSGlobalObject* globalObject)
</span><span class="lines">@@ -175,12 +238,12 @@
</span><span class="cx"> 
</span><span class="cx"> void Debugger::setSteppingMode(SteppingMode mode)
</span><span class="cx"> {
</span><del>-    if (mode == m_steppingMode)
</del><ins>+    if (mode == m_steppingMode || !m_vm)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     m_steppingMode = mode;
</span><span class="cx">     SetSteppingModeFunctor functor(this, mode);
</span><del>-    m_vm.heap.forEachCodeBlock(functor);
</del><ins>+    m_vm-&gt;heap.forEachCodeBlock(functor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Debugger::registerCodeBlock(CodeBlock* codeBlock)
</span><span class="lines">@@ -265,13 +328,34 @@
</span><span class="cx"> 
</span><span class="cx"> void Debugger::toggleBreakpoint(Breakpoint&amp; breakpoint, Debugger::BreakpointState enabledOrNot)
</span><span class="cx"> {
</span><ins>+    if (!m_vm)
+        return;
</ins><span class="cx">     ToggleBreakpointFunctor functor(this, breakpoint, enabledOrNot);
</span><del>-    m_vm.heap.forEachCodeBlock(functor);
</del><ins>+    m_vm-&gt;heap.forEachCodeBlock(functor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Debugger::recompileAllJSFunctions()
</del><ins>+void Debugger::recompileAllJSFunctions(VM* vm)
</ins><span class="cx"> {
</span><del>-    m_vm.deleteAllCode();
</del><ins>+    // If JavaScript is running, it's not safe to recompile, since we'll end
+    // up throwing away code that is live on the stack.
+    if (vm-&gt;entryScope) {
+        auto listener = [] (VM&amp; vm, JSGlobalObject* globalObject) 
+        {
+            if (Debugger* debugger = globalObject-&gt;debugger())
+                debugger-&gt;recompileAllJSFunctions(&amp;vm);
+        };
+
+        vm-&gt;entryScope-&gt;setEntryScopeDidPopListener(this, listener);
+        return;
+    }
+
+#if ENABLE(DFG_JIT)
+    DFG::completeAllPlansForVM(*vm);
+#endif
+
+    Recompiler recompiler(this);
+    HeapIterationScope iterationScope(vm-&gt;heap);
+    vm-&gt;heap.objectSpace().forEachLiveCell(iterationScope, recompiler);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> BreakpointID Debugger::setBreakpoint(Breakpoint breakpoint, unsigned&amp; actualLine, unsigned&amp; actualColumn)
</span><span class="lines">@@ -436,8 +520,10 @@
</span><span class="cx">     m_breakpointIDToBreakpoint.clear();
</span><span class="cx">     m_sourceIDToBreakpoints.clear();
</span><span class="cx"> 
</span><ins>+    if (!m_vm)
+        return;
</ins><span class="cx">     ClearCodeBlockDebuggerRequestsFunctor functor(this);
</span><del>-    m_vm.heap.forEachCodeBlock(functor);
</del><ins>+    m_vm-&gt;heap.forEachCodeBlock(functor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class Debugger::ClearDebuggerRequestsFunctor {
</span><span class="lines">@@ -460,8 +546,9 @@
</span><span class="cx"> 
</span><span class="cx"> void Debugger::clearDebuggerRequests(JSGlobalObject* globalObject)
</span><span class="cx"> {
</span><ins>+    ASSERT(m_vm);
</ins><span class="cx">     ClearDebuggerRequestsFunctor functor(globalObject);
</span><del>-    m_vm.heap.forEachCodeBlock(functor);
</del><ins>+    m_vm-&gt;heap.forEachCodeBlock(functor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Debugger::setBreakpointsActivated(bool activated)
</span><span class="lines">@@ -488,7 +575,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_pauseOnNextStatement = true;
</span><span class="cx">     setSteppingMode(SteppingModeEnabled);
</span><del>-    m_currentCallFrame = m_vm.topCallFrame;
</del><ins>+    m_currentCallFrame = m_vm-&gt;topCallFrame;
</ins><span class="cx">     ASSERT(m_currentCallFrame);
</span><span class="cx">     pauseIfNeeded(m_currentCallFrame);
</span><span class="cx"> }
</span><span class="lines">@@ -526,7 +613,7 @@
</span><span class="cx">     if (!m_isPaused)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    VMEntryFrame* topVMEntryFrame = m_vm.topVMEntryFrame;
</del><ins>+    VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
</ins><span class="cx">     m_pauseOnCallFrame = m_currentCallFrame ? m_currentCallFrame-&gt;callerFrame(topVMEntryFrame) : 0;
</span><span class="cx">     notifyDoneProcessingDebuggerEvents();
</span><span class="cx"> }
</span><span class="lines">@@ -650,11 +737,11 @@
</span><span class="cx"> 
</span><span class="cx">     // Treat stepping over a return statement like stepping out.
</span><span class="cx">     if (m_currentCallFrame == m_pauseOnCallFrame) {
</span><del>-        VMEntryFrame* topVMEntryFrame = m_vm.topVMEntryFrame;
</del><ins>+        VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
</ins><span class="cx">         m_pauseOnCallFrame = m_currentCallFrame-&gt;callerFrame(topVMEntryFrame);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    VMEntryFrame* topVMEntryFrame = m_vm.topVMEntryFrame;
</del><ins>+    VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
</ins><span class="cx">     m_currentCallFrame = m_currentCallFrame-&gt;callerFrame(topVMEntryFrame);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -685,12 +772,12 @@
</span><span class="cx">     if (!m_currentCallFrame)
</span><span class="cx">         return;
</span><span class="cx">     if (m_currentCallFrame == m_pauseOnCallFrame) {
</span><del>-        VMEntryFrame* topVMEntryFrame = m_vm.topVMEntryFrame;
</del><ins>+        VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
</ins><span class="cx">         m_pauseOnCallFrame = m_currentCallFrame-&gt;callerFrame(topVMEntryFrame);
</span><span class="cx">         if (!m_currentCallFrame)
</span><span class="cx">             return;
</span><span class="cx">     }
</span><del>-    VMEntryFrame* topVMEntryFrame = m_vm.topVMEntryFrame;
</del><ins>+    VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
</ins><span class="cx">     m_currentCallFrame = m_currentCallFrame-&gt;callerFrame(topVMEntryFrame);
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.h (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.h        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.h        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -44,11 +44,9 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE Debugger {
</span><span class="cx"> public:
</span><del>-    Debugger(VM&amp;, bool isInWorkerThread = false);
</del><ins>+    Debugger(bool isInWorkerThread = false);
</ins><span class="cx">     virtual ~Debugger();
</span><span class="cx"> 
</span><del>-    VM&amp; vm() { return m_vm; }
-
</del><span class="cx">     JSC::DebuggerCallFrame* currentDebuggerCallFrame() const;
</span><span class="cx">     bool hasHandlerForExceptionCallback() const
</span><span class="cx">     {
</span><span class="lines">@@ -120,7 +118,7 @@
</span><span class="cx">     void didExecuteProgram(CallFrame*);
</span><span class="cx">     void didReachBreakpoint(CallFrame*);
</span><span class="cx"> 
</span><del>-    virtual void recompileAllJSFunctions();
</del><ins>+    void recompileAllJSFunctions(VM*);
</ins><span class="cx"> 
</span><span class="cx">     void registerCodeBlock(CodeBlock*);
</span><span class="cx"> 
</span><span class="lines">@@ -187,7 +185,7 @@
</span><span class="cx"> 
</span><span class="cx">     void clearDebuggerRequests(JSGlobalObject*);
</span><span class="cx"> 
</span><del>-    VM&amp; m_vm;
</del><ins>+    VM* m_vm;
</ins><span class="cx">     HashSet&lt;JSGlobalObject*&gt; m_globalObjects;
</span><span class="cx"> 
</span><span class="cx">     PauseOnExceptionsState m_pauseOnExceptionsState;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.h (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.h        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/heap/Heap.h        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -237,8 +237,6 @@
</span><span class="cx"> 
</span><span class="cx">     void addLogicallyEmptyWeakBlock(WeakBlock*);
</span><span class="cx"> 
</span><del>-    Vector&lt;ExecutableBase*&gt;&amp; compiledCode() { return m_compiledCode; }
-
</del><span class="cx"> private:
</span><span class="cx">     friend class CodeBlock;
</span><span class="cx">     friend class CopiedBlock;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -35,7 +35,7 @@
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><span class="cx"> JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer(JSGlobalObject&amp; globalObject)
</span><del>-    : ScriptDebugServer(globalObject.vm(), false)
</del><ins>+    : ScriptDebugServer(false)
</ins><span class="cx">     , m_globalObject(globalObject)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -70,6 +70,11 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void JSGlobalObjectScriptDebugServer::recompileAllJSFunctions()
+{
+    JSC::Debugger::recompileAllJSFunctions(&amp;m_globalObject.vm());
+}
+
</ins><span class="cx"> void JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused()
</span><span class="cx"> {
</span><span class="cx">     // Drop all locks so another thread can work in the VM while we are nested.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -42,6 +42,8 @@
</span><span class="cx"> 
</span><span class="cx">     JSC::JSGlobalObject&amp; globalObject() const { return m_globalObject; }
</span><span class="cx"> 
</span><ins>+    virtual void recompileAllJSFunctions() override;
+
</ins><span class="cx"> private:
</span><span class="cx">     virtual ListenerSet&amp; getListeners() override { return m_listeners; }
</span><span class="cx">     virtual void didPause(JSC::JSGlobalObject*) override { }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -47,8 +47,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><del>-ScriptDebugServer::ScriptDebugServer(VM&amp; vm, bool isInWorkerThread)
-    : Debugger(vm, isInWorkerThread)
</del><ins>+ScriptDebugServer::ScriptDebugServer(bool isInWorkerThread)
+    : Debugger(isInWorkerThread)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptDebugServerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -44,7 +44,6 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> class ExecState;
</span><span class="cx"> class JSGlobalObject;
</span><del>-class VM;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace Inspector {
</span><span class="lines">@@ -57,6 +56,8 @@
</span><span class="cx">     void removeBreakpoint(JSC::BreakpointID);
</span><span class="cx">     void clearBreakpoints();
</span><span class="cx"> 
</span><ins>+    virtual void recompileAllJSFunctions() = 0;
+
</ins><span class="cx">     const BreakpointActions&amp; getActionsForBreakpoint(JSC::BreakpointID);
</span><span class="cx"> 
</span><span class="cx">     class Task {
</span><span class="lines">@@ -70,7 +71,7 @@
</span><span class="cx">     typedef HashSet&lt;ScriptDebugListener*&gt; ListenerSet;
</span><span class="cx">     typedef void (ScriptDebugServer::*JavaScriptExecutionCallback)(ScriptDebugListener*);
</span><span class="cx"> 
</span><del>-    ScriptDebugServer(JSC::VM&amp;, bool isInWorkerThread = false);
</del><ins>+    ScriptDebugServer(bool isInWorkerThread = false);
</ins><span class="cx">     ~ScriptDebugServer();
</span><span class="cx"> 
</span><span class="cx">     virtual ListenerSet&amp; getListeners() = 0;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -308,6 +308,40 @@
</span><span class="cx">         dataLogF(&quot;Inspector::getRuntimeTypesForVariablesAtOffsets took %lfms\n&quot;, end - start);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+class TypeRecompiler : public MarkedBlock::VoidFunctor {
+public:
+    inline void visit(JSCell* cell)
+    {
+        if (!cell-&gt;inherits(FunctionExecutable::info()))
+            return;
+
+        FunctionExecutable* executable = jsCast&lt;FunctionExecutable*&gt;(cell);
+        executable-&gt;clearCode();
+        executable-&gt;clearUnlinkedCodeForRecompilation();
+    }
+    inline IterationStatus operator()(JSCell* cell)
+    {
+        visit(cell);
+        return IterationStatus::Continue;
+    }
+};
+
+static void recompileAllJSFunctionsForTypeProfiling(VM&amp; vm, bool shouldEnableTypeProfiling)
+{
+    bool shouldRecompileFromTypeProfiler = (shouldEnableTypeProfiling ? vm.enableTypeProfiler() : vm.disableTypeProfiler());
+    bool shouldRecompileFromControlFlowProfiler = (shouldEnableTypeProfiling ? vm.enableControlFlowProfiler() : vm.disableControlFlowProfiler());
+    bool needsToRecompile = shouldRecompileFromTypeProfiler || shouldRecompileFromControlFlowProfiler;
+
+    if (needsToRecompile) {
+#if ENABLE(DFG_JIT)
+        DFG::completeAllPlansForVM(vm);
+#endif
+        TypeRecompiler recompiler;
+        HeapIterationScope iterationScope(vm.heap);
+        vm.heap.objectSpace().forEachLiveCell(iterationScope, recompiler);
+    }
+}
+
</ins><span class="cx"> void InspectorRuntimeAgent::willDestroyFrontendAndBackend(DisconnectReason reason)
</span><span class="cx"> {
</span><span class="cx">     if (reason != DisconnectReason::InspectedTargetDestroyed &amp;&amp; m_isTypeProfilingEnabled)
</span><span class="lines">@@ -324,21 +358,25 @@
</span><span class="cx">     setTypeProfilerEnabledState(false);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorRuntimeAgent::setTypeProfilerEnabledState(bool isTypeProfilingEnabled)
</del><ins>+void InspectorRuntimeAgent::setTypeProfilerEnabledState(bool shouldEnableTypeProfiling)
</ins><span class="cx"> {
</span><del>-    if (m_isTypeProfilingEnabled == isTypeProfilingEnabled)
</del><ins>+    if (m_isTypeProfilingEnabled == shouldEnableTypeProfiling)
</ins><span class="cx">         return;
</span><del>-    m_isTypeProfilingEnabled = isTypeProfilingEnabled;
</del><span class="cx"> 
</span><ins>+    m_isTypeProfilingEnabled = shouldEnableTypeProfiling;
+
</ins><span class="cx">     VM&amp; vm = globalVM();
</span><del>-    vm.whenIdle([&amp;vm, isTypeProfilingEnabled] () {
-        bool shouldRecompileFromTypeProfiler = (isTypeProfilingEnabled ? vm.enableTypeProfiler() : vm.disableTypeProfiler());
-        bool shouldRecompileFromControlFlowProfiler = (isTypeProfilingEnabled ? vm.enableControlFlowProfiler() : vm.disableControlFlowProfiler());
-        bool needsToRecompile = shouldRecompileFromTypeProfiler || shouldRecompileFromControlFlowProfiler;
</del><span class="cx"> 
</span><del>-        if (needsToRecompile)
-            vm.deleteAllCode();
-    });
</del><ins>+    // If JavaScript is running, it's not safe to recompile, since we'll end
+    // up throwing away code that is live on the stack.
+    if (vm.entryScope) {
+        vm.entryScope-&gt;setEntryScopeDidPopListener(this,
+            [=] (VM&amp; vm, JSGlobalObject*) {
+                recompileAllJSFunctionsForTypeProfiling(vm, shouldEnableTypeProfiling);
+            }
+        );
+    } else
+        recompileAllJSFunctionsForTypeProfiling(vm, shouldEnableTypeProfiling);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorRuntimeAgent::getBasicBlocks(ErrorString&amp; errorString, const String&amp; sourceIDAsString, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::Runtime::BasicBlock&gt;&gt;&amp; basicBlocks)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.cpp (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.cpp        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/runtime/VM.cpp        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -86,7 +86,6 @@
</span><span class="cx"> #include &quot;TypeProfiler.h&quot;
</span><span class="cx"> #include &quot;TypeProfilerLog.h&quot;
</span><span class="cx"> #include &quot;UnlinkedCodeBlock.h&quot;
</span><del>-#include &quot;VMEntryScope.h&quot;
</del><span class="cx"> #include &quot;Watchdog.h&quot;
</span><span class="cx"> #include &quot;WeakGCMapInlines.h&quot;
</span><span class="cx"> #include &quot;WeakMapData.h&quot;
</span><span class="lines">@@ -472,28 +471,16 @@
</span><span class="cx">     interpreter-&gt;stopSampling();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VM::whenIdle(std::function&lt;void()&gt; callback)
-{
-    if (!entryScope) {
-        callback();
-        return;
-    }
-
-    entryScope-&gt;addDidPopListener(callback);
-}
-
</del><span class="cx"> void VM::deleteAllCode()
</span><span class="cx"> {
</span><del>-    whenIdle([this]() {
-        m_codeCache-&gt;clear();
-        m_regExpCache-&gt;deleteAllCode();
</del><ins>+    m_codeCache-&gt;clear();
+    m_regExpCache-&gt;deleteAllCode();
</ins><span class="cx"> #if ENABLE(DFG_JIT)
</span><del>-        DFG::completeAllPlansForVM(*this);
</del><ins>+    DFG::completeAllPlansForVM(*this);
</ins><span class="cx"> #endif
</span><del>-        heap.deleteAllCompiledCode();
-        heap.deleteAllUnlinkedFunctionCode();
-        heap.reportAbandonedObjectGraph();
-    });
</del><ins>+    heap.deleteAllCompiledCode();
+    heap.deleteAllUnlinkedFunctionCode();
+    heap.reportAbandonedObjectGraph();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void VM::dumpSampleData(ExecState* exec)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VM.h (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VM.h        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/runtime/VM.h        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -541,8 +541,6 @@
</span><span class="cx">     JSLock&amp; apiLock() { return *m_apiLock; }
</span><span class="cx">     CodeCache* codeCache() { return m_codeCache.get(); }
</span><span class="cx"> 
</span><del>-    void whenIdle(std::function&lt;void()&gt;);
-
</del><span class="cx">     JS_EXPORT_PRIVATE void deleteAllCode();
</span><span class="cx"> 
</span><span class="cx">     void registerWatchpointForImpureProperty(const Identifier&amp;, Watchpoint*);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMEntryScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/runtime/VMEntryScope.cpp        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -57,9 +57,9 @@
</span><span class="cx">     vm.clearLastException();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void VMEntryScope::addDidPopListener(std::function&lt;void ()&gt; listener)
</del><ins>+void VMEntryScope::setEntryScopeDidPopListener(void* key, EntryScopeDidPopListener listener)
</ins><span class="cx"> {
</span><del>-    m_didPopListeners.append(listener);
</del><ins>+    m_allEntryScopeDidPopListeners.set(key, listener);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> VMEntryScope::~VMEntryScope()
</span><span class="lines">@@ -72,8 +72,8 @@
</span><span class="cx"> 
</span><span class="cx">     m_vm.entryScope = nullptr;
</span><span class="cx"> 
</span><del>-    for (auto&amp; listener : m_didPopListeners)
-        listener();
</del><ins>+    for (auto&amp; listener : m_allEntryScopeDidPopListeners.values())
+        listener(m_vm, m_globalObject);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeVMEntryScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/VMEntryScope.h (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/VMEntryScope.h        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/JavaScriptCore/runtime/VMEntryScope.h        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -27,9 +27,9 @@
</span><span class="cx"> #define VMEntryScope_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><ins>+#include &lt;wtf/HashMap.h&gt;
</ins><span class="cx"> #include &lt;wtf/StackBounds.h&gt;
</span><span class="cx"> #include &lt;wtf/StackStats.h&gt;
</span><del>-#include &lt;wtf/Vector.h&gt;
</del><span class="cx"> 
</span><span class="cx"> namespace JSC {
</span><span class="cx"> 
</span><span class="lines">@@ -43,12 +43,13 @@
</span><span class="cx"> 
</span><span class="cx">     JSGlobalObject* globalObject() const { return m_globalObject; }
</span><span class="cx"> 
</span><del>-    void addDidPopListener(std::function&lt;void ()&gt;);
</del><ins>+    typedef std::function&lt;void (VM&amp;, JSGlobalObject*)&gt; EntryScopeDidPopListener;
+    void setEntryScopeDidPopListener(void*, EntryScopeDidPopListener);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     VM&amp; m_vm;
</span><span class="cx">     JSGlobalObject* m_globalObject;
</span><del>-    Vector&lt;std::function&lt;void ()&gt;&gt; m_didPopListeners;
</del><ins>+    HashMap&lt;void*, EntryScopeDidPopListener&gt; m_allEntryScopeDidPopListeners;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace JSC
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/WebCore/ChangeLog        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-08-21  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r188792 and r188803.
+        https://bugs.webkit.org/show_bug.cgi?id=148347
+
+        broke lots of tests, ggaren is going to investigate and reland
+        (Requested by thorton on #webkit).
+
+        Reverted changesets:
+
+        &quot;Unify code paths for manually deleting all code&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=148280
+        http://trac.webkit.org/changeset/188792
+
+        &quot;Debugger's VM should never be null&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=148341
+        http://trac.webkit.org/changeset/188803
+
</ins><span class="cx"> 2015-08-21  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         document.getElementsByTagName should return an HTMLCollection
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> WorkerScriptDebugServer::WorkerScriptDebugServer(WorkerGlobalScope* context, const String&amp; mode)
</span><del>-    : ScriptDebugServer(context-&gt;script()-&gt;vm(), true)
</del><ins>+    : ScriptDebugServer(true)
</ins><span class="cx">     , m_workerGlobalScope(context)
</span><span class="cx">     , m_debuggerTaskMode(mode)
</span><span class="cx"> {
</span><span class="lines">@@ -82,8 +82,10 @@
</span><span class="cx"> 
</span><span class="cx"> void WorkerScriptDebugServer::recompileAllJSFunctions()
</span><span class="cx"> {
</span><del>-    JSC::JSLockHolder lock(vm());
-    JSC::Debugger::recompileAllJSFunctions();
</del><ins>+    JSC::VM&amp; vm = m_workerGlobalScope-&gt;script()-&gt;vm();
+
+    JSC::JSLockHolder lock(vm);
+    JSC::Debugger::recompileAllJSFunctions(&amp;vm);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WorkerScriptDebugServer::runEventLoopWhilePaused()
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorPageScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> PageScriptDebugServer::PageScriptDebugServer(Page&amp; page)
</span><del>-    : ScriptDebugServer(WebCore::JSDOMWindowBase::commonVM(), false)
</del><ins>+    : ScriptDebugServer(false)
</ins><span class="cx">     , m_page(page)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -87,8 +87,8 @@
</span><span class="cx"> 
</span><span class="cx"> void PageScriptDebugServer::recompileAllJSFunctions()
</span><span class="cx"> {
</span><del>-    JSLockHolder lock(vm());
-    Debugger::recompileAllJSFunctions();
</del><ins>+    JSLockHolder lock(JSDOMWindow::commonVM());
+    Debugger::recompileAllJSFunctions(&amp;JSDOMWindow::commonVM());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PageScriptDebugServer::didPause(JSGlobalObject*)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">     // we need to gracefully handle releasing and reacquiring the lock.
</span><span class="cx">     if (WebThreadIsEnabled()) {
</span><span class="cx">         ASSERT(WebThreadIsLockedOrDisabled());
</span><del>-        JSC::JSLock::DropAllLocks dropAllLocks(vm());
</del><ins>+        JSC::JSLock::DropAllLocks dropAllLocks(WebCore::JSDOMWindowBase::commonVM());
</ins><span class="cx">         WebRunLoopEnableNested();
</span><span class="cx"> 
</span><span class="cx">         runEventLoopWhilePausedInternal();
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-08-21  Commit Queue  &lt;commit-queue@webkit.org&gt;
+
+        Unreviewed, rolling out r188792 and r188803.
+        https://bugs.webkit.org/show_bug.cgi?id=148347
+
+        broke lots of tests, ggaren is going to investigate and reland
+        (Requested by thorton on #webkit).
+
+        Reverted changesets:
+
+        &quot;Unify code paths for manually deleting all code&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=148280
+        http://trac.webkit.org/changeset/188792
+
+        &quot;Debugger's VM should never be null&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=148341
+        http://trac.webkit.org/changeset/188803
+
</ins><span class="cx"> 2015-08-21  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         document.getElementsByTagName should return an HTMLCollection
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebScriptDebuggermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm (188809 => 188810)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm        2015-08-22 00:50:13 UTC (rev 188809)
+++ trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm        2015-08-22 00:53:55 UTC (rev 188810)
</span><span class="lines">@@ -72,8 +72,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebScriptDebugger::WebScriptDebugger(JSGlobalObject* globalObject)
</span><del>-    : Debugger(globalObject-&gt;vm())
-    , m_callingDelegate(false)
</del><ins>+    : m_callingDelegate(false)
</ins><span class="cx">     , m_globalObject(globalObject-&gt;vm(), globalObject)
</span><span class="cx"> {
</span><span class="cx">     setPauseOnExceptionsState(PauseOnAllExceptions);
</span></span></pre>
</div>
</div>

</body>
</html>