JavaScriptCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Aug 2004 21:35:09 +0000 (21:35 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 10 Aug 2004 21:35:09 +0000 (21:35 +0000)
commit7e5e4bf00d11b1c9e1d241d7789e1c09f0b96b77
tree6bdc094a097a48dc81b75d39c9f3d2f3ebe27e35
parent59c458769efa20b068db177ab6d8aa3621f53cb1
JavaScriptCore:

        Reviewed by Dave.

        - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed

        * pcre/pcre.h: Added PCRE_UTF16 switch, set to 1. Added pcre_char typedef, which is char
        or uint16_t depending on the mode, and used appropriate in the 7 public functions
        that need to use it.
        * pcre/pcre.c: Add UTF-16 support to all functions.
        * pcre/study.c: Ditto.

        * pcre/internal.h: Added ichar typedef, which is unsigned char or uint16_t depending on
        the mode. Changed declarations to use symbolic constants and typedefs so we size
        things to ichar when needed.

        * pcre/maketables.c: (pcre_maketables): Change code to make tables that are
        sized to 16-bit characters instead of 8-bit.

        * pcre/get.c:
        (pcre_copy_substring): Use pcre_char instead of char.
        (pcre_get_substring_list): Ditto.
        (pcre_free_substring_list): Ditto.
        (pcre_get_substring): Ditto.
        (pcre_free_substring): Ditto.

        * pcre/dftables.c: (main): Used a bit more const, and use ICHAR sizes instead
        of hard-coding 8-bit table sizes.

        * pcre/chartables.c: Regenerated.

        * kjs/ustring.h: Remove functions that convert UTF-16 to/from UTF-8 offsets.
        * kjs/ustring.cpp: Change the shared empty string to have a unicode pointer that
        is not null. The null string still has a null pointer. This prevents us from
        passing a null through to the regular expression engine (which results in a null
        error even when the string length is 0).

        * kjs/regexp.cpp:
        (KJS::RegExp::RegExp): Null-terminate the pattern and pass it.
        (KJS::RegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.

WebCore:

        Reviewed by Dave.

        - switch PCRE to do UTF-16 directly instead of converting to/from UTF-8 for speed

        * kwq/KWQRegExp.mm:
        (QRegExp::KWQRegExpPrivate::compile): Null-terminate the pattern and pass it.
        (QRegExp::match): Use the 16-bit string directly, no need to convert to UTF-8.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7223 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/kjs/regexp.cpp
JavaScriptCore/kjs/ustring.cpp
JavaScriptCore/kjs/ustring.h
JavaScriptCore/pcre/chartables.c
JavaScriptCore/pcre/dftables.c
JavaScriptCore/pcre/get.c
JavaScriptCore/pcre/internal.h
JavaScriptCore/pcre/maketables.c
JavaScriptCore/pcre/pcre.c
JavaScriptCore/pcre/pcre.h
JavaScriptCore/pcre/study.c
WebCore/ChangeLog-2005-08-23
WebCore/kwq/KWQRegExp.mm