Skip to content
  • oliver@apple.com's avatar
    Empty parse cache when receiving a low memory warning · c32e3a0e
    oliver@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=104161
    
    Reviewed by Filip Pizlo.
    
    Source/JavaScriptCore:
    
    This adds a function to the globaldata to empty all code related data
    structures (code in the heap and the code cache).
    It also adds a function to allow the CodeCache to actually be cleared
    at all.
    
    * runtime/CodeCache.h:
    (CacheMap):
    (JSC::CacheMap::clear):
    (JSC::CodeCache::clear):
    (CodeCache):
    * runtime/JSGlobalData.cpp:
    (JSC::JSGlobalData::discardAllCode):
    (JSC):
    * runtime/JSGlobalData.h:
    (JSGlobalData):
    
    Source/WebCore:
    
    Use new discardAllCode() function on the global data, rather than
    directly interacting with the heap.
    
    * bindings/js/GCController.cpp:
    (WebCore::GCController::discardAllCompiledCode):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    c32e3a0e