Ignore:
Timestamp:
Jun 24, 2010, 11:33:48 PM (15 years ago)
Author:
[email protected]
Message:

Merge RegExp constructor and RegExp::create methods into one.
Both of function are called with tree parameters and check whether
flags (the third param) is given or not.
Simplify hash lookups in RegExpCache::create with giving them an extra
iterator parameter.
https://bugs.webkit.org/show_bug.cgi?id=41055

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

  • runtime/RegExp.cpp:

(JSC::RegExp::RegExp):

  • runtime/RegExp.h:
  • runtime/RegExpCache.cpp:

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

  • runtime/RegExpCache.h:
File:
1 edited

Legend:

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

    r61623 r61833  
    3636
    3737class RegExpCache {
     38
     39typedef HashMap<RegExpKey, RefPtr<RegExp> > RegExpCacheMap;
     40
    3841public:
    3942    PassRefPtr<RegExp> lookupOrCreate(const UString& patternString, const UString& flags);
    40     PassRefPtr<RegExp> create(const UString& patternString, const UString& flags);
     43    PassRefPtr<RegExp> create(const UString& patternString, const UString& flags, RegExpCacheMap::iterator iterator);
    4144    RegExpCache(JSGlobalData* globalData);
    4245
     
    4548    static const int maxCacheableEntries = 256;
    4649
    47     typedef HashMap<RegExpKey, RefPtr<RegExp> > RegExpCacheMap;
    4850    RegExpKey patternKeyArray[maxCacheableEntries];
    4951    RegExpCacheMap m_cacheMap;
Note: See TracChangeset for help on using the changeset viewer.