Ignore:
Timestamp:
Aug 23, 2015, 7:07:27 PM (10 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling back in r188792.
https://bugs.webkit.org/show_bug.cgi?id=148347

Previously reverted changesets:

"Unify code paths for manually deleting all code"
https://bugs.webkit.org/show_bug.cgi?id=148280
http://trac.webkit.org/changeset/188792

The previous patch caused some inspector tests to hang because it
introduced extra calls to sourceParsed, and sourceParsed is
pathologically slow in WK1 debug builds. This patch restores pre-existing
code to limit calls to sourceParsed, excluding code not being debugged
(i.e., inspector code).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r188824 r188846  
    8787#include "TypeProfilerLog.h"
    8888#include "UnlinkedCodeBlock.h"
     89#include "VMEntryScope.h"
    8990#include "Watchdog.h"
    9091#include "WeakGCMapInlines.h"
     
    471472}
    472473
     474void VM::whenIdle(std::function<void()> callback)
     475{
     476    if (!entryScope) {
     477        callback();
     478        return;
     479    }
     480
     481    entryScope->addDidPopListener(callback);
     482}
     483
    473484void VM::deleteAllCode()
    474485{
    475     m_codeCache->clear();
    476     m_regExpCache->deleteAllCode();
     486    whenIdle([this]() {
     487        m_codeCache->clear();
     488        m_regExpCache->deleteAllCode();
    477489#if ENABLE(DFG_JIT)
    478     DFG::completeAllPlansForVM(*this);
    479 #endif
    480     heap.deleteAllCompiledCode();
    481     heap.deleteAllUnlinkedFunctionCode();
    482     heap.reportAbandonedObjectGraph();
     490        DFG::completeAllPlansForVM(*this);
     491#endif
     492        heap.deleteAllCompiledCode();
     493        heap.deleteAllUnlinkedFunctionCode();
     494        heap.reportAbandonedObjectGraph();
     495    });
    483496}
    484497
Note: See TracChangeset for help on using the changeset viewer.