- Implemented caching of match state inside the global RegExp object
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Oct 2005 20:43:49 +0000 (20:43 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 11 Oct 2005 20:43:49 +0000 (20:43 +0000)
commitebbc0a69a6ec8c4affc52f5992eb0b69fd9d2ea1
tree551c52320d462b7caebfcb3446bb93b2669bd95f
parent96717667551dc179f2f8ceece3df059cf3b8a3bf
    - Implemented caching of match state inside the global RegExp object
          (lastParen, leftContext, rightContext, lastMatch, input).

          exec(), test(), match(), search(), and replace() now dipatch regular
          expression matching through the RegExp object's performMatch function,
          to facilitate caching. This replaces registerRegexp and
          setSubPatterns.

        - Implemented the special '$' aliases (e.g. RegExp.input aliases to
          RegExp.$_).

        - Moved support for backreferences into the new static hash table
          used for other special RegExp properties. Truncated backreferences
          at $9 to match IE, FF, and the "What's New in Netscape 1.2?" doc.
          (String.replace still supports double-digit backreferences.)

        - Tweaked RegExp.prototype.exec to handle ginormous values in lastIndex.

        Fixes 11 -- count em, 11 -- JavaScriptCore tests.

        Reviewed by NOBODY (OOPS!).

        * JavaScriptCore.xcodeproj/project.pbxproj: Added regexp_object.lut.h
        * kjs/create_hash_table: Tweaked to allow for more exotic characters.
                                 We now rely on the compiler to catch illegal
                                 identifiers.
        * kjs/regexp.cpp:
        (KJS::RegExp::RegExp):
        * kjs/regexp_object.cpp:
        (RegExpProtoFuncImp::callAsFunction):
        (RegExpObjectImp::RegExpObjectImp):
        (RegExpObjectImp::performMatch):
        (RegExpObjectImp::arrayOfMatches):
        (RegExpObjectImp::backrefGetter):
        (RegExpObjectImp::getLastMatch):
        (RegExpObjectImp::getLastParen):
        (RegExpObjectImp::getLeftContext):
        (RegExpObjectImp::getRightContext):
        (RegExpObjectImp::getOwnPropertySlot):
        (RegExpObjectImp::getValueProperty):
        (RegExpObjectImp::put):
        (RegExpObjectImp::putValueProperty):
        * kjs/regexp_object.h:
        (KJS::RegExpObjectImp::):
        * kjs/string_object.cpp:
        (substituteBackreferences):
        (replace):
        (StringProtoFuncImp::callAsFunction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@10818 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
JavaScriptCore/kjs/create_hash_table
JavaScriptCore/kjs/regexp.cpp
JavaScriptCore/kjs/regexp_object.cpp
JavaScriptCore/kjs/regexp_object.h
JavaScriptCore/kjs/string_object.cpp