Changeset 165197 in webkit


Ignore:
Timestamp:
Mar 6, 2014 10:47:57 AM (10 years ago)
Author:
akling@apple.com
Message:

Drop unlinked function code on memory pressure.
<https://webkit.org/b/129789>

Make VM::discardAllCode() also drop UnlinkedFunctionCodeBlocks that
are not currently being compiled.

4.5 MB progression on Membuster.

Reviewed by Geoffrey Garen.

  • heap/Heap.cpp:

(JSC::Heap::deleteAllUnlinkedFunctionCode):

  • heap/Heap.h:
  • runtime/VM.cpp:

(JSC::VM::discardAllCode):

Location:
trunk/Source/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r165196 r165197  
     12014-03-06  Andreas Kling  <akling@apple.com>
     2
     3        Drop unlinked function code on memory pressure.
     4        <https://webkit.org/b/129789>
     5
     6        Make VM::discardAllCode() also drop UnlinkedFunctionCodeBlocks that
     7        are not currently being compiled.
     8
     9        4.5 MB progression on Membuster.
     10
     11        Reviewed by Geoffrey Garen.
     12
     13        * heap/Heap.cpp:
     14        (JSC::Heap::deleteAllUnlinkedFunctionCode):
     15        * heap/Heap.h:
     16        * runtime/VM.cpp:
     17        (JSC::VM::discardAllCode):
     18
    1192014-03-06  Filip Pizlo  <fpizlo@apple.com>
    220
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r165135 r165197  
    803803}
    804804
     805void Heap::deleteAllUnlinkedFunctionCode()
     806{
     807    for (ExecutableBase* current = m_compiledCode.head(); current; current = current->next()) {
     808        if (!current->isFunctionExecutable())
     809            continue;
     810        static_cast<FunctionExecutable*>(current)->clearUnlinkedCodeForRecompilationIfNotCompiling();
     811    }
     812}
     813
    805814void Heap::deleteUnmarkedCompiledCode()
    806815{
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r165115 r165197  
    191191
    192192        JS_EXPORT_PRIVATE void deleteAllCompiledCode();
     193        void deleteAllUnlinkedFunctionCode();
    193194
    194195        void didAllocate(size_t);
  • trunk/Source/JavaScriptCore/runtime/VM.cpp

    r165152 r165197  
    526526    m_codeCache->clear();
    527527    heap.deleteAllCompiledCode();
     528    heap.deleteAllUnlinkedFunctionCode();
    528529    heap.reportAbandonedObjectGraph();
    529530}
Note: See TracChangeset for help on using the changeset viewer.