• ggaren@apple.com's avatar
    Save space on keys in the CodeCache · de5cc65c
    ggaren@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=110179
    
    Reviewed by Oliver Hunt.
    
    Share the SourceProvider's string instead of making our own copy. This
    chops off 16MB - 32MB from the CodeCache's memory footprint when full.
    (It's 16MB when the strings are LChar, and 32MB when they're UChar.)
    
    * runtime/CodeCache.cpp:
    (JSC::CodeCache::getFunctionExecutableFromGlobalCode):
    * runtime/CodeCache.h: Removed a defunct enum value.
    
    (JSC::SourceCodeKey::SourceCodeKey):
    (JSC::SourceCodeKey::isHashTableDeletedValue):
    (SourceCodeKey):
    (JSC::SourceCodeKey::hash):
    (JSC::SourceCodeKey::length):
    (JSC::SourceCodeKey::isNull):
    (JSC::SourceCodeKey::string):
    (JSC::SourceCodeKey::operator==): Store a SourceCode instead of a String
    so we can share our string with our SourceProvider. Cache our hash so
    we don't have to re-decode our string just to re-hash the table.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@143348 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    de5cc65c
CodeCache.cpp 6.26 KB