Ignore:
Timestamp:
Nov 30, 2012, 1:09:21 PM (13 years ago)
Author:
[email protected]
Message:

Add direct string->function code cache
https://bugs.webkit.org/show_bug.cgi?id=103764

Reviewed by Michael Saboff.

A fairly logically simple patch. We now track the start of the
unique portion of a functions body, and use that as our key for
unlinked function code. This allows us to cache identical code
in different contexts, leading to a small but consistent improvement
on the benchmarks we track.

  • bytecode/UnlinkedCodeBlock.cpp:

(JSC::UnlinkedFunctionExecutable::UnlinkedFunctionExecutable):

  • bytecode/UnlinkedCodeBlock.h:

(JSC::UnlinkedFunctionExecutable::functionStartOffset):
(UnlinkedFunctionExecutable):

  • parser/ASTBuilder.h:

(ASTBuilder):
(JSC::ASTBuilder::setFunctionStart):

  • parser/Nodes.cpp:
  • parser/Nodes.h:

(JSC::FunctionBodyNode::setFunctionStart):
(JSC::FunctionBodyNode::functionStart):
(FunctionBodyNode):

  • parser/Parser.cpp:

(JSC::::parseFunctionInfo):

  • parser/Parser.h:

(JSC::Parser::findCachedFunctionInfo):

  • parser/SyntaxChecker.h:

(JSC::SyntaxChecker::setFunctionStart):

  • runtime/CodeCache.cpp:

(JSC::CodeCache::generateFunctionCodeBlock):
(JSC::CodeCache::getFunctionCodeBlock):
(JSC::CodeCache::usedFunctionCode):

  • runtime/CodeCache.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/parser/Nodes.h

    r128234 r136261  
    4747    class JSScope;
    4848    class ScopeNode;
     49    class SourceProviderCacheItem;
    4950
    5051    typedef unsigned CodeFeatures;
     
    14251426        FunctionNameIsInScopeToggle functionNameIsInScopeToggle() { return m_functionNameIsInScopeToggle; }
    14261427
     1428        void setFunctionStart(int functionStart) { m_functionStart = functionStart; }
     1429        int functionStart() const { return m_functionStart; }
     1430
    14271431        static const bool scopeIsFunction = true;
    14281432
     
    14351439        FunctionNameIsInScopeToggle m_functionNameIsInScopeToggle;
    14361440        RefPtr<FunctionParameters> m_parameters;
     1441        int m_functionStart;
    14371442    };
    14381443
Note: See TracChangeset for help on using the changeset viewer.