<!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>[188841] 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/188841">188841</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2015-08-23 14:28:38 -0700 (Sun, 23 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Unreviewed, rolling back in <a href="http://trac.webkit.org/projects/webkit/changeset/188803">r188803</a>.

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

Source/JavaScriptCore:

* debugger/Debugger.cpp:
(JSC::Debugger::Debugger):
(JSC::Debugger::attach):
(JSC::Debugger::detach):
(JSC::Debugger::isAttached):
(JSC::Debugger::setSteppingMode):
(JSC::Debugger::registerCodeBlock):
(JSC::Debugger::toggleBreakpoint):
(JSC::Debugger::recompileAllJSFunctions):
(JSC::Debugger::setBreakpoint):
(JSC::Debugger::clearBreakpoints):
(JSC::Debugger::clearDebuggerRequests):
(JSC::Debugger::setBreakpointsActivated):
(JSC::Debugger::breakProgram):
(JSC::Debugger::stepOutOfFunction):
(JSC::Debugger::returnEvent):
(JSC::Debugger::didExecuteProgram):
* debugger/Debugger.h:
* inspector/JSGlobalObjectScriptDebugServer.cpp:
(Inspector::JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer):
(Inspector::JSGlobalObjectScriptDebugServer::removeListener):
(Inspector::JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused):
(Inspector::JSGlobalObjectScriptDebugServer::recompileAllJSFunctions): Deleted.
* inspector/JSGlobalObjectScriptDebugServer.h:
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::ScriptDebugServer):
* inspector/ScriptDebugServer.h:

Source/WebCore:

* bindings/js/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
(WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::PageScriptDebugServer):
(WebCore::PageScriptDebugServer::recompileAllJSFunctions):
(WebCore::PageScriptDebugServer::didPause):
(WebCore::PageScriptDebugServer::runEventLoopWhilePaused):

Source/WebKit/mac:

