Ignore:
Timestamp:
Nov 8, 2012, 5:12:47 PM (13 years ago)
Author:
[email protected]
Message:

Improve effectiveness of function-level caching
https://bugs.webkit.org/show_bug.cgi?id=101667

Reviewed by Filip Pizlo.

Added a random-eviction based cache for unlinked functions, and switch
UnlinkedFunctionExecutable's code references to Weak<>, thereby letting
us remove the explicit UnlinkedFunctionExecutable::clearCode() calls that
were being triggered by GC.

Refactored the random eviction part of the CodeCache into a separate data
structure so that I didn't have to duplicate the code again, and then used
that for the new function cache.

  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedFunctionExecutable::visitChildren):
(JSC::UnlinkedFunctionExecutable::codeBlockFor):

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedFunctionExecutable::clearCodeForRecompilation):
(UnlinkedFunctionExecutable):

  • debugger/Debugger.cpp:
  • runtime/CodeCache.cpp:

(JSC::CodeCache::getCodeBlock):
(JSC::CodeCache::generateFunctionCodeBlock):
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):
(JSC::CodeCache::usedFunctionCode):
(JSC):

  • runtime/Executable.cpp:

(JSC::FunctionExecutable::clearUnlinkedCodeForRecompilationIfNotCompiling):
(JSC::FunctionExecutable::clearCode):

  • runtime/Executable.h:

(FunctionExecutable):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r133688 r133975  
    621621}
    622622
    623 void FunctionExecutable::clearUnlinkedCodeIfNotCompiling()
     623void FunctionExecutable::clearUnlinkedCodeForRecompilationIfNotCompiling()
    624624{
    625625    if (isCompiling())
    626626        return;
    627     m_unlinkedExecutable->clearCode();
     627    m_unlinkedExecutable->clearCodeForRecompilation();
    628628}
    629629
     
    632632    m_codeBlockForCall.clear();
    633633    m_codeBlockForConstruct.clear();
    634     m_unlinkedExecutable->clearCode();
    635634    Base::clearCode();
    636635}
Note: See TracChangeset for help on using the changeset viewer.