Changeset 162735 in webkit
- Timestamp:
- Jan 24, 2014 3:44:50 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r162723 r162735 1 2014-01-24 Mark Lam <mark.lam@apple.com> 2 3 ASSERT(!m_markedSpace.m_currentDelayedReleaseScope) reloading page in inspector. 4 <https://webkit.org/b/127582> 5 6 Reviewed by Mark Hahnenberg. 7 8 1. We should not enter a HeapIterationScope when we iterate the CodeBlocks. 9 Apparently, iterating the CodeBlocks does not count as heap iteration. 10 11 2. If we're detaching the debugger due to the JSGlobalObject destructing, 12 then we don't need to clear the debugger requests in the associated 13 CodeBlocks. The JSGlobalObject destructing would mean that those 14 CodeBlocks would be destructing too, and it may not be safe to access 15 them anyway at this point. 16 17 The assertion failure is because we had entered a HeapIterationScope 18 while the JSGlobalObject is destructing, which in turn means that GC 19 sweeping is in progress. It's not legal to iterate the heap while the GC 20 is sweeping. Once we fixed the above 2 issues, we will no longer have 21 the conditions that manifests this assertion failure. 22 23 * debugger/Debugger.cpp: 24 (JSC::Debugger::detach): 25 (JSC::Debugger::setSteppingMode): 26 (JSC::Debugger::toggleBreakpoint): 27 (JSC::Debugger::clearBreakpoints): 28 (JSC::Debugger::clearDebuggerRequests): 29 * debugger/Debugger.h: 30 * runtime/JSGlobalObject.cpp: 31 (JSC::JSGlobalObject::~JSGlobalObject): 32 1 33 2014-01-24 Brent Fulgham <bfulgham@apple.com> 2 34 -
trunk/Source/JavaScriptCore/debugger/Debugger.cpp
r162720 r162735 177 177 } 178 178 179 void Debugger::detach(JSGlobalObject* globalObject )179 void Debugger::detach(JSGlobalObject* globalObject, ReasonForDetach reason) 180 180 { 181 181 // If we're detaching from the currently executing global object, manually tear down our … … 191 191 m_globalObjects.remove(globalObject); 192 192 193 clearDebuggerRequests(globalObject); 193 // If the globalObject is destructing, then its CodeBlocks will also be 194 // destructed. There is no need to do the debugger requests clean up, and 195 // it is not safe to access those CodeBlocks at this time anyway. 196 if (reason != GlobalObjectIsDestructing) 197 clearDebuggerRequests(globalObject); 198 194 199 globalObject->setDebugger(0); 195 200 if (!m_globalObjects.size()) … … 229 234 if (!m_vm) 230 235 return; 231 HeapIterationScope iterationScope(m_vm->heap);232 236 SetSteppingModeFunctor functor(this, mode); 233 237 m_vm->heap.forEachCodeBlock(functor); … … 314 318 if (!m_vm) 315 319 return; 316 HeapIterationScope iterationScope(m_vm->heap);317 320 ToggleBreakpointFunctor functor(this, breakpoint, enabledOrNot); 318 321 m_vm->heap.forEachCodeBlock(functor); … … 494 497 if (!m_vm) 495 498 return; 496 HeapIterationScope iterationScope(m_vm->heap);497 499 ClearCodeBlockDebuggerRequestsFunctor functor(this); 498 500 m_vm->heap.forEachCodeBlock(functor); … … 520 522 { 521 523 ASSERT(m_vm); 522 HeapIterationScope iterationScope(m_vm->heap);523 524 ClearDebuggerRequestsFunctor functor(globalObject); 524 525 m_vm->heap.forEachCodeBlock(functor); -
trunk/Source/JavaScriptCore/debugger/Debugger.h
r162711 r162735 62 62 63 63 void attach(JSGlobalObject*); 64 virtual void detach(JSGlobalObject*); 64 enum ReasonForDetach { 65 TerminatingDebuggingSession, 66 GlobalObjectIsDestructing 67 }; 68 virtual void detach(JSGlobalObject*, ReasonForDetach); 65 69 66 70 BreakpointID setBreakpoint(Breakpoint, unsigned& actualLine, unsigned& actualColumn); -
trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp
r162713 r162735 165 165 { 166 166 if (m_debugger) 167 m_debugger->detach(this );167 m_debugger->detach(this, Debugger::GlobalObjectIsDestructing); 168 168 169 169 if (LegacyProfiler* profiler = vm().enabledProfiler()) -
trunk/Source/WebCore/ChangeLog
r162732 r162735 1 2014-01-24 Mark Lam <mark.lam@apple.com> 2 3 ASSERT(!m_markedSpace.m_currentDelayedReleaseScope) reloading page in inspector. 4 <https://webkit.org/b/127582> 5 6 Reviewed by Mark Hahnenberg. 7 8 No new tests. 9 10 * bindings/js/ScriptController.cpp: 11 (WebCore::ScriptController::attachDebugger): 12 * bindings/js/WorkerScriptController.cpp: 13 (WebCore::WorkerScriptController::detachDebugger): 14 - Adding reasons for detaching a globalObject from the debugger. 15 1 16 2014-01-24 Zalan Bujtas <zalan@apple.com> 2 17 -
trunk/Source/WebCore/bindings/js/ScriptController.cpp
r161638 r162735 287 287 debugger->attach(globalObject); 288 288 else if (JSC::Debugger* currentDebugger = globalObject->debugger()) 289 currentDebugger->detach(globalObject );289 currentDebugger->detach(globalObject, JSC::Debugger::TerminatingDebuggingSession); 290 290 } 291 291 -
trunk/Source/WebCore/bindings/js/WorkerScriptController.cpp
r160457 r162735 201 201 void WorkerScriptController::detachDebugger(JSC::Debugger* debugger) 202 202 { 203 debugger->detach(m_workerGlobalScopeWrapper->globalObject() );203 debugger->detach(m_workerGlobalScopeWrapper->globalObject(), JSC::Debugger::TerminatingDebuggingSession); 204 204 } 205 205
Note: See TracChangeset
for help on using the changeset viewer.