Ignore:
Timestamp:
Jun 22, 2010, 12:16:57 PM (15 years ago)
Author:
[email protected]
Message:

Adding regular expression caching to JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=38142

Patch by Renata Hodovan <[email protected]> on 2010-06-22
Reviewed by Geoffrey Garen.

The cache is based on Round Robin eviction policy, and
can cache at most 256 character long regular expressions,
and at most 256 of them. These values can be changed at compile time.

(JSC::RegExpNode::emitBytecode):

  • runtime/JSGlobalData.cpp:

(JSC::JSGlobalData::JSGlobalData):
(JSC::JSGlobalData::~JSGlobalData):

  • runtime/JSGlobalData.h:

(JSC::JSGlobalData::regExpCache):

  • runtime/RegExpCache.cpp: Added.

(JSC::RegExpCache::lookupOrCreate):
(JSC::RegExpCache::create):
(JSC::RegExpCache::RegExpCache):

  • runtime/RegExpCache.h: Added.
  • runtime/RegExpConstructor.cpp:

(JSC::constructRegExp):

  • runtime/RegExpKey.h: Added.

(JSC::RegExpKey::RegExpKey):
(JSC::RegExpKey::getFlagsValue):
(WTF::operator==):
(WTF::):

  • runtime/RegExpPrototype.cpp:

(JSC::regExpProtoFuncCompile):

  • runtime/StringPrototype.cpp:

(JSC::stringProtoFuncMatch):
(JSC::stringProtoFuncSearch):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalData.h

    r59746 r61623  
    5959    class Lexer;
    6060    class Parser;
     61    class RegExpCache;
    6162    class Stringifier;
    6263    class Structure;
     
    212213
    213214        int maxReentryDepth;
     215
     216        RegExpCache* m_regExpCache;
     217
    214218#ifndef NDEBUG
    215219        ThreadIdentifier exclusiveThread;
     
    223227        void stopSampling();
    224228        void dumpSampleData(ExecState* exec);
     229        RegExpCache* regExpCache() { return m_regExpCache; }
    225230    private:
    226231        JSGlobalData(GlobalDataType, ThreadStackType);
Note: See TracChangeset for help on using the changeset viewer.