void JSGlobalData::releaseExecutableMemory() { if (dynamicGlobalObject) { StackPreservingRecompiler recompiler; HashSet<JSCell*> roots; heap.getConservativeRegisterRoots(roots); HashSet<JSCell*>::iterator end = roots.end(); for (HashSet<JSCell*>::iterator ptr = roots.begin(); ptr != end; ++ptr) { ScriptExecutable* executable = 0; JSCell* cell = *ptr; if (cell->inherits(&ScriptExecutable::s_info)) executable = static_cast<ScriptExecutable*>(*ptr); else if (cell->inherits(&JSFunction::s_info)) { JSFunction* function = asFunction(*ptr); if (function->isHostFunction()) continue; executable = function->jsExecutable(); } else continue; ASSERT(executable->inherits(&ScriptExecutable::s_info)); executable->unlinkCalls(); if (executable->inherits(&FunctionExecutable::s_info)) recompiler.currentlyExecutingFunctions.add(static_cast<FunctionExecutable*>(executable)); } heap.forEach(recompiler); } else recompileAllJSFunctions(); m_regExpCache->invalidateCode(); heap.collectAllGarbage(); }
void Debugger::setProfilingClient(ProfilingClient* client) { ASSERT(!!m_profilingClient != !!client); m_profilingClient = client; recompileAllJSFunctions(); }
void Debugger::setBreakpointsActivated(bool activated) { if (activated == m_breakpointsActivated) return; m_breakpointsActivated = activated; recompileAllJSFunctions(); }
void WorkerScriptDebugServer::addListener(ScriptDebugListener* listener) { if (!listener) return; if (m_listeners.isEmpty()) m_workerGlobalScope->script()->attachDebugger(this); m_listeners.add(listener); recompileAllJSFunctions(0); }
void PageScriptDebugServer::removeListener(ScriptDebugListener* listener, bool isBeingDestroyed) { if (!listener) return; m_listeners.remove(listener); if (m_listeners.isEmpty()) { m_page.setDebugger(nullptr); if (!isBeingDestroyed) recompileAllJSFunctions(); } }
void PageScriptDebugServer::addListener(ScriptDebugListener* listener) { if (!listener) return; bool wasEmpty = m_listeners.isEmpty(); m_listeners.add(listener); if (wasEmpty) { m_page.setDebugger(this); recompileAllJSFunctions(); } }
void WorkerScriptDebugServer::removeListener(ScriptDebugListener* listener, bool skipRecompile) { if (!listener) return; m_listeners.remove(listener); if (m_listeners.isEmpty()) { m_workerGlobalScope->script()->detachDebugger(this); if (!skipRecompile) recompileAllJSFunctions(); } }
void PageScriptDebugServer::detachDebugger(bool isBeingDestroyed) { m_page.setDebugger(nullptr); if (!isBeingDestroyed) recompileAllJSFunctions(); }
void JSGlobalData::releaseExecutableMemory() { if (!dynamicGlobalObject) recompileAllJSFunctions(); m_regExpCache->invalidateCode(); }