Skip to content
  • mjs@apple.com's avatar
    2010-05-13 Maciej Stachowiak <mjs@apple.com> · 88e2ff72
    mjs@apple.com authored
            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.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59355 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    88e2ff72