* WebView/WebScriptDebugger.mm:
(toWebFrame):
(WebScriptDebugger::WebScriptDebugger):</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="#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="#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 (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-08-23 21:28:38 UTC (rev 188841)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2015-08-23  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Unreviewed, rolling back in r188803.
+
+        &quot;Debugger's VM should never be null&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=148341
+        http://trac.webkit.org/changeset/188803
+
+        * debugger/Debugger.cpp:
+        (JSC::Debugger::Debugger):
+        (JSC::Debugger::attach):
+        (JSC::Debugger::detach):
+        (JSC::Debugger::isAttached):
+        (JSC::Debugger::setSteppingMode):
+        (JSC::Debugger::registerCodeBlock):
+        (JSC::Debugger::toggleBreakpoint):
+        (JSC::Debugger::recompileAllJSFunctions):
+        (JSC::Debugger::setBreakpoint):
+        (JSC::Debugger::clearBreakpoints):
+        (JSC::Debugger::clearDebuggerRequests):
+        (JSC::Debugger::setBreakpointsActivated):
+        (JSC::Debugger::breakProgram):
+        (JSC::Debugger::stepOutOfFunction):
+        (JSC::Debugger::returnEvent):
+        (JSC::Debugger::didExecuteProgram):
+        * debugger/Debugger.h:
+        * inspector/JSGlobalObjectScriptDebugServer.cpp:
+        (Inspector::JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer):
+        (Inspector::JSGlobalObjectScriptDebugServer::removeListener):
+        (Inspector::JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused):
+        (Inspector::JSGlobalObjectScriptDebugServer::recompileAllJSFunctions): Deleted.
+        * inspector/JSGlobalObjectScriptDebugServer.h:
+        * inspector/ScriptDebugServer.cpp:
+        (Inspector::ScriptDebugServer::ScriptDebugServer):
+        * inspector/ScriptDebugServer.h:
+
</ins><span class="cx"> 2015-08-22  Filip Pizlo  &lt;fpizlo@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         DFG string concatenation shouldn't be playing fast and loose with effects and OSR exit
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.cpp (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2015-08-23 21:28:38 UTC (rev 188841)
</span><span class="lines">@@ -145,8 +145,8 @@
</span><span class="cx">     Debugger&amp; m_debugger;
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-Debugger::Debugger(bool isInWorkerThread)
-    : m_vm(nullptr)
</del><ins>+Debugger::Debugger(VM&amp; vm, bool isInWorkerThread)
+    : m_vm(vm)
</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">@@ -174,10 +174,6 @@
</span><span class="cx"> void Debugger::attach(JSGlobalObject* globalObject)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!globalObject-&gt;debugger());
</span><del>-    if (!m_vm)
-        m_vm = &amp;globalObject-&gt;vm();
-    else
-        ASSERT(m_vm == &amp;globalObject-&gt;vm());
</del><span class="cx">     globalObject-&gt;setDebugger(this);
</span><span class="cx">     m_globalObjects.add(globalObject);
</span><span class="cx"> }
</span><span class="lines">@@ -203,8 +199,6 @@
</span><span class="cx">         clearDebuggerRequests(globalObject);
</span><span class="cx"> 
</span><span class="cx">     globalObject-&gt;setDebugger(0);
</span><del>-    if (!m_globalObjects.size())
-        m_vm = nullptr;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool Debugger::isAttached(JSGlobalObject* globalObject)
</span><span class="lines">@@ -238,12 +232,12 @@
</span><span class="cx"> 
</span><span class="cx"> void Debugger::setSteppingMode(SteppingMode mode)
</span><span class="cx"> {
</span><del>-    if (mode == m_steppingMode || !m_vm)
</del><ins>+    if (mode == m_steppingMode)
</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-&gt;heap.forEachCodeBlock(functor);
</del><ins>+    m_vm.heap.forEachCodeBlock(functor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Debugger::registerCodeBlock(CodeBlock* codeBlock)
</span><span class="lines">@@ -328,34 +322,32 @@
</span><span class="cx"> 
</span><span class="cx"> void Debugger::toggleBreakpoint(Breakpoint&amp; breakpoint, Debugger::BreakpointState enabledOrNot)
</span><span class="cx"> {
</span><del>-    if (!m_vm)
-        return;
</del><span class="cx">     ToggleBreakpointFunctor functor(this, breakpoint, enabledOrNot);
</span><del>-    m_vm-&gt;heap.forEachCodeBlock(functor);
</del><ins>+    m_vm.heap.forEachCodeBlock(functor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Debugger::recompileAllJSFunctions(VM* vm)
</del><ins>+void Debugger::recompileAllJSFunctions()
</ins><span class="cx"> {
</span><span class="cx">     // If JavaScript is running, it's not safe to recompile, since we'll end
</span><span class="cx">     // up throwing away code that is live on the stack.
</span><del>-    if (vm-&gt;entryScope) {
-        auto listener = [] (VM&amp; vm, JSGlobalObject* globalObject) 
</del><ins>+    if (m_vm.entryScope) {
+        auto listener = [] (VM&amp;, JSGlobalObject* globalObject) 
</ins><span class="cx">         {
</span><span class="cx">             if (Debugger* debugger = globalObject-&gt;debugger())
</span><del>-                debugger-&gt;recompileAllJSFunctions(&amp;vm);
</del><ins>+                debugger-&gt;recompileAllJSFunctions();
</ins><span class="cx">         };
</span><span class="cx"> 
</span><del>-        vm-&gt;entryScope-&gt;setEntryScopeDidPopListener(this, listener);
</del><ins>+        m_vm.entryScope-&gt;setEntryScopeDidPopListener(this, listener);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(DFG_JIT)
</span><del>-    DFG::completeAllPlansForVM(*vm);
</del><ins>+    DFG::completeAllPlansForVM(m_vm);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     Recompiler recompiler(this);
</span><del>-    HeapIterationScope iterationScope(vm-&gt;heap);
-    vm-&gt;heap.objectSpace().forEachLiveCell(iterationScope, recompiler);
</del><ins>+    HeapIterationScope iterationScope(m_vm.heap);
+    m_vm.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">@@ -520,10 +512,8 @@
</span><span class="cx">     m_breakpointIDToBreakpoint.clear();
</span><span class="cx">     m_sourceIDToBreakpoints.clear();
</span><span class="cx"> 
</span><del>-    if (!m_vm)
-        return;
</del><span class="cx">     ClearCodeBlockDebuggerRequestsFunctor functor(this);
</span><del>-    m_vm-&gt;heap.forEachCodeBlock(functor);
</del><ins>+    m_vm.heap.forEachCodeBlock(functor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> class Debugger::ClearDebuggerRequestsFunctor {
</span><span class="lines">@@ -546,9 +536,8 @@
</span><span class="cx"> 
</span><span class="cx"> void Debugger::clearDebuggerRequests(JSGlobalObject* globalObject)
</span><span class="cx"> {
</span><del>-    ASSERT(m_vm);
</del><span class="cx">     ClearDebuggerRequestsFunctor functor(globalObject);
</span><del>-    m_vm-&gt;heap.forEachCodeBlock(functor);
</del><ins>+    m_vm.heap.forEachCodeBlock(functor);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Debugger::setBreakpointsActivated(bool activated)
</span><span class="lines">@@ -575,7 +564,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_pauseOnNextStatement = true;
</span><span class="cx">     setSteppingMode(SteppingModeEnabled);
</span><del>-    m_currentCallFrame = m_vm-&gt;topCallFrame;
</del><ins>+    m_currentCallFrame = m_vm.topCallFrame;
</ins><span class="cx">     ASSERT(m_currentCallFrame);
</span><span class="cx">     pauseIfNeeded(m_currentCallFrame);
</span><span class="cx"> }
</span><span class="lines">@@ -613,7 +602,7 @@
</span><span class="cx">     if (!m_isPaused)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    VMEntryFrame* topVMEntryFrame = m_vm-&gt;topVMEntryFrame;
</del><ins>+    VMEntryFrame* topVMEntryFrame = m_vm.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">@@ -737,11 +726,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-&gt;topVMEntryFrame;
</del><ins>+        VMEntryFrame* topVMEntryFrame = m_vm.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-&gt;topVMEntryFrame;
</del><ins>+    VMEntryFrame* topVMEntryFrame = m_vm.topVMEntryFrame;
</ins><span class="cx">     m_currentCallFrame = m_currentCallFrame-&gt;callerFrame(topVMEntryFrame);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -772,12 +761,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-&gt;topVMEntryFrame;
</del><ins>+        VMEntryFrame* topVMEntryFrame = m_vm.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-&gt;topVMEntryFrame;
</del><ins>+    VMEntryFrame* topVMEntryFrame = m_vm.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 (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.h        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.h        2015-08-23 21:28:38 UTC (rev 188841)
</span><span class="lines">@@ -44,9 +44,11 @@
</span><span class="cx"> 
</span><span class="cx"> class JS_EXPORT_PRIVATE Debugger {
</span><span class="cx"> public:
</span><del>-    Debugger(bool isInWorkerThread = false);
</del><ins>+    Debugger(VM&amp;, bool isInWorkerThread = false);
</ins><span class="cx">     virtual ~Debugger();
</span><span class="cx"> 
</span><ins>+    VM&amp; vm() { return m_vm; }
+
</ins><span class="cx">     JSC::DebuggerCallFrame* currentDebuggerCallFrame() const;
</span><span class="cx">     bool hasHandlerForExceptionCallback() const
</span><span class="cx">     {
</span><span class="lines">@@ -118,7 +120,7 @@
</span><span class="cx">     void didExecuteProgram(CallFrame*);
</span><span class="cx">     void didReachBreakpoint(CallFrame*);
</span><span class="cx"> 
</span><del>-    void recompileAllJSFunctions(VM*);
</del><ins>+    virtual void recompileAllJSFunctions();
</ins><span class="cx"> 
</span><span class="cx">     void registerCodeBlock(CodeBlock*);
</span><span class="cx"> 
</span><span class="lines">@@ -185,7 +187,7 @@
</span><span class="cx"> 
</span><span class="cx">     void clearDebuggerRequests(JSGlobalObject*);
</span><span class="cx"> 
</span><del>-    VM* m_vm;
</del><ins>+    VM&amp; 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="trunkSourceJavaScriptCoreinspectorJSGlobalObjectScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.cpp        2015-08-23 21:28:38 UTC (rev 188841)
</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(false)
</del><ins>+    : ScriptDebugServer(globalObject.vm(), false)
</ins><span class="cx">     , m_globalObject(globalObject)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -70,11 +70,6 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void JSGlobalObjectScriptDebugServer::recompileAllJSFunctions()
-{
-    JSC::Debugger::recompileAllJSFunctions(&amp;m_globalObject.vm());
-}
-
</del><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 (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/JavaScriptCore/inspector/JSGlobalObjectScriptDebugServer.h        2015-08-23 21:28:38 UTC (rev 188841)
</span><span class="lines">@@ -42,8 +42,6 @@
</span><span class="cx"> 
</span><span class="cx">     JSC::JSGlobalObject&amp; globalObject() const { return m_globalObject; }
</span><span class="cx"> 
</span><del>-    virtual void recompileAllJSFunctions() override;
-
</del><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 (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2015-08-23 21:28:38 UTC (rev 188841)
</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(bool isInWorkerThread)
-    : Debugger(isInWorkerThread)
</del><ins>+ScriptDebugServer::ScriptDebugServer(VM&amp; vm, bool isInWorkerThread)
+    : Debugger(vm, 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 (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.h        2015-08-23 21:28:38 UTC (rev 188841)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> namespace JSC {
</span><span class="cx"> class ExecState;
</span><span class="cx"> class JSGlobalObject;
</span><ins>+class VM;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace Inspector {
</span><span class="lines">@@ -56,8 +57,6 @@
</span><span class="cx">     void removeBreakpoint(JSC::BreakpointID);
</span><span class="cx">     void clearBreakpoints();
</span><span class="cx"> 
</span><del>-    virtual void recompileAllJSFunctions() = 0;
-
</del><span class="cx">     const BreakpointActions&amp; getActionsForBreakpoint(JSC::BreakpointID);
</span><span class="cx"> 
</span><span class="cx">     class Task {
</span><span class="lines">@@ -71,7 +70,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(bool isInWorkerThread = false);
</del><ins>+    ScriptDebugServer(JSC::VM&amp;, 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="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/WebCore/ChangeLog        2015-08-23 21:28:38 UTC (rev 188841)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2015-08-23  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Unreviewed, rolling back in r188803.
+
+        &quot;Debugger's VM should never be null&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=148341
+        http://trac.webkit.org/changeset/188803
+
+        * bindings/js/WorkerScriptDebugServer.cpp:
+        (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
+        (WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
+        (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
+        * inspector/PageScriptDebugServer.cpp:
+        (WebCore::PageScriptDebugServer::PageScriptDebugServer):
+        (WebCore::PageScriptDebugServer::recompileAllJSFunctions):
+        (WebCore::PageScriptDebugServer::didPause):
+        (WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
+
</ins><span class="cx"> 2015-08-23  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove SVGFrameLoaderClient and dataProtocolFrameLoader
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsWorkerScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/WebCore/bindings/js/WorkerScriptDebugServer.cpp        2015-08-23 21:28:38 UTC (rev 188841)
</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(true)
</del><ins>+    : ScriptDebugServer(context-&gt;script()-&gt;vm(), true)
</ins><span class="cx">     , m_workerGlobalScope(context)
</span><span class="cx">     , m_debuggerTaskMode(mode)
</span><span class="cx"> {
</span><span class="lines">@@ -82,10 +82,8 @@
</span><span class="cx"> 
</span><span class="cx"> void WorkerScriptDebugServer::recompileAllJSFunctions()
</span><span class="cx"> {
</span><del>-    JSC::VM&amp; vm = m_workerGlobalScope-&gt;script()-&gt;vm();
-
-    JSC::JSLockHolder lock(vm);
-    JSC::Debugger::recompileAllJSFunctions(&amp;vm);
</del><ins>+    JSC::JSLockHolder lock(vm());
+    JSC::Debugger::recompileAllJSFunctions();
</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 (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/WebCore/inspector/PageScriptDebugServer.cpp        2015-08-23 21:28:38 UTC (rev 188841)
</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(false)
</del><ins>+    : ScriptDebugServer(WebCore::JSDOMWindowBase::commonVM(), 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(JSDOMWindow::commonVM());
-    Debugger::recompileAllJSFunctions(&amp;JSDOMWindow::commonVM());
</del><ins>+    JSLockHolder lock(vm());
+    Debugger::recompileAllJSFunctions();
</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(WebCore::JSDOMWindowBase::commonVM());
</del><ins>+        JSC::JSLock::DropAllLocks dropAllLocks(vm());
</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 (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-08-23 21:28:38 UTC (rev 188841)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-08-23  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Unreviewed, rolling back in r188803.
+
+        &quot;Debugger's VM should never be null&quot;
+        https://bugs.webkit.org/show_bug.cgi?id=148341
+        http://trac.webkit.org/changeset/188803
+
+        * WebView/WebScriptDebugger.mm:
+        (toWebFrame):
+        (WebScriptDebugger::WebScriptDebugger):
+
</ins><span class="cx"> 2015-08-21  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r188792 and r188803.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebScriptDebuggermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm (188840 => 188841)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm        2015-08-23 21:27:33 UTC (rev 188840)
+++ trunk/Source/WebKit/mac/WebView/WebScriptDebugger.mm        2015-08-23 21:28:38 UTC (rev 188841)
</span><span class="lines">@@ -72,7 +72,8 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> WebScriptDebugger::WebScriptDebugger(JSGlobalObject* globalObject)
</span><del>-    : m_callingDelegate(false)
</del><ins>+    : Debugger(globalObject-&gt;vm())
+    , 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>