Changeset 61927 in webkit


Ignore:
Timestamp:
Jun 25, 2010 6:04:28 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

2010-06-25 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r61924.
http://trac.webkit.org/changeset/61924
https://bugs.webkit.org/show_bug.cgi?id=41240

It was rolled out, but cq+ wasn't removed (Requested by Ossy_
on #webkit).

  • runtime/RegExp.cpp: (JSC::RegExp::RegExp): (JSC::RegExp::create):
  • runtime/RegExp.h:
  • runtime/RegExpCache.cpp: (JSC::RegExpCache::lookupOrCreate): (JSC::RegExpCache::create):
  • runtime/RegExpCache.h:
Location:
trunk/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r61924 r61927  
     12010-06-25  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r61924.
     4        http://trac.webkit.org/changeset/61924
     5        https://bugs.webkit.org/show_bug.cgi?id=41240
     6
     7        It was rolled out, but cq+ wasn't removed (Requested by Ossy_
     8        on #webkit).
     9
     10        * runtime/RegExp.cpp:
     11        (JSC::RegExp::RegExp):
     12        (JSC::RegExp::create):
     13        * runtime/RegExp.h:
     14        * runtime/RegExpCache.cpp:
     15        (JSC::RegExpCache::lookupOrCreate):
     16        (JSC::RegExpCache::create):
     17        * runtime/RegExpCache.h:
     18
    1192010-06-25  Renata Hodovan  <reni@inf.u-szeged.hu>
    220
  • trunk/JavaScriptCore/runtime/RegExp.cpp

    r61924 r61927  
    4747namespace JSC {
    4848
     49inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern)
     50    : m_pattern(pattern)
     51    , m_flagBits(0)
     52    , m_constructionError(0)
     53    , m_numSubpatterns(0)
     54{
     55    compile(globalData);
     56}
     57
    4958inline RegExp::RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags)
    5059    : m_pattern(pattern)
     
    5564    // NOTE: The global flag is handled on a case-by-case basis by functions like
    5665    // String::match and RegExpObject::match.
    57     if (!flags.isNull()) {
    58         if (flags.find('g') != UString::NotFound)
    59             m_flagBits |= Global;
    60         if (flags.find('i') != UString::NotFound)
    61             m_flagBits |= IgnoreCase;
    62         if (flags.find('m') != UString::NotFound)
    63             m_flagBits |= Multiline;
    64     }
     66    if (flags.find('g') != UString::NotFound)
     67        m_flagBits |= Global;
     68    if (flags.find('i') != UString::NotFound)
     69        m_flagBits |= IgnoreCase;
     70    if (flags.find('m') != UString::NotFound)
     71        m_flagBits |= Multiline;
     72
    6573    compile(globalData);
    6674}
     
    7280}
    7381#endif
     82
     83PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern)
     84{
     85    return adoptRef(new RegExp(globalData, pattern));
     86}
    7487
    7588PassRefPtr<RegExp> RegExp::create(JSGlobalData* globalData, const UString& pattern, const UString& flags)
  • trunk/JavaScriptCore/runtime/RegExp.h

    r61924 r61927  
    3838    class RegExp : public RefCounted<RegExp> {
    3939    public:
     40        static PassRefPtr<RegExp> create(JSGlobalData* globalData, const UString& pattern);
    4041        static PassRefPtr<RegExp> create(JSGlobalData* globalData, const UString& pattern, const UString& flags);
    4142#if !ENABLE(YARR)
     
    5657
    5758    private:
     59        RegExp(JSGlobalData* globalData, const UString& pattern);
    5860        RegExp(JSGlobalData* globalData, const UString& pattern, const UString& flags);
    5961
  • trunk/JavaScriptCore/runtime/RegExpCache.cpp

    r61924 r61927  
    3838        if (!result.second)
    3939            return result.first->second;
    40         else
    41             return create(patternString, flags, result.first);
    4240    }
    43     return create(patternString, flags, m_cacheMap.end());
     41    return create(patternString, flags);
    4442}
    4543
    46 PassRefPtr<RegExp> RegExpCache::create(const UString& patternString, const UString& flags, RegExpCacheMap::iterator iterator)
     44PassRefPtr<RegExp> RegExpCache::create(const UString& patternString, const UString& flags)
    4745{
    48     RefPtr<RegExp> regExp = RegExp::create(m_globalData, patternString, flags);
     46    RefPtr<RegExp> regExp;
     47
     48    if (!flags.isNull())
     49        regExp = RegExp::create(m_globalData, patternString, flags);
     50    else
     51        regExp = RegExp::create(m_globalData, patternString);
    4952
    5053    if (patternString.size() >= maxCacheablePatternLength)
     
    6063
    6164    RegExpKey key = RegExpKey(flags, patternString);
    62     iterator->first = key;
    63     iterator->second = regExp;
     65    m_cacheMap.set(key, regExp);
    6466    patternKeyArray[m_nextKeyToEvict].flagsValue = key.flagsValue;
    6567    patternKeyArray[m_nextKeyToEvict].pattern = patternString.rep();
  • trunk/JavaScriptCore/runtime/RegExpCache.h

    r61924 r61927  
    3636
    3737class RegExpCache {
    38 
    39 typedef HashMap<RegExpKey, RefPtr<RegExp> > RegExpCacheMap;
    40 
    4138public:
    4239    PassRefPtr<RegExp> lookupOrCreate(const UString& patternString, const UString& flags);
    43     PassRefPtr<RegExp> create(const UString& patternString, const UString& flags, RegExpCacheMap::iterator iterator);
     40    PassRefPtr<RegExp> create(const UString& patternString, const UString& flags);
    4441    RegExpCache(JSGlobalData* globalData);
    4542
     
    4845    static const int maxCacheableEntries = 256;
    4946
     47    typedef HashMap<RegExpKey, RefPtr<RegExp> > RegExpCacheMap;
    5048    RegExpKey patternKeyArray[maxCacheableEntries];
    5149    RegExpCacheMap m_cacheMap;
Note: See TracChangeset for help on using the changeset viewer.