Ignore:
Timestamp:
Apr 6, 2012, 9:09:22 AM (13 years ago)
Author:
[email protected]
Message:

Call Heap::discardAllCompiledCode() in low memory situations
https://bugs.webkit.org/show_bug.cgi?id=83335

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Restructured Heap::discardAllCompiledCode() to do the "Is JavaScriptRunning?"
check inline so that it can be called directly without this check.

  • heap/Heap.cpp:

(JSC::Heap::discardAllCompiledCode):
(JSC::Heap::collectAllGarbage):

  • heap/Heap.h: Added JS_EXPORT_PRIVATE to discardAllCompiledCode() so it can be

called from WebCore.
(Heap):

  • runtime/JSGlobalData.h: Removed unused " void discardAllCompiledCode()" declaration.

(JSGlobalData):

Source/WebCore:

Added call to discardAllCompiledCode() when under memory pressure.
We can re-JIT as needed. This is similar to what we used to do when we did
a full GC which also cleaned up JIT code. Doing a full GC typically didn't
help our memory situation, in fact it made things worse in the really low
memory situation as it caused more paging.

Added pass through discardAllCompiledCode() method to GCController.

  • bindings/js/GCController.cpp:

(WebCore::GCController::discardAllCompiledCode):
(WebCore):

  • bindings/js/GCController.h:

(GCController):

  • platform/mac/MemoryPressureHandlerMac.mm:

(WebCore::MemoryPressureHandler::releaseMemory):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/Heap.h

    r113141 r113445  
    149149        double lastGCLength() { return m_lastGCLength; }
    150150
    151         void discardAllCompiledCode();
     151        JS_EXPORT_PRIVATE void discardAllCompiledCode();
    152152
    153153    private:
Note: See TracChangeset for help on using the changeset viewer.