Changeset 241442 in webkit


Ignore:
Timestamp:
Feb 13, 2019, 10:50:20 AM (6 years ago)
Author:
Tadeu Zagallo
Message:

CodeBlocks read from disk should not be re-written
https://bugs.webkit.org/show_bug.cgi?id=194535

Reviewed by Michael Saboff.

Keep track of which CodeBlocks have been read from disk or have already
been serialized in CodeCache.

  • runtime/CodeCache.cpp:

(JSC::CodeCache::write):

  • runtime/CodeCache.h:

(JSC::SourceCodeValue::SourceCodeValue):
(JSC::CodeCacheMap::fetchFromDiskImpl):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/JavaScriptCore/ChangeLog

    r241431 r241442  
     12019-02-13  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        CodeBlocks read from disk should not be re-written
     4        https://bugs.webkit.org/show_bug.cgi?id=194535
     5
     6        Reviewed by Michael Saboff.
     7
     8        Keep track of which CodeBlocks have been read from disk or have already
     9        been serialized in CodeCache.
     10
     11        * runtime/CodeCache.cpp:
     12        (JSC::CodeCache::write):
     13        * runtime/CodeCache.h:
     14        (JSC::SourceCodeValue::SourceCodeValue):
     15        (JSC::CodeCacheMap::fetchFromDiskImpl):
     16
    1172019-02-13  Tadeu Zagallo  <tzagallo@apple.com>
    218
  • TabularUnified trunk/Source/JavaScriptCore/runtime/CodeCache.cpp

    r241431 r241442  
    160160void CodeCache::write(VM& vm)
    161161{
    162     for (const auto& it : m_sourceCode)
     162    for (auto& it : m_sourceCode) {
     163        if (it.value.written)
     164            continue;
     165        it.value.written = true;
    163166        writeCodeBlock(vm, it.key, it.value);
     167    }
    164168}
    165169
  • TabularUnified trunk/Source/JavaScriptCore/runtime/CodeCache.h

    r240511 r241442  
    7676    }
    7777
    78     SourceCodeValue(VM& vm, JSCell* cell, int64_t age)
     78    SourceCodeValue(VM& vm, JSCell* cell, int64_t age, bool written = false)
    7979        : cell(vm, cell)
    8080        , age(age)
     81        , written(written)
    8182    {
    8283    }
     
    8485    Strong<JSCell> cell;
    8586    int64_t age;
     87    bool written;
    8688};
    8789
     
    155157
    156158        VERBOSE_LOG("Found cached CodeBlock on disk");
    157         addCache(key, SourceCodeValue(vm, unlinkedCodeBlock, m_age));
     159        addCache(key, SourceCodeValue(vm, unlinkedCodeBlock, m_age, true));
    158160        return unlinkedCodeBlock;
    159161#else
Note: See TracChangeset for help on using the changeset viewer.