Ignore:
Timestamp:
May 13, 2010, 2:36:54 AM (15 years ago)
Author:
[email protected]
Message:

2010-05-13 Maciej Stachowiak <[email protected]>

Reviewed by Mark Rowe.

Various JavaScript string optimizations
https://bugs.webkit.org/show_bug.cgi?id=39051

Approximately 1% SunSpider speedup.


  • runtime/ArrayPrototype.cpp: (JSC::arrayProtoFuncJoin): Remove branches from the hot code path by moving the first pass outside the loop, and duplicating the hot loop to extract the loop-invariant branch.
  • runtime/RegExp.cpp: (JSC::RegExp::match): resize ovector to 0 instead of clearing to avoid thrash in case of large matches.
  • runtime/RegExpConstructor.h: (JSC::RegExpConstructor::performMatch): Mark ALWAYS_INLINE to make the compiler respect our authority.
  • runtime/StringPrototype.cpp: (JSC::jsSpliceSubstringsWithSeparators): Inline. (JSC::stringProtoFuncSubstring): Rewrite boundary condition checks to reduce the number of floating point comparisons and branches.
File:
1 edited

Legend:

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

    r55322 r59355  
    108108        startOffset = 0;
    109109    if (ovector)
    110         ovector->clear();
     110        ovector->resize(0);
    111111
    112112    if (static_cast<unsigned>(startOffset) > s.size() || s.isNull())
     
    132132        for (int j = 0; j < offsetVectorSize; ++j)
    133133            offsetVector[j] = -1;
    134 
    135134
    136135#if ENABLE(YARR_JIT)
Note: See TracChangeset for help on using the changeset viewer.