ASSERT(!m_markedSpace.m_currentDelayedReleaseScope) reloading page in inspector.
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2014 23:44:50 +0000 (23:44 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Jan 2014 23:44:50 +0000 (23:44 +0000)
commit7f4e4f28d4c68e3900fa889db27a9f0db7a77f0b
tree97c1237b7191441b83c82fec7b4dd411210ba589
parent59f6d15bef72c1c9952f257cdbdb38da6cd0c1ec
ASSERT(!m_markedSpace.m_currentDelayedReleaseScope) reloading page in inspector.
<https://webkit.org/b/127582>

Reviewed by Mark Hahnenberg.

Source/JavaScriptCore:

1. We should not enter a HeapIterationScope when we iterate the CodeBlocks.
   Apparently, iterating the CodeBlocks does not count as heap iteration.

2. If we're detaching the debugger due to the JSGlobalObject destructing,
   then we don't need to clear the debugger requests in the associated
   CodeBlocks. The JSGlobalObject destructing would mean that those
   CodeBlocks would be destructing too, and it may not be safe to access
   them anyway at this point.

The assertion failure is because we had entered a HeapIterationScope
while the JSGlobalObject is destructing, which in turn means that GC
sweeping is in progress. It's not legal to iterate the heap while the GC
is sweeping. Once we fixed the above 2 issues, we will no longer have
the conditions that manifests this assertion failure.

* debugger/Debugger.cpp:
(JSC::Debugger::detach):
(JSC::Debugger::setSteppingMode):
(JSC::Debugger::toggleBreakpoint):
(JSC::Debugger::clearBreakpoints):
(JSC::Debugger::clearDebuggerRequests):
* debugger/Debugger.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::~JSGlobalObject):

Source/WebCore:

No new tests.

* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::attachDebugger):
* bindings/js/WorkerScriptController.cpp:
(WebCore::WorkerScriptController::detachDebugger):
- Adding reasons for detaching a globalObject from the debugger.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@162735 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/debugger/Debugger.cpp
Source/JavaScriptCore/debugger/Debugger.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/ScriptController.cpp
Source/WebCore/bindings/js/WorkerScriptController.cpp