Exemplo n.º 1
0
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();
}
Exemplo n.º 2
0
void Debugger::setProfilingClient(ProfilingClient* client)
{
    ASSERT(!!m_profilingClient != !!client);
    m_profilingClient = client;

    recompileAllJSFunctions();
}
Exemplo n.º 3
0
void Debugger::setBreakpointsActivated(bool activated)
{
    if (activated == m_breakpointsActivated)
        return;

    m_breakpointsActivated = activated;
    recompileAllJSFunctions();
}
Exemplo n.º 4
0
void WorkerScriptDebugServer::addListener(ScriptDebugListener* listener)
{
    if (!listener)
        return;

    if (m_listeners.isEmpty())
        m_workerGlobalScope->script()->attachDebugger(this);
    m_listeners.add(listener);
    recompileAllJSFunctions(0);
}
Exemplo n.º 5
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();
    }
}
Exemplo n.º 6
0
void PageScriptDebugServer::addListener(ScriptDebugListener* listener)
{
    if (!listener)
        return;

    bool wasEmpty = m_listeners.isEmpty();
    m_listeners.add(listener);

    if (wasEmpty) {
        m_page.setDebugger(this);
        recompileAllJSFunctions();
    }
}
Exemplo n.º 7
0
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();
    }
}
Exemplo n.º 8
0
void PageScriptDebugServer::detachDebugger(bool isBeingDestroyed)
{
    m_page.setDebugger(nullptr);
    if (!isBeingDestroyed)
        recompileAllJSFunctions();
}
Exemplo n.º 9
0
void JSGlobalData::releaseExecutableMemory()
{
    if (!dynamicGlobalObject)
        recompileAllJSFunctions();
    m_regExpCache->invalidateCode();
}