Ignore:
Timestamp:
Aug 25, 2010, 11:55:26 AM (15 years ago)
Author:
[email protected]
Message:

2010-08-25 Michael Saboff <[email protected]>

Reviewed by Sam Weinig.

Remove the single entry regular expression cache introduced as part of
the fix for https://bugs.webkit.org/show_bug.cgi?id=41238.
The performance problem in Dromaeo that initiated that bug is no
longer present. Dromaeo has been modified so that the regular
expression tests are somewhat random and don't benefit from a
single entry cache.

  • runtime/RegExp.cpp: (JSC::RegExp::RegExp): (JSC::RegExp::match):
  • runtime/RegExp.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/RegExp.cpp

    r65468 r66031  
    5252    , m_constructionError(0)
    5353    , m_numSubpatterns(0)
    54     , m_lastMatchStart(-1)
    5554{
    5655    // NOTE: The global flag is handled on a case-by-case basis by functions like
     
    9796        ovector->resize(0);
    9897
    99     if (static_cast<unsigned>(startOffset) > s.length() || s.isNull()) {
    100         m_lastMatchString = UString();
    101         m_lastMatchStart = -1;
    102         m_lastOVector.shrink(0);
     98    if (static_cast<unsigned>(startOffset) > s.length() || s.isNull())
    10399        return -1;
    104     }
    105    
    106     // Perform check to see if this match call is the same as the last match invocation
    107     // and if it is return the prior result.
    108     if ((startOffset == m_lastMatchStart) && (s.impl() == m_lastMatchString.impl())) {
    109         if (ovector)
    110             *ovector = m_lastOVector;
    111        
    112         if (m_lastOVector.isEmpty())
    113             return -1;
    114 
    115         return m_lastOVector.at(0);
    116     }
    117100
    118101#if ENABLE(YARR_JIT)
     
    152135        }
    153136       
    154         m_lastMatchString = s;
    155         m_lastMatchStart = startOffset;
    156 
    157         if (ovector)
    158             m_lastOVector = *ovector;
    159         else
    160             m_lastOVector = nonReturnedOvector;
    161 
    162137        return result;
    163138    }
    164 
    165     m_lastMatchString = UString();
    166     m_lastMatchStart = -1;
    167     m_lastOVector.shrink(0);
    168139
    169140    return -1;
Note: See TracChangeset for help on using the changeset viewer.