2010-05-13 Maciej Stachowiak <mjs@apple.com>
authormjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 May 2010 09:36:54 +0000 (09:36 +0000)
committermjs@apple.com <mjs@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 May 2010 09:36:54 +0000 (09:36 +0000)
commit88e2ff72f9604ead721349a983210fe79694ea70
tree6f0f44bae1bdcade84b9c29ecb84bd559a243bc7
parentd7bdc72be53781174cc70ba4831061585743b91a
2010-05-13  Maciej Stachowiak  <mjs@apple.com>

        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
JavaScriptCore/ChangeLog
JavaScriptCore/runtime/ArrayPrototype.cpp
JavaScriptCore/runtime/RegExp.cpp
JavaScriptCore/runtime/RegExpConstructor.h
JavaScriptCore/runtime/StringPrototype.cpp