Ignore:
Timestamp:
Sep 23, 2010, 3:23:19 PM (15 years ago)
Author:
[email protected]
Message:

2010-09-23 Michael Saboff <[email protected]>

Reviewed by Geoffrey Garen.

Removed extraneous truncation of ovector on entry and error exit.
Changed the initialization to -1 of vector to only initialize
the start indecies, which is sufficient for the pattern/subpatterns.
Changed the JIT code to not clear the end index for subpatterns
as it isn't needed. These changes are worth ~2.7% on v8-regexp.
https://bugs.webkit.org/show_bug.cgi?id=46404

  • runtime/RegExp.cpp: (JSC::RegExp::match):
  • yarr/RegexJIT.cpp: (JSC::Yarr::RegexGenerator::generateParenthesesSingle):
File:
1 edited

Legend:

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

    r67146 r68207  
    116116    if (startOffset < 0)
    117117        startOffset = 0;
    118     if (ovector)
    119         ovector->resize(0);
    120118   
    121119#if ENABLE(REGEXP_TRACING)
     
    143141
    144142        ASSERT(offsetVector);
    145         for (int j = 0; j < offsetVectorSize; ++j)
     143        // Initialize offsetVector with the return value (index 0) and the
     144        // first subpattern start indicies (even index values) set to -1.
     145        // No need to init the subpattern end indicies.
     146        for (unsigned j = 0, i = 0; i < m_numSubpatterns + 1; j += 2, i++)           
    146147            offsetVector[j] = -1;
    147148
     
    158159                fprintf(stderr, "jsRegExpExecute failed with result %d\n", result);
    159160#endif
    160             if (ovector)
    161                 ovector->clear();
    162161        }
    163162       
Note: See TracChangeset for help on using the changeset viewer.