JavaScriptCore:
authordarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2007 18:54:34 +0000 (18:54 +0000)
committerdarin@apple.com <darin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Nov 2007 18:54:34 +0000 (18:54 +0000)
commit073ca210452279af8fd2715abd8397b4b365ceb9
tree39b94402ca62751fd90c1267790c0f9f146589fd
parenta1a52b0bb193b4a4efa8361dd0ad667b8f0f2a2b
JavaScriptCore:

        Reviewed by Adam Roben.

        - fix http://bugs.webkit.org/show_bug.cgi?id=16207
          JavaScript regular expressions should match UTF-16 code units rather than characters

        SunSpider says this is 5.5% faster on the regexp test, 0.4% faste overall.

        Test: fast/js/regexp-non-bmp.html

        Renamed ANY_CHAR to NOT_NEWLINE to more-accurately reflect its meaning.

        * pcre/pcre_compile.cpp:
        (compile_branch): Removed calls to the UTF-16 character accessor functions, replacing
        them with simple pointer dereferences in some cases, and no code at all in others.
        (calculateCompiledPatternLengthAndFlags): Ditto.

        * pcre/pcre_exec.cpp:
        (match): Fixed indentation of some case labels (including all the BEGIN_OPCODE).
        Removed calls to the UTF-16 character accessor functions, replacing them with simple
        pointer dereferences in some cases, and no code at all in others. Also removed some
        explicit UTF-16 support code in a few cases. Removed the unneeded "UTF-8" code path
        in the ANY_CHAR repeat code, and in another case, eliminated the code to check against
        end_subject in because it is already done outside the loop.
        (jsRegExpExecute):

        * pcre/pcre_internal.h: Removed all the UTF-16 helper functions.

LayoutTests:

        Reviewed by Adam Roben.

        - test for http://bugs.webkit.org/show_bug.cgi?id=16207
          JavaScript regular expressions should match UTF-16 code units rather than characters

        * fast/js/regexp-non-bmp-expected.txt: Added.
        * fast/js/regexp-non-bmp.html: Added.
        * fast/js/resources/regexp-non-bmp.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28243 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/pcre/pcre_compile.cpp
JavaScriptCore/pcre/pcre_exec.cpp
JavaScriptCore/pcre/pcre_internal.h
LayoutTests/ChangeLog
LayoutTests/fast/js/regexp-non-bmp-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/regexp-non-bmp.html [new file with mode: 0644]
LayoutTests/fast/js/resources/regexp-non-bmp.js [new file with mode: 0644]