2011-02-10 Peter Varga <pvarga@webkit.org>
authorpvarga@webkit.org <pvarga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Feb 2011 13:39:13 +0000 (13:39 +0000)
committerpvarga@webkit.org <pvarga@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Feb 2011 13:39:13 +0000 (13:39 +0000)
        Reviewed by Csaba Osztrogonác.

        Remove PCRE source from trunk
        https://bugs.webkit.org/show_bug.cgi?id=54188

        * Source/cmake/WebKitFS.cmake:
2011-02-10  Peter Varga  <pvarga@webkit.org>

        Reviewed by Csaba Osztrogonác.

        Remove PCRE source from trunk
        https://bugs.webkit.org/show_bug.cgi?id=54188

        * Android.mk:
        * Android.v8.wtf.mk:
        * CMakeLists.txt:
        * DerivedSources.make:
        * DerivedSources.pro:
        * GNUmakefile.am:
        * JavaScriptCore.gypi:
        * JavaScriptCore.order:
        * JavaScriptCore.pri:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
        * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
        * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
        * JavaScriptCore.xcodeproj/project.pbxproj:
        * pcre/AUTHORS: Removed.
        * pcre/COPYING: Removed.
        * pcre/dftables: Removed.
        * pcre/pcre.h: Removed.
        * pcre/pcre.pri: Removed.
        * pcre/pcre_compile.cpp: Removed.
        * pcre/pcre_exec.cpp: Removed.
        * pcre/pcre_internal.h: Removed.
        * pcre/pcre_tables.cpp: Removed.
        * pcre/pcre_ucp_searchfuncs.cpp: Removed.
        * pcre/pcre_xclass.cpp: Removed.
        * pcre/ucpinternal.h: Removed.
        * pcre/ucptable.cpp: Removed.
        * wscript:
2011-02-10  Peter Varga  <pvarga@webkit.org>

        Reviewed by Csaba Osztrogonác.

        Remove PCRE source from trunk
        https://bugs.webkit.org/show_bug.cgi?id=54188

        * ForwardingHeaders/pcre/pcre.h: Removed.
2011-02-10  Peter Varga  <pvarga@webkit.org>

        Reviewed by Csaba Osztrogonác.

        Remove PCRE source from trunk
        https://bugs.webkit.org/show_bug.cgi?id=54188

        * WebKit2.pro:
2011-02-10  Peter Varga  <pvarga@webkit.org>

        Reviewed by Csaba Osztrogonác.

        Remove PCRE source from trunk
        https://bugs.webkit.org/show_bug.cgi?id=54188

        * wx/build/settings.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

38 files changed:
ChangeLog
Source/JavaScriptCore/Android.mk
Source/JavaScriptCore/Android.v8.wtf.mk
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/DerivedSources.make
Source/JavaScriptCore/DerivedSources.pro
Source/JavaScriptCore/GNUmakefile.am
Source/JavaScriptCore/JavaScriptCore.gypi
Source/JavaScriptCore/JavaScriptCore.order
Source/JavaScriptCore/JavaScriptCore.pri
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops
Source/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make
Source/JavaScriptCore/JavaScriptCore.vcproj/WTF/WTFCommon.vsprops
Source/JavaScriptCore/JavaScriptCore.vcproj/jsc/jscCommon.vsprops
Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
Source/JavaScriptCore/pcre/AUTHORS [deleted file]
Source/JavaScriptCore/pcre/COPYING [deleted file]
Source/JavaScriptCore/pcre/dftables [deleted file]
Source/JavaScriptCore/pcre/pcre.h [deleted file]
Source/JavaScriptCore/pcre/pcre.pri [deleted file]
Source/JavaScriptCore/pcre/pcre_compile.cpp [deleted file]
Source/JavaScriptCore/pcre/pcre_exec.cpp [deleted file]
Source/JavaScriptCore/pcre/pcre_internal.h [deleted file]
Source/JavaScriptCore/pcre/pcre_tables.cpp [deleted file]
Source/JavaScriptCore/pcre/pcre_ucp_searchfuncs.cpp [deleted file]
Source/JavaScriptCore/pcre/pcre_xclass.cpp [deleted file]
Source/JavaScriptCore/pcre/ucpinternal.h [deleted file]
Source/JavaScriptCore/pcre/ucptable.cpp [deleted file]
Source/JavaScriptCore/wscript
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/ForwardingHeaders/pcre/pcre.h [deleted file]
Source/WebKit2/ChangeLog
Source/WebKit2/WebKit2.pro
Source/cmake/WebKitFS.cmake
Tools/ChangeLog
Tools/wx/build/settings.py

index 20506a2..09fb7f1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-02-10  Peter Varga  <pvarga@webkit.org>
+
+        Reviewed by Csaba Osztrogonác.
+
+        Remove PCRE source from trunk
+        https://bugs.webkit.org/show_bug.cgi?id=54188
+
+        * Source/cmake/WebKitFS.cmake:
+
 2011-02-09  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Steve Block.
index cb681dd..f3d47f7 100644 (file)
@@ -61,12 +61,6 @@ LOCAL_SRC_FILES := \
        parser/Parser.cpp \
        parser/ParserArena.cpp \
        \
-       pcre/pcre_compile.cpp \
-       pcre/pcre_exec.cpp \
-       pcre/pcre_tables.cpp \
-       pcre/pcre_ucp_searchfuncs.cpp \
-       pcre/pcre_xclass.cpp \
-       \
        profiler/Profile.cpp \
        profiler/ProfileGenerator.cpp \
        profiler/ProfileNode.cpp \
@@ -226,11 +220,4 @@ $(LEXER_HEADER): $(LOCAL_PATH)/create_hash_table
 $(LEXER_HEADER): $(intermediates)/%.lut.h : $(LOCAL_PATH)/parser/Keywords.table
        $(transform-generated-source)
 
-CHARTABLES := $(intermediates)/chartables.c
-$(CHARTABLES): PRIVATE_PATH := $(LOCAL_PATH)
-$(CHARTABLES): PRIVATE_CUSTOM_TOOL = perl $(PRIVATE_PATH)/pcre/dftables $@
-$(CHARTABLES): $(LOCAL_PATH)/pcre/dftables
-$(CHARTABLES): $(LOCAL_PATH)/pcre/pcre_internal.h
-       $(transform-generated-source)
-
-LOCAL_GENERATED_SOURCES += $(JSC_OBJECTS) $(LEXER_HEADER) $(CHARTABLES)
+LOCAL_GENERATED_SOURCES += $(JSC_OBJECTS) $(LEXER_HEADER)
index dc07828..977d389 100644 (file)
 # wtf source files
 
 LOCAL_SRC_FILES := \
-       pcre/pcre_compile.cpp \
-       pcre/pcre_exec.cpp \
-       pcre/pcre_tables.cpp \
-       pcre/pcre_ucp_searchfuncs.cpp \
-       pcre/pcre_xclass.cpp \
-       \
        wtf/Assertions.cpp \
        wtf/ByteArray.cpp \
        wtf/CryptographicallyRandomNumber.cpp \
@@ -66,15 +60,3 @@ LOCAL_SRC_FILES := \
        wtf/unicode/UTF8.cpp \
        \
        wtf/unicode/icu/CollatorICU.cpp
-
-CHARTABLES := $(intermediates)/chartables.c
-$(CHARTABLES): PRIVATE_PATH := $(LOCAL_PATH)
-$(CHARTABLES): PRIVATE_CUSTOM_TOOL = perl $(PRIVATE_PATH)/pcre/dftables $@
-$(CHARTABLES): $(LOCAL_PATH)/pcre/dftables
-$(CHARTABLES): $(LOCAL_PATH)/pcre/pcre_internal.h
-       $(transform-generated-source)
-
-$(intermediates)/pcre/pcre_tables.o : $(CHARTABLES)
-
-# We do not add $(CHARTABLES) to LOCAL_GENERATED_SOURCES because the chartables.c file
-# is explicitly #included in pcre_tables.cpp.
index e685ecf..f18826e 100644 (file)
@@ -10,7 +10,6 @@ SET(JavaScriptCore_INCLUDE_DIRECTORIES
     "${JAVASCRIPTCORE_DIR}/interpreter"
     "${JAVASCRIPTCORE_DIR}/jit"
     "${JAVASCRIPTCORE_DIR}/parser"
-    "${JAVASCRIPTCORE_DIR}/pcre"
     "${JAVASCRIPTCORE_DIR}/profiler"
     "${JAVASCRIPTCORE_DIR}/runtime"
     "${JAVASCRIPTCORE_DIR}/yarr"
@@ -69,12 +68,6 @@ SET(JavaScriptCore_SOURCES
     parser/ParserArena.cpp
     parser/SourceProviderCache.cpp
 
-    pcre/pcre_compile.cpp
-    pcre/pcre_exec.cpp
-    pcre/pcre_tables.cpp
-    pcre/pcre_ucp_searchfuncs.cpp
-    pcre/pcre_xclass.cpp
-
     profiler/Profile.cpp
     profiler/ProfileGenerator.cpp
     profiler/ProfileNode.cpp
@@ -211,15 +204,6 @@ ENDFOREACH ()
 GENERATE_HASH_LUT(${JAVASCRIPTCORE_DIR}/parser/Keywords.table ${DERIVED_SOURCES_DIR}/Lexer.lut.h MAIN_DEPENDENCY)
 LIST(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_DIR}/Lexer.lut.h)
 
-# GENERATOR: "chartables.c": compile and execute the chartables generator (and add it to sources)
-ADD_CUSTOM_COMMAND(
-    OUTPUT ${DERIVED_SOURCES_DIR}/chartables.c
-    MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/pcre/dftables
-    COMMAND ${PERL_EXECUTABLE} ${JAVASCRIPTCORE_DIR}/pcre/dftables --preprocessor "${CODE_GENERATOR_PREPROCESSOR}" ${DERIVED_SOURCES_DIR}/chartables.c
-    VERBATIM)
-ADD_SOURCE_DEPENDENCIES(${JAVASCRIPTCORE_DIR}/pcre/pcre_tables.cpp ${DERIVED_SOURCES_DIR}/chartables.c)
-
-
 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
 ADD_CUSTOM_COMMAND(
     OUTPUT ${DERIVED_SOURCES_DIR}/RegExpJitTables.h
index 921710b..9b7e68d 100644 (file)
@@ -1,3 +1,40 @@
+2011-02-10  Peter Varga  <pvarga@webkit.org>
+
+        Reviewed by Csaba Osztrogonác.
+
+        Remove PCRE source from trunk
+        https://bugs.webkit.org/show_bug.cgi?id=54188
+
+        * Android.mk:
+        * Android.v8.wtf.mk:
+        * CMakeLists.txt:
+        * DerivedSources.make:
+        * DerivedSources.pro:
+        * GNUmakefile.am:
+        * JavaScriptCore.gypi:
+        * JavaScriptCore.order:
+        * JavaScriptCore.pri:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreCommon.vsprops:
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCoreGenerated.make:
+        * JavaScriptCore.vcproj/WTF/WTFCommon.vsprops:
+        * JavaScriptCore.vcproj/jsc/jscCommon.vsprops:
+        * JavaScriptCore.xcodeproj/project.pbxproj:
+        * pcre/AUTHORS: Removed.
+        * pcre/COPYING: Removed.
+        * pcre/dftables: Removed.
+        * pcre/pcre.h: Removed.
+        * pcre/pcre.pri: Removed.
+        * pcre/pcre_compile.cpp: Removed.
+        * pcre/pcre_exec.cpp: Removed.
+        * pcre/pcre_internal.h: Removed.
+        * pcre/pcre_tables.cpp: Removed.
+        * pcre/pcre_ucp_searchfuncs.cpp: Removed.
+        * pcre/pcre_xclass.cpp: Removed.
+        * pcre/ucpinternal.h: Removed.
+        * pcre/ucptable.cpp: Removed.
+        * wscript:
+
 2011-02-10  Patrick Gansterer  <paroga@webkit.org>
 
         Reviewed by Adam Barth.
index 1f684d4..0ff9cdf 100644 (file)
@@ -27,7 +27,6 @@
 VPATH = \
     $(JavaScriptCore) \
     $(JavaScriptCore)/parser \
-    $(JavaScriptCore)/pcre \
     $(JavaScriptCore)/docs \
     $(JavaScriptCore)/runtime \
     $(JavaScriptCore)/interpreter \
@@ -49,7 +48,6 @@ all : \
     RegExpJitTables.h \
     RegExpObject.lut.h \
     StringPrototype.lut.h \
-    chartables.c \
     docs/bytecode.html \
 #
 
@@ -60,11 +58,6 @@ all : \
 Lexer.lut.h: create_hash_table Keywords.table
        $^ > $@
 
-# character tables for PCRE
-
-chartables.c : dftables
-       $^ $@
-
 docs/bytecode.html: make-bytecode-docs.pl Interpreter.cpp 
        perl $^ $@
 
index 4d724be..eac4dd9 100644 (file)
@@ -83,15 +83,6 @@ msvcstubs.input = JIT_STUB_FILES
 msvcstubs.CONFIG += no_link
 addExtraCompiler(msvcstubs)
 
-# GENERATOR: "chartables.c": compile and execute the chartables generator (and add it to sources)
-win32-msvc*|wince*: PREPROCESSOR = "--preprocessor=\"$$QMAKE_CC /E\""
-ctgen.output = $$JSC_GENERATED_SOURCES_DIR/chartables.c
-ctgen.wkScript = $$PWD/pcre/dftables
-ctgen.input = ctgen.wkScript
-ctgen.commands = perl $$ctgen.wkScript ${QMAKE_FILE_OUT} $$PREPROCESSOR
-ctgen.clean = ${QMAKE_FILE_OUT} ${QMAKE_VAR_JSC_GENERATED_SOURCES_DIR}${QMAKE_FILE_BASE}
-addExtraCompiler(ctgen)
-
 #GENERATOR: "RegExpJitTables.h": tables used by Yarr
 retgen.output = $$JSC_GENERATED_SOURCES_DIR/RegExpJitTables.h
 retgen.wkScript = $$PWD/create_regex_tables 
index 6962584..1ceea3c 100644 (file)
@@ -11,7 +11,6 @@ javascriptcore_cppflags += \
        -I$(srcdir)/Source/JavaScriptCore/jit \
        -I$(srcdir)/Source/JavaScriptCore/jit \
        -I$(srcdir)/Source/JavaScriptCore/parser \
-       -I$(srcdir)/Source/JavaScriptCore/pcre \
        -I$(srcdir)/Source/JavaScriptCore/profiler \
        -I$(srcdir)/Source/JavaScriptCore/runtime \
        -I$(srcdir)/Source/JavaScriptCore/wtf \
@@ -23,7 +22,6 @@ javascriptcore_cppflags += \
        -I$(srcdir)/Source/JavaScriptCore/yarr \
        -I$(top_builddir)/Source/JavaScriptCore \
        -I$(top_builddir)/Source/JavaScriptCore/parser \
-       -I$(top_builddir)/Source/JavaScriptCore/pcre \
        -I$(top_builddir)/Source/JavaScriptCore/runtime
 
 javascriptcore_h_api += \
@@ -48,8 +46,7 @@ javascriptcore_built_nosources += \
        Source/JavaScriptCore/runtime/NumberConstructor.lut.h \
        Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \
        Source/JavaScriptCore/runtime/RegExpObject.lut.h \
-       Source/JavaScriptCore/runtime/StringPrototype.lut.h \
-       Source/JavaScriptCore/pcre/chartables.c
+       Source/JavaScriptCore/runtime/StringPrototype.lut.h
 
 javascriptcore_sources += \
        Source/JavaScriptCore/API/APICast.h \
@@ -206,14 +203,6 @@ javascriptcore_sources += \
        Source/JavaScriptCore/parser/SourceProviderCache.h \
        Source/JavaScriptCore/parser/SourceProviderCacheItem.h \
        Source/JavaScriptCore/parser/SyntaxChecker.h \
-       Source/JavaScriptCore/pcre/pcre_compile.cpp \
-       Source/JavaScriptCore/pcre/pcre_exec.cpp \
-       Source/JavaScriptCore/pcre/pcre.h \
-       Source/JavaScriptCore/pcre/pcre_internal.h \
-       Source/JavaScriptCore/pcre/pcre_tables.cpp \
-       Source/JavaScriptCore/pcre/pcre_ucp_searchfuncs.cpp \
-       Source/JavaScriptCore/pcre/pcre_xclass.cpp \
-       Source/JavaScriptCore/pcre/ucpinternal.h \
        Source/JavaScriptCore/profiler/CallIdentifier.h \
        Source/JavaScriptCore/profiler/Profile.cpp \
        Source/JavaScriptCore/profiler/ProfileGenerator.cpp \
@@ -622,9 +611,6 @@ Source/JavaScriptCore/%.lut.h: $(srcdir)/Source/JavaScriptCore/create_hash_table
 Source/JavaScriptCore/RegExpJitTables.h: $(srcdir)/Source/JavaScriptCore/create_regex_tables
        $(AM_V_GEN)$(PYTHON) $^ > $@
 
-Source/JavaScriptCore/pcre/chartables.c: $(srcdir)/Source/JavaScriptCore/pcre/dftables
-       $(AM_V_GEN)$(PERL) $^ $@
-
 jsc: $(javascriptcore_built_nosources) Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT);
 
 bin_PROGRAMS += \
@@ -699,10 +685,6 @@ EXTRA_DIST += \
        Source/JavaScriptCore/icu/LICENSE \
        Source/JavaScriptCore/icu/README \
        Source/JavaScriptCore/parser/Keywords.table \
-       Source/JavaScriptCore/pcre/AUTHORS \
-       Source/JavaScriptCore/pcre/COPYING \
-       Source/JavaScriptCore/pcre/dftables \
-       Source/JavaScriptCore/pcre/ucptable.cpp \
        Source/JavaScriptCore/THANKS
 
 # Clean rules for JavaScriptCore
@@ -715,7 +697,6 @@ CLEANFILES += \
        Source/JavaScriptCore/runtime/RegExpConstructor.lut.h \
        Source/JavaScriptCore/runtime/RegExpObject.lut.h \
        Source/JavaScriptCore/runtime/StringPrototype.lut.h \
-       Source/JavaScriptCore/pcre/chartables.c \
        Programs/jsc \
        Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@ \
        Programs/minidom
index cfdbfa1..3d547d0 100644 (file)
             'parser/SourceProviderCache.h',
             'parser/SourceProviderCacheItem.h',
             'parser/SyntaxChecker.h',
-            'pcre/pcre.h',
-            'pcre/pcre_compile.cpp',
-            'pcre/pcre_exec.cpp',
-            'pcre/pcre_internal.h',
-            'pcre/pcre_tables.cpp',
-            'pcre/pcre_ucp_searchfuncs.cpp',
-            'pcre/pcre_xclass.cpp',
-            'pcre/ucpinternal.h',
-            'pcre/ucptable.cpp',
             'profiler/CallIdentifier.h',
             'profiler/Profile.cpp',
             'profiler/Profile.h',
index 3cb3d1d..9e4004f 100644 (file)
@@ -185,11 +185,9 @@ __ZN3WTF31clearPthreadHandleForIdentifierEj
 __ZN3WTF12detachThreadEj
 __ZN3WTFL26pthreadHandleForIdentifierEj
 __ZN7WebCore6StringC1EPKtj
-__Z15jsRegExpCompilePKti24JSRegExpIgnoreCaseOption23JSRegExpMultilineOptionPjPPKc
 __ZL30calculateCompiledPatternLengthPKti24JSRegExpIgnoreCaseOptionR11CompileDataR9ErrorCode
 __ZL11checkEscapePPKtS0_P9ErrorCodeib
 __ZL13compileBranchiPiPPhPPKtS3_P9ErrorCodeS_S_R11CompileData
-__Z15jsRegExpExecutePK8JSRegExpPKtiiPii
 __ZL5matchPKtPKhiR9MatchData
 __ZN7WebCore6String6formatEPKcz
 __ZNK7WebCore6String19characterStartingAtEj
@@ -1534,7 +1532,6 @@ __ZN3WTF6VectorItLm0EE6appendItEEvPKT_m
 _cti_op_to_primitive
 __ZN3JSC15constructNumberEPNS_9ExecStateENS_7JSValueE
 __ZNK3JSC12NumberObject9classInfoEv
-__Z12jsRegExpFreeP8JSRegExp
 __ZN3JSC13BooleanObjectD1Ev
 __ZN3JSCL18stringFromCharCodeEPNS_9ExecStateEPNS_8JSObjectENS_7JSValueERKNS_7ArgListE
 __ZN3JSC10makeStringIPKcNS_7UStringES2_EES3_T_T0_T1_
@@ -1545,7 +1542,6 @@ __ZN3JSC8JSObject18getPrimitiveNumberEPNS_9ExecStateERdRNS_7JSValueE
 __ZN3JSCL24dateProtoFuncGetFullYearEPNS_9ExecStateEPNS_8JSObjectENS_7JSValueERKNS_7ArgListE
 __ZN3JSC12RegExpObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE
 __ZN3JSCL24setRegExpObjectLastIndexEPNS_9ExecStateEPNS_8JSObjectENS_7JSValueE
-__Z15jsc_pcre_xclassiPKh
 __ZN3JSCL28regExpConstructorLeftContextEPNS_9ExecStateENS_7JSValueERKNS_10IdentifierE
 __ZNK3JSC17RegExpConstructor14getLeftContextEPNS_9ExecStateE
 _cti_to_object
@@ -1790,7 +1786,6 @@ __ZN3JSCL28dateProtoFuncGetMilliSecondsEPNS_9ExecStateEPNS_8JSObjectENS_7JSValue
 __ZN3JSC10makeStringINS_7UStringES1_EES1_T_T0_
 __ZN3JSC13tryMakeStringINS_7UStringES1_EEN3WTF10PassRefPtrIN7WebCore10StringImplEEET_T0_
 __ZN3JSC23MacroAssemblerX86Common8branch16ENS0_9ConditionENS_22AbstractMacroAssemblerINS_12X86AssemblerEE9BaseIndexENS4_5Imm32E
-__Z22jsc_pcre_ucp_othercasej
 __ZN3JSC8JSString18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE
 __ZN3JSCL24dateProtoFuncSetUTCHoursEPNS_9ExecStateEPNS_8JSObjectENS_7JSValueERKNS_7ArgListE
 __ZN3JSCL26dateProtoFuncSetUTCMinutesEPNS_9ExecStateEPNS_8JSObjectENS_7JSValueERKNS_7ArgListE
index 06613a1..ff0be31 100644 (file)
@@ -31,7 +31,6 @@ JAVASCRIPTCORE_INCLUDEPATH = \
     $$PWD/interpreter \
     $$PWD/jit \
     $$PWD/parser \
-    $$PWD/pcre \
     $$PWD/profiler \
     $$PWD/runtime \
     $$PWD/wtf \
index 514d7c8..49bb2d6 100644 (file)
                        </File>
                </Filter>
                <Filter
-                       Name="pcre"
-                       >
-                       <File
-                               RelativePath="..\..\pcre\pcre.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\pcre\pcre_compile.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\pcre\pcre_exec.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\pcre\pcre_internal.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\pcre\pcre_tables.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\pcre\pcre_ucp_searchfuncs.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\pcre\pcre_xclass.cpp"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\pcre\ucpinternal.h"
-                               >
-                       </File>
-               </Filter>
-               <Filter
                        Name="API"
                        >
                        <File
index 2a85beb..4a7f4d3 100644 (file)
@@ -6,7 +6,7 @@
        >
        <Tool
                Name="VCCLCompilerTool"
-               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\&quot;;../../;../../API/;../../pcre/;../../parser/;../../bytecompiler/;../../jit/;../../runtime/;../../bytecode/;../../interpreter/;../../wtf/;../../profiler;../../assembler/;../../debugger/;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;;&quot;$(ConfigurationBuildDir)\include&quot;;&quot;$(ConfigurationBuildDir)\include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;"
+               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\&quot;;../../;../../API/;../../parser/;../../bytecompiler/;../../jit/;../../runtime/;../../bytecode/;../../interpreter/;../../wtf/;../../profiler;../../assembler/;../../debugger/;&quot;$(WebKitLibrariesDir)\include&quot;;&quot;$(WebKitLibrariesDir)\include\private&quot;;&quot;$(ConfigurationBuildDir)\include&quot;;&quot;$(ConfigurationBuildDir)\include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;"
                PreprocessorDefinitions="__STD_C"
                ForcedIncludeFiles="ICUVersion.h"
        />
index 0decefa..314a794 100644 (file)
@@ -39,7 +39,6 @@ all:
     xcopy /y /d "..\..\debugger\*.h" "%ConfigurationBuildDir%\include\private\JavaScriptCore"
     xcopy /y /d "..\..\profiler\*.h" "%ConfigurationBuildDir%\include\private\JavaScriptCore"
     xcopy /y /d "..\..\create_hash_table" "%ConfigurationBuildDir%\include\private\JavaScriptCore"
-    xcopy /y /d "..\..\pcre\pcre.h" "%ConfigurationBuildDir%\include\private\JavaScriptCore"
     xcopy /y /d "..\..\wtf\text\AtomicString.cpp" "%ConfigurationBuildDir%\include\private\JavaScriptCore"
     xcopy /y /d "..\..\wtf\text\StringBuilder.cpp" "%ConfigurationBuildDir%\include\private\JavaScriptCore"
     xcopy /y /d "..\..\wtf\text\StringImpl.cpp" "%ConfigurationBuildDir%\include\private\JavaScriptCore"
index b74b939..6e2321f 100644 (file)
@@ -7,7 +7,7 @@
        >
        <Tool
                Name="VCCLCompilerTool"
-               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../pcre/;../../parser/;../../wtf/;../../wtf/unicode/;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;../../../icu/include;../../bindings;../../bindings/c;../../bindings/jni;&quot;$(ConfigurationBuildDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;"
+               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../parser/;../../wtf/;../../wtf/unicode/;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(WebKitLibrariesDir)\include&quot;;../../../icu/include;../../bindings;../../bindings/c;../../bindings/jni;&quot;$(ConfigurationBuildDir)\include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;"
                PreprocessorDefinitions="__STD_C"
                ForcedIncludeFiles="ICUVersion.h"
                ProgramDataBaseFileName="$(OutDir)\$(TargetName).vc80.pdb"
index d1c3638..3e329c3 100644 (file)
@@ -6,7 +6,7 @@
        >
        <Tool
                Name="VCCLCompilerTool"
-               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\include&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../pcre/;../../assembler/;../../API/;../../parser/;../../runtime/;../../VM/;../../bytecode/;../../interpreter/;../../wtf/;../../debugger/;../../bytecompiler/;../../profiler;../../jit/;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
+               AdditionalIncludeDirectories="&quot;$(ConfigurationBuildDir)\include&quot;;&quot;$(ConfigurationBuildDir)\include\private&quot;;&quot;$(ConfigurationBuildDir)\obj\JavaScriptCore\DerivedSources\&quot;;../../;&quot;../../os-win32/&quot;;../../assembler/;../../API/;../../parser/;../../runtime/;../../VM/;../../bytecode/;../../interpreter/;../../wtf/;../../debugger/;../../bytecompiler/;../../profiler;../../jit/;&quot;$(WebKitLibrariesDir)\include\pthreads&quot;;&quot;$(WebKitLibrariesDir)\include&quot;"
                PreprocessorDefinitions="__STD_C"
                ForcedIncludeFiles="ICUVersion.h"
                ForcedUsingFiles=""
index cc25c40..d48139f 100644 (file)
                90D3469C0E285280009492EE /* RefCountedLeakCounter.h in Headers */ = {isa = PBXBuildFile; fileRef = 90D3469B0E285280009492EE /* RefCountedLeakCounter.h */; settings = {ATTRIBUTES = (Private, ); }; };
                93052C340FB792190048FDC3 /* ParserArena.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93052C320FB792190048FDC3 /* ParserArena.cpp */; };
                93052C350FB792190048FDC3 /* ParserArena.h in Headers */ = {isa = PBXBuildFile; fileRef = 93052C330FB792190048FDC3 /* ParserArena.h */; settings = {ATTRIBUTES = (); }; };
-               930754C108B0F68000AB3056 /* pcre_compile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930754BF08B0F68000AB3056 /* pcre_compile.cpp */; };
-               930754D008B0F74600AB3056 /* pcre_tables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930754CE08B0F74500AB3056 /* pcre_tables.cpp */; };
-               930754EB08B0F78500AB3056 /* pcre_exec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930754E908B0F78500AB3056 /* pcre_exec.cpp */; settings = {COMPILER_FLAGS = "-fno-move-loop-invariants"; }; };
                932F5BD30822A1C700736975 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6560A4CF04B3B3E7008AE952 /* CoreFoundation.framework */; };
                932F5BD50822A1C700736975 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; };
                932F5BD60822A1C700736975 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EC0705C86C9A00E6DF1B /* libobjc.dylib */; };
                9330402C0E6A764000786E6A /* SmallStrings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93303FE80E6A72B500786E6A /* SmallStrings.cpp */; };
                9335F24D12E6765B002B5553 /* StringRecursionChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93345A8712D838C400302BE3 /* StringRecursionChecker.cpp */; };
                933F5CDC1269229B0049191E /* NullPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 933F5CDB126922690049191E /* NullPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               937013480CA97E0E00FA14D3 /* pcre_ucp_searchfuncs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 937013470CA97E0E00FA14D3 /* pcre_ucp_searchfuncs.cpp */; settings = {COMPILER_FLAGS = "-Wno-sign-compare"; }; };
                93854A9A12C93D3B00DAAF77 /* NullPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93854A9912C93D3B00DAAF77 /* NullPtr.cpp */; };
-               93E26BD408B1514100F85226 /* pcre_xclass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93E26BD308B1514100F85226 /* pcre_xclass.cpp */; };
                9534AAFB0E5B7A9600B8A45B /* JSProfilerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 952C63AC0E4777D600C13936 /* JSProfilerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                95742F650DD11F5A000917FB /* Profile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95742F630DD11F5A000917FB /* Profile.cpp */; };
                95AB83420DA4322500BC83F3 /* Profiler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 95AB832E0DA42CAD00BC83F3 /* Profiler.cpp */; };
                BC18C44A0E16F5CD00B34460 /* OwnPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 9303F567099118FA00AD71B8 /* OwnPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC18C44B0E16F5CD00B34460 /* Parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 93F0B3AA09BB4DC00068FCE3 /* Parser.h */; settings = {ATTRIBUTES = (); }; };
                BC18C44C0E16F5CD00B34460 /* PassRefPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 6580F795094070560082C219 /* PassRefPtr.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC18C44D0E16F5CD00B34460 /* pcre.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541720F039E08B90058BFEB /* pcre.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC18C44E0E16F5CD00B34460 /* pcre_internal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E26BE508B1517100F85226 /* pcre_internal.h */; };
                BC18C44F0E16F5CD00B34460 /* Platform.h in Headers */ = {isa = PBXBuildFile; fileRef = 65D6D87E09B5A32E0002E4D7 /* Platform.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC18C4500E16F5CD00B34460 /* Profile.h in Headers */ = {isa = PBXBuildFile; fileRef = 95742F640DD11F5A000917FB /* Profile.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC18C4510E16F5CD00B34460 /* ProfileNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 95AB83550DA43B4400BC83F3 /* ProfileNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC18C46F0E16F5CD00B34460 /* TCSystemAlloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 6541BD7108E80A17002CBEE7 /* TCSystemAlloc.h */; };
                BC18C4700E16F5CD00B34460 /* Threading.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE79220D6C95CD00FEA3BA /* Threading.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC18C4710E16F5CD00B34460 /* ThreadSpecific.h in Headers */ = {isa = PBXBuildFile; fileRef = E1B7C8BD0DA3A3360074B0DC /* ThreadSpecific.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               BC18C4720E16F5CD00B34460 /* ucpinternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 93E26BFC08B151D400F85226 /* ucpinternal.h */; };
                BC18C4730E16F5CD00B34460 /* Unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = E195679409E7CF1200B89D13 /* Unicode.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC18C4740E16F5CD00B34460 /* UnicodeIcu.h in Headers */ = {isa = PBXBuildFile; fileRef = E195678F09E7CF1200B89D13 /* UnicodeIcu.h */; settings = {ATTRIBUTES = (Private, ); }; };
                BC18C4750E16F5CD00B34460 /* UnusedParam.h in Headers */ = {isa = PBXBuildFile; fileRef = 935AF46B09E9D9DB00ACD1D8 /* UnusedParam.h */; settings = {ATTRIBUTES = (Private, ); }; };
                652246A40C8D7A0E007BDAF7 /* HashIterators.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashIterators.h; sourceTree = "<group>"; };
                65400C0F0A69BAF200509887 /* PropertyNameArray.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PropertyNameArray.cpp; sourceTree = "<group>"; };
                65400C100A69BAF200509887 /* PropertyNameArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PropertyNameArray.h; sourceTree = "<group>"; };
-               6541720F039E08B90058BFEB /* pcre.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = pcre.h; sourceTree = "<group>"; tabWidth = 8; };
                6541BD6E08E80A17002CBEE7 /* TCPageMap.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = TCPageMap.h; sourceTree = "<group>"; tabWidth = 8; };
                6541BD6F08E80A17002CBEE7 /* TCSpinLock.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = TCSpinLock.h; sourceTree = "<group>"; tabWidth = 8; };
                6541BD7008E80A17002CBEE7 /* TCSystemAlloc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TCSystemAlloc.cpp; sourceTree = "<group>"; tabWidth = 8; };
                6580F795094070560082C219 /* PassRefPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = PassRefPtr.h; sourceTree = "<group>"; tabWidth = 8; };
                6592C316098B7DE10003D4F6 /* Vector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Vector.h; sourceTree = "<group>"; };
                6592C317098B7DE10003D4F6 /* VectorTraits.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = VectorTraits.h; sourceTree = "<group>"; };
-               65B174BE09D1000200820339 /* chartables.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.c; fileEncoding = 30; path = chartables.c; sourceTree = "<group>"; };
                65C02FBB0637462A003E7EE6 /* Protect.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = Protect.h; sourceTree = "<group>"; tabWidth = 8; };
                65C647B3093EF8D60022C380 /* RefPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = RefPtr.h; sourceTree = "<group>"; tabWidth = 8; };
                65C7A1710A8EAACB00FA37EA /* JSWrapperObject.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSWrapperObject.cpp; sourceTree = "<group>"; };
                9303F5A409911A5800AD71B8 /* OwnArrayPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OwnArrayPtr.h; sourceTree = "<group>"; };
                93052C320FB792190048FDC3 /* ParserArena.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ParserArena.cpp; sourceTree = "<group>"; };
                93052C330FB792190048FDC3 /* ParserArena.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParserArena.h; sourceTree = "<group>"; };
-               930754BF08B0F68000AB3056 /* pcre_compile.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pcre_compile.cpp; sourceTree = "<group>"; tabWidth = 8; };
-               930754CE08B0F74500AB3056 /* pcre_tables.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pcre_tables.cpp; sourceTree = "<group>"; tabWidth = 8; };
-               930754E908B0F78500AB3056 /* pcre_exec.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pcre_exec.cpp; sourceTree = "<group>"; tabWidth = 8; };
                930DAD030FB1EB1A0082D205 /* NodeConstructors.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NodeConstructors.h; sourceTree = "<group>"; };
                9322A00306C341D3009067BB /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; };
                932F5BD80822A1C700736975 /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; tabWidth = 8; usesTabs = 1; };
                933F5CDB126922690049191E /* NullPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NullPtr.h; sourceTree = "<group>"; };
                935AF46909E9D9DB00ACD1D8 /* Forward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Forward.h; sourceTree = "<group>"; };
                935AF46B09E9D9DB00ACD1D8 /* UnusedParam.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnusedParam.h; sourceTree = "<group>"; };
-               937013470CA97E0E00FA14D3 /* pcre_ucp_searchfuncs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pcre_ucp_searchfuncs.cpp; sourceTree = "<group>"; };
                9374D3A7038D9D74008635CE /* ScopeChain.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = ScopeChain.h; sourceTree = "<group>"; tabWidth = 8; };
                9374D3A8038D9D74008635CE /* ScopeChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScopeChain.cpp; sourceTree = "<group>"; tabWidth = 8; };
                937B63CC09E766D200A671DD /* DerivedSources.make */ = {isa = PBXFileReference; explicitFileType = sourcecode.make; fileEncoding = 4; path = DerivedSources.make; sourceTree = "<group>"; usesTabs = 1; };
                93ADFCE60CCBD7AC00D30B08 /* JSArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSArray.cpp; sourceTree = "<group>"; };
                93B6A0DE0AA64DA40076DE27 /* GetPtr.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = GetPtr.h; sourceTree = "<group>"; };
                93CEDDFB0EA91EE600258EBE /* RegExpMatchesArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegExpMatchesArray.h; sourceTree = "<group>"; };
-               93E26BD308B1514100F85226 /* pcre_xclass.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pcre_xclass.cpp; sourceTree = "<group>"; tabWidth = 8; };
-               93E26BE508B1517100F85226 /* pcre_internal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = pcre_internal.h; sourceTree = "<group>"; tabWidth = 8; };
-               93E26BFC08B151D400F85226 /* ucpinternal.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = ucpinternal.h; sourceTree = "<group>"; tabWidth = 8; };
                93F0B3A909BB4DC00068FCE3 /* Parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Parser.cpp; sourceTree = "<group>"; };
                93F0B3AA09BB4DC00068FCE3 /* Parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Parser.h; sourceTree = "<group>"; };
                93F1981A08245AAE001E9ABC /* Keywords.table */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = text; path = Keywords.table; sourceTree = "<group>"; tabWidth = 8; };
                                1429D77A0ED20D7300B89619 /* interpreter */,
                                1429D92C0ED22D7000B89619 /* jit */,
                                7E39D8370EC3A388003AF11A /* parser */,
-                               65417203039E01F90058BFEB /* pcre */,
                                95AB831A0DA42C6900BC83F3 /* profiler */,
                                7EF6E0BB0EB7A1EC0079AFAF /* runtime */,
                                141211000A48772600480255 /* tests */,
                        isa = PBXGroup;
                        children = (
                                BC18C5230E16FC8A00B34460 /* ArrayPrototype.lut.h */,
-                               65B174BE09D1000200820339 /* chartables.c */,
                                BCD203E70E1718F4002C7E82 /* DatePrototype.lut.h */,
                                BC8149AF12F89F53007B2C32 /* HeaderDetection.h */,
                                BC87CDB810712ACA000614CF /* JSONObject.lut.h */,
                        tabWidth = 4;
                        usesTabs = 0;
                };
-               65417203039E01F90058BFEB /* pcre */ = {
-                       isa = PBXGroup;
-                       children = (
-                               6541720F039E08B90058BFEB /* pcre.h */,
-                               930754BF08B0F68000AB3056 /* pcre_compile.cpp */,
-                               930754E908B0F78500AB3056 /* pcre_exec.cpp */,
-                               93E26BE508B1517100F85226 /* pcre_internal.h */,
-                               930754CE08B0F74500AB3056 /* pcre_tables.cpp */,
-                               937013470CA97E0E00FA14D3 /* pcre_ucp_searchfuncs.cpp */,
-                               93E26BD308B1514100F85226 /* pcre_xclass.cpp */,
-                               93E26BFC08B151D400F85226 /* ucpinternal.h */,
-                       );
-                       path = pcre;
-                       sourceTree = "<group>";
-                       tabWidth = 4;
-                       usesTabs = 0;
-               };
                7E39D81D0EC38EFA003AF11A /* bytecompiler */ = {
                        isa = PBXGroup;
                        children = (
                                BCFBE696122560E800309E9D /* PassOwnArrayPtr.h in Headers */,
                                44DD48530FAEA85000D6B4EB /* PassOwnPtr.h in Headers */,
                                BC18C44C0E16F5CD00B34460 /* PassRefPtr.h in Headers */,
-                               BC18C44D0E16F5CD00B34460 /* pcre.h in Headers */,
-                               BC18C44E0E16F5CD00B34460 /* pcre_internal.h in Headers */,
                                BC18C44F0E16F5CD00B34460 /* Platform.h in Headers */,
                                A7D649AA1015224E009B2E1B /* PossiblyNull.h in Headers */,
                                BC18C4500E16F5CD00B34460 /* Profile.h in Headers */,
                                14A42E400F4F60EE00599099 /* TimeoutChecker.h in Headers */,
                                5D53726F0E1C54880021E549 /* Tracing.h in Headers */,
                                0B4D7E630F319AC800AD7E58 /* TypeTraits.h in Headers */,
-                               BC18C4720E16F5CD00B34460 /* ucpinternal.h in Headers */,
                                BC18C4730E16F5CD00B34460 /* Unicode.h in Headers */,
                                BC18C4740E16F5CD00B34460 /* UnicodeIcu.h in Headers */,
                                BC18C4750E16F5CD00B34460 /* UnusedParam.h in Headers */,
                                9714AF5E122F32070092D9F5 /* ParsedURL.cpp in Sources */,
                                148F21BC107EC54D0042EC2C /* Parser.cpp in Sources */,
                                93052C340FB792190048FDC3 /* ParserArena.cpp in Sources */,
-                               930754C108B0F68000AB3056 /* pcre_compile.cpp in Sources */,
-                               930754EB08B0F78500AB3056 /* pcre_exec.cpp in Sources */,
-                               930754D008B0F74600AB3056 /* pcre_tables.cpp in Sources */,
-                               937013480CA97E0E00FA14D3 /* pcre_ucp_searchfuncs.cpp in Sources */,
-                               93E26BD408B1514100F85226 /* pcre_xclass.cpp in Sources */,
                                95742F650DD11F5A000917FB /* Profile.cpp in Sources */,
                                95CD45760E1C4FDD0085358E /* ProfileGenerator.cpp in Sources */,
                                95AB83560DA43C3000BC83F3 /* ProfileNode.cpp in Sources */,
diff --git a/Source/JavaScriptCore/pcre/AUTHORS b/Source/JavaScriptCore/pcre/AUTHORS
deleted file mode 100644 (file)
index dbac2a5..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-Originally written by:  Philip Hazel
-Email local part:       ph10
-Email domain:           cam.ac.uk
-
-University of Cambridge Computing Service,
-Cambridge, England. Phone: +44 1223 334714.
-
-Copyright (c) 1997-2005 University of Cambridge. All rights reserved.
-
-Adapted for JavaScriptCore and WebKit by Apple Inc.
-
-Copyright (c) 2005, 2006, 2007 Apple Inc. All rights reserved.
diff --git a/Source/JavaScriptCore/pcre/COPYING b/Source/JavaScriptCore/pcre/COPYING
deleted file mode 100644 (file)
index 6ffdc24..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-PCRE is a library of functions to support regular expressions whose syntax
-and semantics are as close as possible to those of the Perl 5 language.
-
-This is JavaScriptCore's variant of the PCRE library. While this library
-started out as a copy of PCRE, many of the features of PCRE have been
-removed.
-
-Copyright (c) 1997-2005 University of Cambridge. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-    * Neither the name of the University of Cambridge nor the name of Apple
-      Inc. nor the names of their contributors may be used to endorse or
-      promote products derived from this software without specific prior
-      written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
diff --git a/Source/JavaScriptCore/pcre/dftables b/Source/JavaScriptCore/pcre/dftables
deleted file mode 100755 (executable)
index 669b948..0000000
+++ /dev/null
@@ -1,273 +0,0 @@
-#!/usr/bin/perl -w
-#
-# This is JavaScriptCore's variant of the PCRE library. While this library
-# started out as a copy of PCRE, many of the features of PCRE have been
-# removed. This library now supports only the regular expression features
-# required by the JavaScript language specification, and has only the functions
-# needed by JavaScriptCore and the rest of WebKit.
-# 
-#                  Originally written by Philip Hazel
-#            Copyright (c) 1997-2006 University of Cambridge
-#  Copyright (C) 2002, 2004, 2006, 2007, 2008, 2009 Apple Inc.  All rights reserved.
-# 
-# -----------------------------------------------------------------------------
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# 
-#     * Redistributions of source code must retain the above copyright notice,
-#       this list of conditions and the following disclaimer.
-# 
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-# 
-#     * Neither the name of the University of Cambridge nor the names of its
-#       contributors may be used to endorse or promote products derived from
-#       this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-# -----------------------------------------------------------------------------
-
-# This is a freestanding support program to generate a file containing
-# character tables. The tables are built according to the default C
-# locale.
-
-use strict;
-
-use File::Basename;
-use File::Spec;
-use File::Temp qw(tempfile);
-use Getopt::Long;
-
-sub readHeaderValues();
-
-my %pcre_internal;
-
-if (scalar(@ARGV) < 1) {
-    print STDERR "Usage: ", basename($0), " [--preprocessor=program] output-file\n";
-    exit 1;
-}
-
-my $outputFile;
-my $preprocessor;
-GetOptions('preprocessor=s' => \$preprocessor);
-if (not $preprocessor) {
-    $preprocessor = "cpp";
-}
-
-$outputFile = $ARGV[0];
-die('Must specify output file.') unless defined($outputFile);
-
-readHeaderValues();
-
-open(OUT, ">", $outputFile) or die "$!";
-binmode(OUT);
-
-printf(OUT
-    "/*************************************************\n" .
-    "*      Perl-Compatible Regular Expressions       *\n" .
-    "*************************************************/\n\n" .
-    "/* This file is automatically written by the dftables auxiliary \n" .
-    "program. If you edit it by hand, you might like to edit the Makefile to \n" .
-    "prevent its ever being regenerated.\n\n");
-printf(OUT
-    "This file contains the default tables for characters with codes less than\n" .
-    "128 (ASCII characters). These tables are used when no external tables are\n" .
-    "passed to PCRE. */\n\n" .
-    "const unsigned char jsc_pcre_default_tables[%d] = {\n\n" .
-    "/* This table is a lower casing table. */\n\n", $pcre_internal{tables_length});
-
-if ($pcre_internal{lcc_offset} != 0) {
-    die "lcc_offset != 0";
-}
-
-printf(OUT "  ");
-for (my $i = 0; $i < 128; $i++) {
-    if (($i & 7) == 0 && $i != 0) {
-        printf(OUT "\n  ");
-    }
-    printf(OUT "0x%02X", ord(lc(chr($i))));
-    if ($i != 127) {
-        printf(OUT ", ");
-    }
-}
-printf(OUT ",\n\n");
-
-printf(OUT "/* This table is a case flipping table. */\n\n");
-
-if ($pcre_internal{fcc_offset} != 128) {
-  die "fcc_offset != 128";
-}
-
-printf(OUT "  ");
-for (my $i = 0; $i < 128; $i++) {
-    if (($i & 7) == 0 && $i != 0) {
-        printf(OUT "\n  ");
-    }
-    my $c = chr($i);
-    printf(OUT "0x%02X", $c =~ /[[:lower:]]/ ? ord(uc($c)) : ord(lc($c)));
-    if ($i != 127) {
-        printf(OUT ", ");
-    }
-}
-printf(OUT ",\n\n");
-
-printf(OUT
-    "/* This table contains bit maps for various character classes.\n" .
-    "Each map is 32 bytes long and the bits run from the least\n" .
-    "significant end of each byte. The classes are: space, digit, word. */\n\n");
-
-if ($pcre_internal{cbits_offset} != $pcre_internal{fcc_offset} + 128) {
-    die "cbits_offset != fcc_offset + 128";
-}
-
-my @cbit_table = (0) x $pcre_internal{cbit_length};
-for (my $i = ord('0'); $i <= ord('9'); $i++) {
-    $cbit_table[$pcre_internal{cbit_digit} + $i / 8] |= 1 << ($i & 7);
-}
-$cbit_table[$pcre_internal{cbit_word} + ord('_') / 8] |= 1 << (ord('_') & 7);
-for (my $i = 0; $i < 128; $i++) {
-    my $c = chr($i);
-    if ($c =~ /[[:alnum:]]/) {
-        $cbit_table[$pcre_internal{cbit_word} + $i / 8] |= 1 << ($i & 7);
-    }
-    if ($c =~ /[[:space:]]/) {
-        $cbit_table[$pcre_internal{cbit_space} + $i / 8] |= 1 << ($i & 7);
-    }
-}
-
-printf(OUT "  ");
-for (my $i = 0; $i < $pcre_internal{cbit_length}; $i++) {
-    if (($i & 7) == 0 && $i != 0) {
-        if (($i & 31) == 0) {
-            printf(OUT "\n");
-        }
-        printf(OUT "\n  ");
-    }
-    printf(OUT "0x%02X", $cbit_table[$i]);
-    if ($i != $pcre_internal{cbit_length} - 1) {
-        printf(OUT ", ");
-    }
-}
-printf(OUT ",\n\n");
-
-printf(OUT
-    "/* This table identifies various classes of character by individual bits:\n" .
-    "  0x%02x   white space character\n" .
-    "  0x%02x   hexadecimal digit\n" .
-    "  0x%02x   alphanumeric or '_'\n*/\n\n",
-    $pcre_internal{ctype_space}, $pcre_internal{ctype_xdigit}, $pcre_internal{ctype_word});
-
-if ($pcre_internal{ctypes_offset} != $pcre_internal{cbits_offset} + $pcre_internal{cbit_length}) {
-    die "ctypes_offset != cbits_offset + cbit_length";
-}
-
-printf(OUT "  ");
-for (my $i = 0; $i < 128; $i++) {
-    my $x = 0;
-    my $c = chr($i);
-    if ($c =~ /[[:space:]]/) {
-        $x += $pcre_internal{ctype_space};
-    }
-    if ($c =~ /[[:xdigit:]]/) {
-        $x += $pcre_internal{ctype_xdigit};
-    }
-    if ($c =~ /[[:alnum:]_]/) {
-        $x += $pcre_internal{ctype_word};
-    }
-    printf(OUT "0x%02X", $x);
-    if ($i != 127) {
-        printf(OUT ", ");
-    } else {
-        printf(OUT "};");
-    }
-    if (($i & 7) == 7) {
-        printf(OUT " /* ");
-        my $d = chr($i - 7);
-        if ($d =~ /[[:print:]]/) {
-            printf(OUT " %c -", $i - 7);
-        } else {
-            printf(OUT "%3d-", $i - 7);
-        }
-        if ($c =~ m/[[:print:]]/) {
-            printf(OUT " %c ", $i);
-        } else {
-            printf(OUT "%3d", $i);
-        }
-        printf(OUT " */\n");
-        if ($i != 127) {
-            printf(OUT "  ");
-        }
-    }
-}
-
-if ($pcre_internal{tables_length} != $pcre_internal{ctypes_offset} + 128) {
-    die "tables_length != ctypes_offset + 128";
-}
-
-printf(OUT "\n\n/* End of chartables.c */\n");
-
-close(OUT);
-
-exit 0;
-
-sub readHeaderValues()
-{
-    my @variables = qw(
-        cbit_digit
-        cbit_length
-        cbit_space
-        cbit_word
-        cbits_offset
-        ctype_space
-        ctype_word
-        ctype_xdigit
-        ctypes_offset
-        fcc_offset
-        lcc_offset
-        tables_length
-    );
-
-    local $/ = undef;
-
-    my $headerPath = File::Spec->catfile(dirname($0), "pcre_internal.h");
-    my ($fh, $tempFile) = tempfile(
-        basename($0) . "-XXXXXXXX",
-        DIR => File::Spec->tmpdir(),
-        SUFFIX => ".in",
-        UNLINK => 0,
-    );
-
-    print $fh "#define DFTABLES\n\n";
-
-    open(HEADER, "<", $headerPath) or die "$!";
-    print $fh <HEADER>;
-    close(HEADER);
-
-    print $fh "\n\n";
-
-    for my $v (@variables) {
-        print $fh "\$pcre_internal{\"$v\"} = $v;\n";
-    }
-
-    close($fh);
-
-    open(CPP, "$preprocessor \"$tempFile\" |") or die "$!";
-    my $content = <CPP>;
-    close(CPP);
-    
-    eval $content;
-    die "$@" if $@;
-    unlink $tempFile;
-}
diff --git a/Source/JavaScriptCore/pcre/pcre.h b/Source/JavaScriptCore/pcre/pcre.h
deleted file mode 100644 (file)
index 55044fd..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/* This is the public header file for JavaScriptCore's variant of the PCRE
-library. While this library started out as a copy of PCRE, many of the
-features of PCRE have been removed. This library now supports only the
-regular expression features required by the JavaScript language
-specification, and has only the functions needed by JavaScriptCore and the
-rest of WebKit.
-
-           Copyright (c) 1997-2005 University of Cambridge
-    Copyright (C) 2002, 2004, 2006, 2007 Apple Inc. All rights reserved.
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-    * Neither the name of the University of Cambridge nor the names of its
-      contributors may be used to endorse or promote products derived from
-      this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-// FIXME: This file needs to be renamed to JSRegExp.h; it's no longer PCRE.
-
-#ifndef JSRegExp_h
-#define JSRegExp_h
-
-#include <wtf/unicode/Unicode.h>
-
-struct JSRegExp;
-
-enum JSRegExpIgnoreCaseOption { JSRegExpDoNotIgnoreCase, JSRegExpIgnoreCase };
-enum JSRegExpMultilineOption { JSRegExpSingleLine, JSRegExpMultiline };
-
-/* jsRegExpExecute error codes */
-const int JSRegExpErrorNoMatch = -1;
-const int JSRegExpErrorHitLimit = -2;
-const int JSRegExpErrorNoMemory = -3;
-const int JSRegExpErrorInternal = -4;
-
-JSRegExp* jsRegExpCompile(const UChar* pattern, int patternLength,
-    JSRegExpIgnoreCaseOption, JSRegExpMultilineOption,
-    unsigned* numSubpatterns, const char** errorMessage);
-
-int jsRegExpExecute(const JSRegExp*,
-    const UChar* subject, int subjectLength, int startOffset,
-    int* offsetsVector, int offsetsVectorLength);
-
-void jsRegExpFree(JSRegExp*);
-
-#endif
diff --git a/Source/JavaScriptCore/pcre/pcre.pri b/Source/JavaScriptCore/pcre/pcre.pri
deleted file mode 100644 (file)
index 3652d95..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-# Perl Compatible Regular Expressions - Qt4 build info
-VPATH += $$PWD
-INCLUDEPATH += $$PWD $$OUTPUT_DIR/Source/JavaScriptCore/generated
-DEPENDPATH += $$PWD
-
-SOURCES += \
-    pcre_compile.cpp \
-    pcre_exec.cpp \
-    pcre_tables.cpp \
-    pcre_ucp_searchfuncs.cpp \
-    pcre_xclass.cpp
-
diff --git a/Source/JavaScriptCore/pcre/pcre_compile.cpp b/Source/JavaScriptCore/pcre/pcre_compile.cpp
deleted file mode 100644 (file)
index 9d472d8..0000000
+++ /dev/null
@@ -1,2708 +0,0 @@
-/* This is JavaScriptCore's variant of the PCRE library. While this library
-started out as a copy of PCRE, many of the features of PCRE have been
-removed. This library now supports only the regular expression features
-required by the JavaScript language specification, and has only the functions
-needed by JavaScriptCore and the rest of WebKit.
-
-                 Originally written by Philip Hazel
-           Copyright (c) 1997-2006 University of Cambridge
-    Copyright (C) 2002, 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-    Copyright (C) 2007 Eric Seidel <eric@webkit.org>
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-    * Neither the name of the University of Cambridge nor the names of its
-      contributors may be used to endorse or promote products derived from
-      this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-/* This module contains the external function jsRegExpExecute(), along with
-supporting internal functions that are not used by other modules. */
-
-#include "config.h"
-
-#include "pcre_internal.h"
-
-#include <string.h>
-#include <wtf/ASCIICType.h>
-#include <wtf/FastMalloc.h>
-#include <wtf/FixedArray.h>
-#include <wtf/StdLibExtras.h>
-
-using namespace WTF;
-
-/* Negative values for the firstchar and reqchar variables */
-
-#define REQ_UNSET (-2)
-#define REQ_NONE  (-1)
-
-/*************************************************
-*      Code parameters and static tables         *
-*************************************************/
-
-/* Maximum number of items on the nested bracket stacks at compile time. This
-applies to the nesting of all kinds of parentheses. It does not limit
-un-nested, non-capturing parentheses. This number can be made bigger if
-necessary - it is used to dimension one int and one unsigned char vector at
-compile time. */
-
-#define BRASTACK_SIZE 200
-
-/* Table for handling escaped characters in the range '0'-'z'. Positive returns
-are simple data values; negative values are for special things like \d and so
-on. Zero means further processing is needed (for things like \x), or the escape
-is invalid. */
-
-static const short escapes[] = {
-     0,      0,      0,      0,      0,      0,      0,      0,   /* 0 - 7 */
-     0,      0,    ':',    ';',    '<',    '=',    '>',    '?',   /* 8 - ? */
-   '@',      0, -ESC_B,      0, -ESC_D,      0,      0,      0,   /* @ - G */
-     0,      0,      0,      0,      0,      0,      0,      0,   /* H - O */
-     0,      0,      0, -ESC_S,      0,      0,      0, -ESC_W,   /* P - W */
-     0,      0,      0,    '[',   '\\',    ']',    '^',    '_',   /* X - _ */
-   '`',      7, -ESC_b,      0, -ESC_d,      0,   '\f',      0,   /* ` - g */
-     0,      0,      0,      0,      0,      0,   '\n',      0,   /* h - o */
-     0,      0,    '\r', -ESC_s,   '\t',      0,  '\v', -ESC_w,   /* p - w */
-     0,      0,      0                                            /* x - z */
-};
-
-/* Error code numbers. They are given names so that they can more easily be
-tracked. */
-
-enum ErrorCode {
-    ERR0, ERR1, ERR2, ERR3, ERR4, ERR5, ERR6, ERR7, ERR8, ERR9,
-    ERR10, ERR11, ERR12, ERR13, ERR14, ERR15, ERR16, ERR17
-};
-
-/* The texts of compile-time error messages. These are "char *" because they
-are passed to the outside world. */
-
-static const char* errorText(ErrorCode code)
-{
-    static const char errorTexts[] =
-      /* 1 */
-      "\\ at end of pattern\0"
-      "\\c at end of pattern\0"
-      "character value in \\x{...} sequence is too large\0"
-      "numbers out of order in {} quantifier\0"
-      /* 5 */
-      "number too big in {} quantifier\0"
-      "missing terminating ] for character class\0"
-      "internal error: code overflow\0"
-      "range out of order in character class\0"
-      "nothing to repeat\0"
-      /* 10 */
-      "unmatched parentheses\0"
-      "internal error: unexpected repeat\0"
-      "unrecognized character after (?\0"
-      "failed to get memory\0"
-      "missing )\0"
-      /* 15 */
-      "reference to non-existent subpattern\0"
-      "regular expression too large\0"
-      "parentheses nested too deeply"
-    ;
-
-    int i = code;
-    const char* text = errorTexts;
-    while (i > 1)
-        i -= !*text++;
-    return text;
-}
-
-/* Structure for passing "static" information around between the functions
-doing the compiling. */
-
-struct CompileData {
-    CompileData() {
-        topBackref = 0;
-        backrefMap = 0;
-        reqVaryOpt = 0;
-        needOuterBracket = false;
-        numCapturingBrackets = 0;
-    }
-    int topBackref;            /* Maximum back reference */
-    unsigned backrefMap;       /* Bitmap of low back refs */
-    int reqVaryOpt;            /* "After variable item" flag for reqByte */
-    bool needOuterBracket;
-    int numCapturingBrackets;
-};
-
-/* Definitions to allow mutual recursion */
-
-static bool compileBracket(int, int*, unsigned char**, const UChar**, const UChar*, ErrorCode*, int, int*, int*, CompileData&);
-static bool bracketIsAnchored(const unsigned char* code);
-static bool bracketNeedsLineStart(const unsigned char* code, unsigned captureMap, unsigned backrefMap);
-static int bracketFindFirstAssertedCharacter(const unsigned char* code, bool inassert);
-
-/*************************************************
-*            Handle escapes                      *
-*************************************************/
-
-/* This function is called when a \ has been encountered. It either returns a
-positive value for a simple escape such as \n, or a negative value which
-encodes one of the more complicated things such as \d. When UTF-8 is enabled,
-a positive value greater than 255 may be returned. On entry, ptr is pointing at
-the \. On exit, it is on the final character of the escape sequence.
-
-Arguments:
-  ptrPtr         points to the pattern position pointer
-  errorCodePtr   points to the errorcode variable
-  bracount       number of previous extracting brackets
-  options        the options bits
-  isClass        true if inside a character class
-
-Returns:         zero or positive => a data character
-                 negative => a special escape sequence
-                 on error, errorPtr is set
-*/
-
-static int checkEscape(const UChar** ptrPtr, const UChar* patternEnd, ErrorCode* errorCodePtr, int bracount, bool isClass)
-{
-    const UChar* ptr = *ptrPtr + 1;
-
-    /* If backslash is at the end of the pattern, it's an error. */
-    if (ptr == patternEnd) {
-        *errorCodePtr = ERR1;
-        *ptrPtr = ptr;
-        return 0;
-    }
-    
-    int c = *ptr;
-    
-    /* Non-alphamerics are literals. For digits or letters, do an initial lookup in
-     a table. A non-zero result is something that can be returned immediately.
-     Otherwise further processing may be required. */
-    
-    if (c < '0' || c > 'z') { /* Not alphameric */
-    } else if (int escapeValue = escapes[c - '0']) {
-        c = escapeValue;
-        if (isClass) {
-            if (-c == ESC_b)
-                c = '\b'; /* \b is backslash in a class */
-            else if (-c == ESC_B)
-                c = 'B'; /* and \B is a capital B in a class (in browsers event though ECMAScript 15.10.2.19 says it raises an error) */
-        }
-    /* Escapes that need further processing, or are illegal. */
-    
-    } else {
-        switch (c) {
-            case '1':
-            case '2':
-            case '3':
-            case '4':
-            case '5':
-            case '6':
-            case '7':
-            case '8':
-            case '9':
-                /* Escape sequences starting with a non-zero digit are backreferences,
-                 unless there are insufficient brackets, in which case they are octal
-                 escape sequences. Those sequences end on the first non-octal character
-                 or when we overflow 0-255, whichever comes first. */
-                
-                if (!isClass) {
-                    const UChar* oldptr = ptr;
-                    c -= '0';
-                    while ((ptr + 1 < patternEnd) && isASCIIDigit(ptr[1]) && c <= bracount)
-                        c = c * 10 + *(++ptr) - '0';
-                    if (c <= bracount) {
-                        c = -(ESC_REF + c);
-                        break;
-                    }
-                    ptr = oldptr;      /* Put the pointer back and fall through */
-                }
-                
-                /* Handle an octal number following \. If the first digit is 8 or 9,
-                 this is not octal. */
-                
-                if ((c = *ptr) >= '8') {
-                    c = '\\';
-                    ptr -= 1;
-                    break;
-                }
-
-            /* \0 always starts an octal number, but we may drop through to here with a
-             larger first octal digit. */
-
-            case '0': {
-                c -= '0';
-                int i;
-                for (i = 1; i <= 2; ++i) {
-                    if (ptr + i >= patternEnd || ptr[i] < '0' || ptr[i] > '7')
-                        break;
-                    int cc = c * 8 + ptr[i] - '0';
-                    if (cc > 255)
-                        break;
-                    c = cc;
-                }
-                ptr += i - 1;
-                break;
-            }
-
-            case 'x': {
-                c = 0;
-                int i;
-                for (i = 1; i <= 2; ++i) {
-                    if (ptr + i >= patternEnd || !isASCIIHexDigit(ptr[i])) {
-                        c = 'x';
-                        i = 1;
-                        break;
-                    }
-                    int cc = ptr[i];
-                    if (cc >= 'a')
-                        cc -= 32;             /* Convert to upper case */
-                    c = c * 16 + cc - ((cc < 'A') ? '0' : ('A' - 10));
-                }
-                ptr += i - 1;
-                break;
-            }
-
-            case 'u': {
-                c = 0;
-                int i;
-                for (i = 1; i <= 4; ++i) {
-                    if (ptr + i >= patternEnd || !isASCIIHexDigit(ptr[i])) {
-                        c = 'u';
-                        i = 1;
-                        break;
-                    }
-                    int cc = ptr[i];
-                    if (cc >= 'a')
-                        cc -= 32;             /* Convert to upper case */
-                    c = c * 16 + cc - ((cc < 'A') ? '0' : ('A' - 10));
-                }
-                ptr += i - 1;
-                break;
-            }
-
-            case 'c':
-                if (++ptr == patternEnd) {
-                    *errorCodePtr = ERR2;
-                    return 0;
-                }
-                
-                c = *ptr;
-
-                /* To match Firefox, inside a character class, we also accept
-                   numbers and '_' as control characters */
-                if ((!isClass && !isASCIIAlpha(c)) || (!isASCIIAlphanumeric(c) && c != '_')) {
-                    c = '\\';
-                    ptr -= 2;
-                    break;
-                }
-
-                /* A letter is upper-cased; then the 0x40 bit is flipped. This coding
-                 is ASCII-specific, but then the whole concept of \cx is ASCII-specific. */
-                c = toASCIIUpper(c) ^ 0x40;
-                break;
-            }
-    }
-    
-    *ptrPtr = ptr;
-    return c;
-}
-
-/*************************************************
-*            Check for counted repeat            *
-*************************************************/
-
-/* This function is called when a '{' is encountered in a place where it might
-start a quantifier. It looks ahead to see if it really is a quantifier or not.
-It is only a quantifier if it is one of the forms {ddd} {ddd,} or {ddd,ddd}
-where the ddds are digits.
-
-Arguments:
-  p         pointer to the first char after '{'
-
-Returns:    true or false
-*/
-
-static bool isCountedRepeat(const UChar* p, const UChar* patternEnd)
-{
-    if (p >= patternEnd || !isASCIIDigit(*p))
-        return false;
-    p++;
-    while (p < patternEnd && isASCIIDigit(*p))
-        p++;
-    if (p < patternEnd && *p == '}')
-        return true;
-    
-    if (p >= patternEnd || *p++ != ',')
-        return false;
-    if (p < patternEnd && *p == '}')
-        return true;
-    
-    if (p >= patternEnd || !isASCIIDigit(*p))
-        return false;
-    p++;
-    while (p < patternEnd && isASCIIDigit(*p))
-        p++;
-    
-    return (p < patternEnd && *p == '}');
-}
-
-/*************************************************
-*         Read repeat counts                     *
-*************************************************/
-
-/* Read an item of the form {n,m} and return the values. This is called only
-after isCountedRepeat() has confirmed that a repeat-count quantifier exists,
-so the syntax is guaranteed to be correct, but we need to check the values.
-
-Arguments:
-  p              pointer to first char after '{'
-  minp           pointer to int for min
-  maxp           pointer to int for max
-                 returned as -1 if no max
-  errorCodePtr   points to error code variable
-
-Returns:         pointer to '}' on success;
-                 current ptr on error, with errorCodePtr set non-zero
-*/
-
-static const UChar* readRepeatCounts(const UChar* p, int* minp, int* maxp, ErrorCode* errorCodePtr)
-{
-    int min = 0;
-    int max = -1;
-    
-    /* Read the minimum value and do a paranoid check: a negative value indicates
-     an integer overflow. */
-    
-    while (isASCIIDigit(*p))
-        min = min * 10 + *p++ - '0';
-    if (min < 0 || min > 65535) {
-        *errorCodePtr = ERR5;
-        return p;
-    }
-    
-    /* Read the maximum value if there is one, and again do a paranoid on its size.
-     Also, max must not be less than min. */
-    
-    if (*p == '}')
-        max = min;
-    else {
-        if (*(++p) != '}') {
-            max = 0;
-            while (isASCIIDigit(*p))
-                max = max * 10 + *p++ - '0';
-            if (max < 0 || max > 65535) {
-                *errorCodePtr = ERR5;
-                return p;
-            }
-            if (max < min) {
-                *errorCodePtr = ERR4;
-                return p;
-            }
-        }
-    }
-    
-    /* Fill in the required variables, and pass back the pointer to the terminating
-     '}'. */
-    
-    *minp = min;
-    *maxp = max;
-    return p;
-}
-
-/*************************************************
-*      Find first significant op code            *
-*************************************************/
-
-/* This is called by several functions that scan a compiled expression looking
-for a fixed first character, or an anchoring op code etc. It skips over things
-that do not influence this.
-
-Arguments:
-  code         pointer to the start of the group
-Returns:       pointer to the first significant opcode
-*/
-
-static const unsigned char* firstSignificantOpcode(const unsigned char* code)
-{
-    while (*code == OP_BRANUMBER)
-        code += 3;
-    return code;
-}
-
-static const unsigned char* firstSignificantOpcodeSkippingAssertions(const unsigned char* code)
-{
-    while (true) {
-        switch (*code) {
-            case OP_ASSERT_NOT:
-                advanceToEndOfBracket(code);
-                code += 1 + LINK_SIZE;
-                break;
-            case OP_WORD_BOUNDARY:
-            case OP_NOT_WORD_BOUNDARY:
-                ++code;
-                break;
-            case OP_BRANUMBER:
-                code += 3;
-                break;
-            default:
-                return code;
-        }
-    }
-}
-
-/*************************************************
-*           Get othercase range                  *
-*************************************************/
-
-/* This function is passed the start and end of a class range, in UTF-8 mode
-with UCP support. It searches up the characters, looking for internal ranges of
-characters in the "other" case. Each call returns the next one, updating the
-start address.
-
-Arguments:
-  cptr        points to starting character value; updated
-  d           end value
-  ocptr       where to put start of othercase range
-  odptr       where to put end of othercase range
-
-Yield:        true when range returned; false when no more
-*/
-
-static bool getOthercaseRange(int* cptr, int d, int* ocptr, int* odptr)
-{
-    int c, othercase = 0;
-    
-    for (c = *cptr; c <= d; c++) {
-        if ((othercase = jsc_pcre_ucp_othercase(c)) >= 0)
-            break;
-    }
-    
-    if (c > d)
-        return false;
-    
-    *ocptr = othercase;
-    int next = othercase + 1;
-    
-    for (++c; c <= d; c++) {
-        if (jsc_pcre_ucp_othercase(c) != next)
-            break;
-        next++;
-    }
-    
-    *odptr = next - 1;
-    *cptr = c;
-    
-    return true;
-}
-
-/*************************************************
- *       Convert character value to UTF-8         *
- *************************************************/
-
-/* This function takes an integer value in the range 0 - 0x7fffffff
- and encodes it as a UTF-8 character in 0 to 6 bytes.
- Arguments:
- cvalue     the character value
- buffer     pointer to buffer for result - at least 6 bytes long
- Returns:     number of characters placed in the buffer
- */
-
-static int encodeUTF8(int cvalue, unsigned char *buffer)
-{
-    int i;
-    for (i = 0; i < jsc_pcre_utf8_table1_size; i++)
-        if (cvalue <= jsc_pcre_utf8_table1[i])
-            break;
-    buffer += i;
-    for (int j = i; j > 0; j--) {
-        *buffer-- = 0x80 | (cvalue & 0x3f);
-        cvalue >>= 6;
-    }
-    *buffer = jsc_pcre_utf8_table2[i] | cvalue;
-    return i + 1;
-}
-
-/*************************************************
-*           Compile one branch                   *
-*************************************************/
-
-/* Scan the pattern, compiling it into the code vector.
-
-Arguments:
-  options        the option bits
-  brackets       points to number of extracting brackets used
-  codePtr        points to the pointer to the current code point
-  ptrPtr         points to the current pattern pointer
-  errorCodePtr   points to error code variable
-  firstbyteptr   set to initial literal character, or < 0 (REQ_UNSET, REQ_NONE)
-  reqbyteptr     set to the last literal character required, else < 0
-  cd             contains pointers to tables etc.
-
-Returns:         true on success
-                 false, with *errorCodePtr set non-zero on error
-*/
-
-static inline bool safelyCheckNextChar(const UChar* ptr, const UChar* patternEnd, UChar expected)
-{
-    return ((ptr + 1 < patternEnd) && ptr[1] == expected);
-}
-
-static bool
-compileBranch(int options, int* brackets, unsigned char** codePtr,
-               const UChar** ptrPtr, const UChar* patternEnd, ErrorCode* errorCodePtr, int *firstbyteptr,
-               int* reqbyteptr, CompileData& cd)
-{
-    int repeatType, opType;
-    int repeatMin = 0, repeat_max = 0;      /* To please picky compilers */
-    int bravalue = 0;
-    int reqvary, tempreqvary;
-    int c;
-    unsigned char* code = *codePtr;
-    unsigned char* tempcode;
-    bool didGroupSetFirstByte = false;
-    const UChar* ptr = *ptrPtr;
-    const UChar* tempptr;
-    unsigned char* previous = NULL;
-    unsigned char classbits[32];
-    
-    bool class_utf8;
-    unsigned char* class_utf8data;
-    unsigned char utf8_char[6];
-    
-    /* Initialize no first byte, no required byte. REQ_UNSET means "no char
-     matching encountered yet". It gets changed to REQ_NONE if we hit something that
-     matches a non-fixed char first char; reqByte just remains unset if we never
-     find one.
-     
-     When we hit a repeat whose minimum is zero, we may have to adjust these values
-     to take the zero repeat into account. This is implemented by setting them to
-     zeroFirstByte and zeroReqByte when such a repeat is encountered. The individual
-     item types that can be repeated set these backoff variables appropriately. */
-    
-    int firstByte = REQ_UNSET;
-    int reqByte = REQ_UNSET;
-    int zeroReqByte = REQ_UNSET;
-    int zeroFirstByte = REQ_UNSET;
-    
-    /* The variable reqCaseOpt contains either the REQ_IGNORE_CASE value or zero,
-     according to the current setting of the ignores-case flag. REQ_IGNORE_CASE is a bit
-     value > 255. It is added into the firstByte or reqByte variables to record the
-     case status of the value. This is used only for ASCII characters. */
-    
-    int reqCaseOpt = (options & IgnoreCaseOption) ? REQ_IGNORE_CASE : 0;
-    
-    /* Switch on next character until the end of the branch */
-    
-    for (;; ptr++) {
-        bool negateClass;
-        bool shouldFlipNegation; /* If a negative special such as \S is used, we should negate the whole class to properly support Unicode. */
-        int classCharCount;
-        int classLastChar;
-        int skipBytes;
-        int subReqByte;
-        int subFirstByte;
-        int mcLength;
-        unsigned char mcbuffer[8];
-        
-        /* Next byte in the pattern */
-        
-        c = ptr < patternEnd ? *ptr : 0;
-        
-        /* Fill in length of a previous callout, except when the next thing is
-         a quantifier. */
-        
-        bool isQuantifier = c == '*' || c == '+' || c == '?' || (c == '{' && isCountedRepeat(ptr + 1, patternEnd));
-        
-        switch (c) {
-            /* The branch terminates at end of string, |, or ). */
-                
-            case 0:
-                if (ptr < patternEnd)
-                    goto NORMAL_CHAR;
-                // End of string; fall through
-            case '|':
-            case ')':
-                *firstbyteptr = firstByte;
-                *reqbyteptr = reqByte;
-                *codePtr = code;
-                *ptrPtr = ptr;
-                return true;
-                
-            /* Handle single-character metacharacters. In multiline mode, ^ disables
-             the setting of any following char as a first character. */
-
-            case '^':
-                if (options & MatchAcrossMultipleLinesOption) {
-                    if (firstByte == REQ_UNSET)
-                        firstByte = REQ_NONE;
-                    *code++ = OP_BOL;
-                } else
-                    *code++ = OP_CIRC;
-                previous = NULL;
-                break;
-
-            case '$':
-                previous = NULL;
-                if (options & MatchAcrossMultipleLinesOption)
-                  *code++ = OP_EOL;
-                else
-                  *code++ = OP_DOLL;
-                break;
-
-            /* There can never be a first char if '.' is first, whatever happens about
-             repeats. The value of reqByte doesn't change either. */
-
-            case '.':
-                if (firstByte == REQ_UNSET)
-                    firstByte = REQ_NONE;
-                zeroFirstByte = firstByte;
-                zeroReqByte = reqByte;
-                previous = code;
-                *code++ = OP_NOT_NEWLINE;
-                break;
-                
-            /* Character classes. If the included characters are all < 256, we build a
-             32-byte bitmap of the permitted characters, except in the special case
-             where there is only one such character. For negated classes, we build the
-             map as usual, then invert it at the end. However, we use a different opcode
-             so that data characters > 255 can be handled correctly.
-             
-             If the class contains characters outside the 0-255 range, a different
-             opcode is compiled. It may optionally have a bit map for characters < 256,
-             but those above are are explicitly listed afterwards. A flag byte tells
-             whether the bitmap is present, and whether this is a negated class or not.
-             */
-                
-            case '[': {
-                previous = code;
-                shouldFlipNegation = false;
-                
-                /* PCRE supports POSIX class stuff inside a class. Perl gives an error if
-                 they are encountered at the top level, so we'll do that too. */
-                
-                /* If the first character is '^', set the negation flag and skip it. */
-
-                if (ptr + 1 >= patternEnd) {
-                    *errorCodePtr = ERR6;
-                    return false;
-                }
-
-                if (ptr[1] == '^') {
-                    negateClass = true;
-                    ++ptr;
-                } else
-                    negateClass = false;
-                
-                /* Keep a count of chars with values < 256 so that we can optimize the case
-                 of just a single character (as long as it's < 256). For higher valued UTF-8
-                 characters, we don't yet do any optimization. */
-                
-                classCharCount = 0;
-                classLastChar = -1;
-                
-                class_utf8 = false;                       /* No chars >= 256 */
-                class_utf8data = code + LINK_SIZE + 34;   /* For UTF-8 items */
-                
-                /* Initialize the 32-char bit map to all zeros. We have to build the
-                 map in a temporary bit of store, in case the class contains only 1
-                 character (< 256), because in that case the compiled code doesn't use the
-                 bit map. */
-                
-                memset(classbits, 0, 32 * sizeof(unsigned char));
-                
-                /* Process characters until ] is reached. The first pass
-                 through the regex checked the overall syntax, so we don't need to be very
-                 strict here. At the start of the loop, c contains the first byte of the
-                 character. */
-
-                while ((++ptr < patternEnd) && (c = *ptr) != ']') {
-                    /* Backslash may introduce a single character, or it may introduce one
-                     of the specials, which just set a flag. Escaped items are checked for
-                     validity in the pre-compiling pass. The sequence \b is a special case.
-                     Inside a class (and only there) it is treated as backspace. Elsewhere
-                     it marks a word boundary. Other escapes have preset maps ready to
-                     or into the one we are building. We assume they have more than one
-                     character in them, so set classCharCount bigger than one. */
-                    
-                    if (c == '\\') {
-                        c = checkEscape(&ptr, patternEnd, errorCodePtr, cd.numCapturingBrackets, true);
-                        if (c < 0) {
-                            classCharCount += 2;     /* Greater than 1 is what matters */
-                            switch (-c) {
-                                case ESC_d:
-                                    for (c = 0; c < 32; c++)
-                                        classbits[c] |= classBitmapForChar(c + cbit_digit);
-                                    continue;
-                                    
-                                case ESC_D:
-                                    shouldFlipNegation = true;
-                                    for (c = 0; c < 32; c++)
-                                        classbits[c] |= ~classBitmapForChar(c + cbit_digit);
-                                    continue;
-                                    
-                                case ESC_w:
-                                    for (c = 0; c < 32; c++)
-                                        classbits[c] |= classBitmapForChar(c + cbit_word);
-                                    continue;
-                                    
-                                case ESC_W:
-                                    shouldFlipNegation = true;
-                                    for (c = 0; c < 32; c++)
-                                        classbits[c] |= ~classBitmapForChar(c + cbit_word);
-                                    continue;
-                                    
-                                case ESC_s:
-                                    for (c = 0; c < 32; c++)
-                                         classbits[c] |= classBitmapForChar(c + cbit_space);
-                                    continue;
-                                    
-                                case ESC_S:
-                                    shouldFlipNegation = true;
-                                    for (c = 0; c < 32; c++)
-                                         classbits[c] |= ~classBitmapForChar(c + cbit_space);
-                                    continue;
-                                    
-                                    /* Unrecognized escapes are faulted if PCRE is running in its
-                                     strict mode. By default, for compatibility with Perl, they are
-                                     treated as literals. */
-                                    
-                                default:
-                                    c = *ptr;              /* The final character */
-                                    classCharCount -= 2;  /* Undo the default count from above */
-                            }
-                        }
-                        
-                        /* Fall through if we have a single character (c >= 0). This may be
-                         > 256 in UTF-8 mode. */
-                        
-                    }   /* End of backslash handling */
-                    
-                    /* A single character may be followed by '-' to form a range. However,
-                     Perl does not permit ']' to be the end of the range. A '-' character
-                     here is treated as a literal. */
-                    
-                    if ((ptr + 2 < patternEnd) && ptr[1] == '-' && ptr[2] != ']') {
-                        ptr += 2;
-                        
-                        int d = *ptr;
-                        
-                        /* The second part of a range can be a single-character escape, but
-                         not any of the other escapes. Perl 5.6 treats a hyphen as a literal
-                         in such circumstances. */
-                        
-                        if (d == '\\') {
-                            const UChar* oldptr = ptr;
-                            d = checkEscape(&ptr, patternEnd, errorCodePtr, cd.numCapturingBrackets, true);
-                            
-                            /* \X is literal X; any other special means the '-' was literal */
-                            if (d < 0) {
-                                ptr = oldptr - 2;
-                                goto LONE_SINGLE_CHARACTER;  /* A few lines below */
-                            }
-                        }
-                        
-                        /* The check that the two values are in the correct order happens in
-                         the pre-pass. Optimize one-character ranges */
-                        
-                        if (d == c)
-                            goto LONE_SINGLE_CHARACTER;  /* A few lines below */
-                        
-                        /* In UTF-8 mode, if the upper limit is > 255, or > 127 for caseless
-                         matching, we have to use an XCLASS with extra data items. Caseless
-                         matching for characters > 127 is available only if UCP support is
-                         available. */
-                        
-                        if ((d > 255 || ((options & IgnoreCaseOption) && d > 127))) {
-                            class_utf8 = true;
-                            
-                            /* With UCP support, we can find the other case equivalents of
-                             the relevant characters. There may be several ranges. Optimize how
-                             they fit with the basic range. */
-                            
-                            if (options & IgnoreCaseOption) {
-                                int occ, ocd;
-                                int cc = c;
-                                int origd = d;
-                                while (getOthercaseRange(&cc, origd, &occ, &ocd)) {
-                                    if (occ >= c && ocd <= d)
-                                        continue;  /* Skip embedded ranges */
-                                    
-                                    if (occ < c  && ocd >= c - 1)        /* Extend the basic range */
-                                    {                                  /* if there is overlap,   */
-                                        c = occ;                           /* noting that if occ < c */
-                                        continue;                          /* we can't have ocd > d  */
-                                    }                                  /* because a subrange is  */
-                                    if (ocd > d && occ <= d + 1)         /* always shorter than    */
-                                    {                                  /* the basic range.       */
-                                        d = ocd;
-                                        continue;
-                                    }
-                                    
-                                    if (occ == ocd)
-                                        *class_utf8data++ = XCL_SINGLE;
-                                    else {
-                                        *class_utf8data++ = XCL_RANGE;
-                                        class_utf8data += encodeUTF8(occ, class_utf8data);
-                                    }
-                                    class_utf8data += encodeUTF8(ocd, class_utf8data);
-                                }
-                            }
-                            
-                            /* Now record the original range, possibly modified for UCP caseless
-                             overlapping ranges. */
-                            
-                            *class_utf8data++ = XCL_RANGE;
-                            class_utf8data += encodeUTF8(c, class_utf8data);
-                            class_utf8data += encodeUTF8(d, class_utf8data);
-                            
-                            /* With UCP support, we are done. Without UCP support, there is no
-                             caseless matching for UTF-8 characters > 127; we can use the bit map
-                             for the smaller ones. */
-                            
-                            continue;    /* With next character in the class */
-                        }
-                        
-                        /* We use the bit map for all cases when not in UTF-8 mode; else
-                         ranges that lie entirely within 0-127 when there is UCP support; else
-                         for partial ranges without UCP support. */
-                        
-                        for (; c <= d; c++) {
-                            classbits[c/8] |= (1 << (c&7));
-                            if (options & IgnoreCaseOption) {
-                                int uc = flipCase(c);
-                                classbits[uc/8] |= (1 << (uc&7));
-                            }
-                            classCharCount++;                /* in case a one-char range */
-                            classLastChar = c;
-                        }
-                        
-                        continue;   /* Go get the next char in the class */
-                    }
-                    
-                    /* Handle a lone single character - we can get here for a normal
-                     non-escape char, or after \ that introduces a single character or for an
-                     apparent range that isn't. */
-                    
-                LONE_SINGLE_CHARACTER:
-                    
-                    /* Handle a character that cannot go in the bit map */
-                    
-                    if ((c > 255 || ((options & IgnoreCaseOption) && c > 127))) {
-                        class_utf8 = true;
-                        *class_utf8data++ = XCL_SINGLE;
-                        class_utf8data += encodeUTF8(c, class_utf8data);
-                        
-                        if (options & IgnoreCaseOption) {
-                            int othercase;
-                            if ((othercase = jsc_pcre_ucp_othercase(c)) >= 0) {
-                                *class_utf8data++ = XCL_SINGLE;
-                                class_utf8data += encodeUTF8(othercase, class_utf8data);
-                            }
-                        }
-                    } else {
-                        /* Handle a single-byte character */
-                        classbits[c/8] |= (1 << (c&7));
-                        if (options & IgnoreCaseOption) {
-                            c = flipCase(c);
-                            classbits[c/8] |= (1 << (c&7));
-                        }
-                        classCharCount++;
-                        classLastChar = c;
-                    }
-                }
-                
-                /* If classCharCount is 1, we saw precisely one character whose value is
-                 less than 256. In non-UTF-8 mode we can always optimize. In UTF-8 mode, we
-                 can optimize the negative case only if there were no characters >= 128
-                 because OP_NOT and the related opcodes like OP_NOTSTAR operate on
-                 single-bytes only. This is an historical hangover. Maybe one day we can
-                 tidy these opcodes to handle multi-byte characters.
-                 
-                 The optimization throws away the bit map. We turn the item into a
-                 1-character OP_CHAR[NC] if it's positive, or OP_NOT if it's negative. Note
-                 that OP_NOT does not support multibyte characters. In the positive case, it
-                 can cause firstByte to be set. Otherwise, there can be no first char if
-                 this item is first, whatever repeat count may follow. In the case of
-                 reqByte, save the previous value for reinstating. */
-                
-                if (classCharCount == 1 && (!class_utf8 && (!negateClass || classLastChar < 128))) {
-                    zeroReqByte = reqByte;
-                    
-                    /* The OP_NOT opcode works on one-byte characters only. */
-                    
-                    if (negateClass) {
-                        if (firstByte == REQ_UNSET)
-                            firstByte = REQ_NONE;
-                        zeroFirstByte = firstByte;
-                        *code++ = OP_NOT;
-                        *code++ = classLastChar;
-                        break;
-                    }
-                    
-                    /* For a single, positive character, get the value into c, and
-                     then we can handle this with the normal one-character code. */
-                    
-                    c = classLastChar;
-                    goto NORMAL_CHAR;
-                }       /* End of 1-char optimization */
-                
-                /* The general case - not the one-char optimization. If this is the first
-                 thing in the branch, there can be no first char setting, whatever the
-                 repeat count. Any reqByte setting must remain unchanged after any kind of
-                 repeat. */
-                
-                if (firstByte == REQ_UNSET) firstByte = REQ_NONE;
-                zeroFirstByte = firstByte;
-                zeroReqByte = reqByte;
-                
-                /* If there are characters with values > 255, we have to compile an
-                 extended class, with its own opcode. If there are no characters < 256,
-                 we can omit the bitmap. */
-                
-                if (class_utf8 && !shouldFlipNegation) {
-                    *class_utf8data++ = XCL_END;    /* Marks the end of extra data */
-                    *code++ = OP_XCLASS;
-                    code += LINK_SIZE;
-                    *code = negateClass? XCL_NOT : 0;
-                    
-                    /* If the map is required, install it, and move on to the end of
-                     the extra data */
-                    
-                    if (classCharCount > 0) {
-                        *code++ |= XCL_MAP;
-                        memcpy(code, classbits, 32);
-                        code = class_utf8data;
-                    }
-                    
-                    /* If the map is not required, slide down the extra data. */
-                    
-                    else {
-                        int len = class_utf8data - (code + 33);
-                        memmove(code + 1, code + 33, len);
-                        code += len + 1;
-                    }
-                    
-                    /* Now fill in the complete length of the item */
-                    
-                    putLinkValue(previous + 1, code - previous);
-                    break;   /* End of class handling */
-                }
-                
-                /* If there are no characters > 255, negate the 32-byte map if necessary,
-                 and copy it into the code vector. If this is the first thing in the branch,
-                 there can be no first char setting, whatever the repeat count. Any reqByte
-                 setting must remain unchanged after any kind of repeat. */
-                
-                *code++ = (negateClass == shouldFlipNegation) ? OP_CLASS : OP_NCLASS;
-                if (negateClass)
-                    for (c = 0; c < 32; c++)
-                        code[c] = ~classbits[c];
-                else
-                    memcpy(code, classbits, 32);
-                code += 32;
-                break;
-            }
-                
-            /* Various kinds of repeat; '{' is not necessarily a quantifier, but this
-             has been tested above. */
-
-            case '{':
-                if (!isQuantifier)
-                    goto NORMAL_CHAR;
-                ptr = readRepeatCounts(ptr + 1, &repeatMin, &repeat_max, errorCodePtr);
-                if (*errorCodePtr)
-                    goto FAILED;
-                goto REPEAT;
-                
-            case '*':
-                repeatMin = 0;
-                repeat_max = -1;
-                goto REPEAT;
-                
-            case '+':
-                repeatMin = 1;
-                repeat_max = -1;
-                goto REPEAT;
-                
-            case '?':
-                repeatMin = 0;
-                repeat_max = 1;
-                
-            REPEAT:
-                if (!previous) {
-                    *errorCodePtr = ERR9;
-                    goto FAILED;
-                }
-                
-                if (repeatMin == 0) {
-                    firstByte = zeroFirstByte;    /* Adjust for zero repeat */
-                    reqByte = zeroReqByte;        /* Ditto */
-                }
-                
-                /* Remember whether this is a variable length repeat */
-                
-                reqvary = (repeatMin == repeat_max) ? 0 : REQ_VARY;
-                
-                opType = 0;                    /* Default single-char op codes */
-                
-                /* Save start of previous item, in case we have to move it up to make space
-                 for an inserted OP_ONCE for the additional '+' extension. */
-                /* FIXME: Probably don't need this because we don't use OP_ONCE. */
-                
-                tempcode = previous;
-                
-                /* If the next character is '+', we have a possessive quantifier. This
-                 implies greediness, whatever the setting of the PCRE_UNGREEDY option.
-                 If the next character is '?' this is a minimizing repeat, by default,
-                 but if PCRE_UNGREEDY is set, it works the other way round. We change the
-                 repeat type to the non-default. */
-                
-                if (safelyCheckNextChar(ptr, patternEnd, '?')) {
-                    repeatType = 1;
-                    ptr++;
-                } else
-                    repeatType = 0;
-                
-                /* If previous was a character match, abolish the item and generate a
-                 repeat item instead. If a char item has a minumum of more than one, ensure
-                 that it is set in reqByte - it might not be if a sequence such as x{3} is
-                 the first thing in a branch because the x will have gone into firstByte
-                 instead.  */
-                
-                if (*previous == OP_CHAR || *previous == OP_CHAR_IGNORING_CASE) {
-                    /* Deal with UTF-8 characters that take up more than one byte. It's
-                     easier to write this out separately than try to macrify it. Use c to
-                     hold the length of the character in bytes, plus 0x80 to flag that it's a
-                     length rather than a small character. */
-                    
-                    if (code[-1] & 0x80) {
-                        unsigned char *lastchar = code - 1;
-                        while((*lastchar & 0xc0) == 0x80)
-                            lastchar--;
-                        c = code - lastchar;            /* Length of UTF-8 character */
-                        memcpy(utf8_char, lastchar, c); /* Save the char */
-                        c |= 0x80;                      /* Flag c as a length */
-                    }
-                    else {
-                        c = code[-1];
-                        if (repeatMin > 1)
-                            reqByte = c | reqCaseOpt | cd.reqVaryOpt;
-                    }
-                    
-                    goto OUTPUT_SINGLE_REPEAT;   /* Code shared with single character types */
-                }
-                
-                else if (*previous == OP_ASCII_CHAR || *previous == OP_ASCII_LETTER_IGNORING_CASE) {
-                    c = previous[1];
-                    if (repeatMin > 1)
-                        reqByte = c | reqCaseOpt | cd.reqVaryOpt;
-                    goto OUTPUT_SINGLE_REPEAT;
-                }
-                
-                /* If previous was a single negated character ([^a] or similar), we use
-                 one of the special opcodes, replacing it. The code is shared with single-
-                 character repeats by setting opt_type to add a suitable offset into
-                 repeatType. OP_NOT is currently used only for single-byte chars. */
-                
-                else if (*previous == OP_NOT) {
-                    opType = OP_NOTSTAR - OP_STAR;  /* Use "not" opcodes */
-                    c = previous[1];
-                    goto OUTPUT_SINGLE_REPEAT;
-                }
-                
-                /* If previous was a character type match (\d or similar), abolish it and
-                 create a suitable repeat item. The code is shared with single-character
-                 repeats by setting opType to add a suitable offset into repeatType. */
-                
-                else if (*previous <= OP_NOT_NEWLINE) {
-                    opType = OP_TYPESTAR - OP_STAR;  /* Use type opcodes */
-                    c = *previous;
-                    
-                OUTPUT_SINGLE_REPEAT:
-                    int prop_type = -1;
-                    int prop_value = -1;
-                    
-                    unsigned char* oldcode = code;
-                    code = previous;                  /* Usually overwrite previous item */
-                    
-                    /* If the maximum is zero then the minimum must also be zero; Perl allows
-                     this case, so we do too - by simply omitting the item altogether. */
-                    
-                    if (repeat_max == 0)
-                        goto END_REPEAT;
-                    
-                    /* Combine the opType with the repeatType */
-                    
-                    repeatType += opType;
-                    
-                    /* A minimum of zero is handled either as the special case * or ?, or as
-                     an UPTO, with the maximum given. */
-                    
-                    if (repeatMin == 0) {
-                        if (repeat_max == -1)
-                            *code++ = OP_STAR + repeatType;
-                        else if (repeat_max == 1)
-                            *code++ = OP_QUERY + repeatType;
-                        else {
-                            *code++ = OP_UPTO + repeatType;
-                            put2ByteValueAndAdvance(code, repeat_max);
-                        }
-                    }
-                    
-                    /* A repeat minimum of 1 is optimized into some special cases. If the
-                     maximum is unlimited, we use OP_PLUS. Otherwise, the original item it
-                     left in place and, if the maximum is greater than 1, we use OP_UPTO with
-                     one less than the maximum. */
-                    
-                    else if (repeatMin == 1) {
-                        if (repeat_max == -1)
-                            *code++ = OP_PLUS + repeatType;
-                        else {
-                            code = oldcode;                 /* leave previous item in place */
-                            if (repeat_max == 1)
-                                goto END_REPEAT;
-                            *code++ = OP_UPTO + repeatType;
-                            put2ByteValueAndAdvance(code, repeat_max - 1);
-                        }
-                    }
-                    
-                    /* The case {n,n} is just an EXACT, while the general case {n,m} is
-                     handled as an EXACT followed by an UPTO. */
-                    
-                    else {
-                        *code++ = OP_EXACT + opType;  /* NB EXACT doesn't have repeatType */
-                        put2ByteValueAndAdvance(code, repeatMin);
-                        
-                        /* If the maximum is unlimited, insert an OP_STAR. Before doing so,
-                         we have to insert the character for the previous code. For a repeated
-                         Unicode property match, there are two extra bytes that define the
-                         required property. In UTF-8 mode, long characters have their length in
-                         c, with the 0x80 bit as a flag. */
-                        
-                        if (repeat_max < 0) {
-                            if (c >= 128) {
-                                memcpy(code, utf8_char, c & 7);
-                                code += c & 7;
-                            } else {
-                                *code++ = c;
-                                if (prop_type >= 0) {
-                                    *code++ = prop_type;
-                                    *code++ = prop_value;
-                                }
-                            }
-                            *code++ = OP_STAR + repeatType;
-                        }
-                        
-                        /* Else insert an UPTO if the max is greater than the min, again
-                         preceded by the character, for the previously inserted code. */
-                        
-                        else if (repeat_max != repeatMin) {
-                            if (c >= 128) {
-                                memcpy(code, utf8_char, c & 7);
-                                code += c & 7;
-                            } else
-                                *code++ = c;
-                            if (prop_type >= 0) {
-                                *code++ = prop_type;
-                                *code++ = prop_value;
-                            }
-                            repeat_max -= repeatMin;
-                            *code++ = OP_UPTO + repeatType;
-                            put2ByteValueAndAdvance(code, repeat_max);
-                        }
-                    }
-                    
-                    /* The character or character type itself comes last in all cases. */
-                    
-                    if (c >= 128) {
-                        memcpy(code, utf8_char, c & 7);
-                        code += c & 7;
-                    } else
-                        *code++ = c;
-                    
-                    /* For a repeated Unicode property match, there are two extra bytes that
-                     define the required property. */
-                    
-                    if (prop_type >= 0) {
-                        *code++ = prop_type;
-                        *code++ = prop_value;
-                    }
-                }
-                
-                /* If previous was a character class or a back reference, we put the repeat
-                 stuff after it, but just skip the item if the repeat was {0,0}. */
-                
-                else if (*previous == OP_CLASS ||
-                         *previous == OP_NCLASS ||
-                         *previous == OP_XCLASS ||
-                         *previous == OP_REF)
-                {
-                    if (repeat_max == 0) {
-                        code = previous;
-                        goto END_REPEAT;
-                    }
-                    
-                    if (repeatMin == 0 && repeat_max == -1)
-                        *code++ = OP_CRSTAR + repeatType;
-                    else if (repeatMin == 1 && repeat_max == -1)
-                        *code++ = OP_CRPLUS + repeatType;
-                    else if (repeatMin == 0 && repeat_max == 1)
-                        *code++ = OP_CRQUERY + repeatType;
-                    else {
-                        *code++ = OP_CRRANGE + repeatType;
-                        put2ByteValueAndAdvance(code, repeatMin);
-                        if (repeat_max == -1)
-                            repeat_max = 0;  /* 2-byte encoding for max */
-                        put2ByteValueAndAdvance(code, repeat_max);
-                    }
-                }
-                
-                /* If previous was a bracket group, we may have to replicate it in certain
-                 cases. */
-                
-                else if (*previous >= OP_BRA) {
-                    int ketoffset = 0;
-                    int len = code - previous;
-                    unsigned char* bralink = NULL;
-                    
-                    /* If the maximum repeat count is unlimited, find the end of the bracket
-                     by scanning through from the start, and compute the offset back to it
-                     from the current code pointer. There may be an OP_OPT setting following
-                     the final KET, so we can't find the end just by going back from the code
-                     pointer. */
-                    
-                    if (repeat_max == -1) {
-                        const unsigned char* ket = previous;
-                        advanceToEndOfBracket(ket);
-                        ketoffset = code - ket;
-                    }
-                    
-                    /* The case of a zero minimum is special because of the need to stick
-                     OP_BRAZERO in front of it, and because the group appears once in the
-                     data, whereas in other cases it appears the minimum number of times. For
-                     this reason, it is simplest to treat this case separately, as otherwise
-                     the code gets far too messy. There are several special subcases when the
-                     minimum is zero. */
-                    
-                    if (repeatMin == 0) {
-                        /* If the maximum is also zero, we just omit the group from the output
-                         altogether. */
-                        
-                        if (repeat_max == 0) {
-                            code = previous;
-                            goto END_REPEAT;
-                        }
-                        
-                        /* If the maximum is 1 or unlimited, we just have to stick in the
-                         BRAZERO and do no more at this point. However, we do need to adjust
-                         any OP_RECURSE calls inside the group that refer to the group itself or
-                         any internal group, because the offset is from the start of the whole
-                         regex. Temporarily terminate the pattern while doing this. */
-                        
-                        if (repeat_max <= 1) {
-                            *code = OP_END;
-                            memmove(previous+1, previous, len);
-                            code++;
-                            *previous++ = OP_BRAZERO + repeatType;
-                        }
-                        
-                        /* If the maximum is greater than 1 and limited, we have to replicate
-                         in a nested fashion, sticking OP_BRAZERO before each set of brackets.
-                         The first one has to be handled carefully because it's the original
-                         copy, which has to be moved up. The remainder can be handled by code
-                         that is common with the non-zero minimum case below. We have to
-                         adjust the value of repeat_max, since one less copy is required. */
-                        
-                        else {
-                            *code = OP_END;
-                            memmove(previous + 2 + LINK_SIZE, previous, len);
-                            code += 2 + LINK_SIZE;
-                            *previous++ = OP_BRAZERO + repeatType;
-                            *previous++ = OP_BRA;
-                            
-                            /* We chain together the bracket offset fields that have to be
-                             filled in later when the ends of the brackets are reached. */
-                            
-                            int offset = (!bralink) ? 0 : previous - bralink;
-                            bralink = previous;
-                            putLinkValueAllowZeroAndAdvance(previous, offset);
-                        }
-                        
-                        repeat_max--;
-                    }
-                    
-                    /* If the minimum is greater than zero, replicate the group as many
-                     times as necessary, and adjust the maximum to the number of subsequent
-                     copies that we need. If we set a first char from the group, and didn't
-                     set a required char, copy the latter from the former. */
-                    
-                    else {
-                        if (repeatMin > 1) {
-                            if (didGroupSetFirstByte && reqByte < 0)
-                                reqByte = firstByte;
-                            for (int i = 1; i < repeatMin; i++) {
-                                memcpy(code, previous, len);
-                                code += len;
-                            }
-                        }
-                        if (repeat_max > 0)
-                            repeat_max -= repeatMin;
-                    }
-                    
-                    /* This code is common to both the zero and non-zero minimum cases. If
-                     the maximum is limited, it replicates the group in a nested fashion,
-                     remembering the bracket starts on a stack. In the case of a zero minimum,
-                     the first one was set up above. In all cases the repeat_max now specifies
-                     the number of additional copies needed. */
-                    
-                    if (repeat_max >= 0) {
-                        for (int i = repeat_max - 1; i >= 0; i--) {
-                            *code++ = OP_BRAZERO + repeatType;
-                            
-                            /* All but the final copy start a new nesting, maintaining the
-                             chain of brackets outstanding. */
-                            
-                            if (i != 0) {
-                                *code++ = OP_BRA;
-                                int offset = (!bralink) ? 0 : code - bralink;
-                                bralink = code;
-                                putLinkValueAllowZeroAndAdvance(code, offset);
-                            }
-                            
-                            memcpy(code, previous, len);
-                            code += len;
-                        }
-                        
-                        /* Now chain through the pending brackets, and fill in their length
-                         fields (which are holding the chain links pro tem). */
-                        
-                        while (bralink) {
-                            int offset = code - bralink + 1;
-                            unsigned char* bra = code - offset;
-                            int oldlinkoffset = getLinkValueAllowZero(bra + 1);
-                            bralink = (!oldlinkoffset) ? 0 : bralink - oldlinkoffset;
-                            *code++ = OP_KET;
-                            putLinkValueAndAdvance(code, offset);
-                            putLinkValue(bra + 1, offset);
-                        }
-                    }
-                    
-                    /* If the maximum is unlimited, set a repeater in the final copy. We
-                     can't just offset backwards from the current code point, because we
-                     don't know if there's been an options resetting after the ket. The
-                     correct offset was computed above. */
-                    
-                    else
-                        code[-ketoffset] = OP_KETRMAX + repeatType;
-                }
-                
-                // A quantifier after an assertion is mostly meaningless, but it
-                // can nullify the assertion if it has a 0 minimum.
-                else if (*previous == OP_ASSERT || *previous == OP_ASSERT_NOT) {
-                    if (repeatMin == 0) {
-                        code = previous;
-                        goto END_REPEAT;
-                    }
-                }
-                
-                /* Else there's some kind of shambles */
-                
-                else {
-                    *errorCodePtr = ERR11;
-                    goto FAILED;
-                }
-                
-                /* In all case we no longer have a previous item. We also set the
-                 "follows varying string" flag for subsequently encountered reqbytes if
-                 it isn't already set and we have just passed a varying length item. */
-                
-            END_REPEAT:
-                previous = NULL;
-                cd.reqVaryOpt |= reqvary;
-                break;
-                
-            /* Start of nested bracket sub-expression, or comment or lookahead or
-             lookbehind or option setting or condition. First deal with special things
-             that can come after a bracket; all are introduced by ?, and the appearance
-             of any of them means that this is not a referencing group. They were
-             checked for validity in the first pass over the string, so we don't have to
-             check for syntax errors here.  */
-                
-            case '(':
-                skipBytes = 0;
-                
-                if (*(++ptr) == '?') {
-                    switch (*(++ptr)) {
-                        case ':':                 /* Non-extracting bracket */
-                            bravalue = OP_BRA;
-                            ptr++;
-                            break;
-                            
-                        case '=':                 /* Positive lookahead */
-                            bravalue = OP_ASSERT;
-                            ptr++;
-                            break;
-                            
-                        case '!':                 /* Negative lookahead */
-                            bravalue = OP_ASSERT_NOT;
-                            ptr++;
-                            break;
-                            
-                        /* Character after (? not specially recognized */
-                            
-                        default:
-                            *errorCodePtr = ERR12;
-                            goto FAILED;
-                        }
-                }
-                
-                /* Else we have a referencing group; adjust the opcode. If the bracket
-                 number is greater than EXTRACT_BASIC_MAX, we set the opcode one higher, and
-                 arrange for the true number to follow later, in an OP_BRANUMBER item. */
-                
-                else {
-                    if (++(*brackets) > EXTRACT_BASIC_MAX) {
-                        bravalue = OP_BRA + EXTRACT_BASIC_MAX + 1;
-                        code[1 + LINK_SIZE] = OP_BRANUMBER;
-                        put2ByteValue(code + 2 + LINK_SIZE, *brackets);
-                        skipBytes = 3;
-                    }
-                    else
-                        bravalue = OP_BRA + *brackets;
-                }
-                
-                /* Process nested bracketed re. We copy code into a non-variable
-                 in order to be able to pass its address because some compilers
-                 complain otherwise. Pass in a new setting for the ims options
-                 if they have changed. */
-                
-                previous = code;
-                *code = bravalue;
-                tempcode = code;
-                tempreqvary = cd.reqVaryOpt;     /* Save value before bracket */
-                
-                if (!compileBracket(
-                                   options,
-                                   brackets,                     /* Extracting bracket count */
-                                   &tempcode,                    /* Where to put code (updated) */
-                                   &ptr,                         /* Input pointer (updated) */
-                                   patternEnd,
-                                   errorCodePtr,                 /* Where to put an error message */
-                                   skipBytes,                    /* Skip over OP_BRANUMBER */
-                                   &subFirstByte,                /* For possible first char */
-                                   &subReqByte,                  /* For possible last char */
-                                   cd))                          /* Tables block */
-                    goto FAILED;
-                
-                /* At the end of compiling, code is still pointing to the start of the
-                 group, while tempcode has been updated to point past the end of the group
-                 and any option resetting that may follow it. The pattern pointer (ptr)
-                 is on the bracket. */
-                
-                /* Handle updating of the required and first characters. Update for normal
-                 brackets of all kinds, and conditions with two branches (see code above).
-                 If the bracket is followed by a quantifier with zero repeat, we have to
-                 back off. Hence the definition of zeroReqByte and zeroFirstByte outside the
-                 main loop so that they can be accessed for the back off. */
-                
-                zeroReqByte = reqByte;
-                zeroFirstByte = firstByte;
-                didGroupSetFirstByte = false;
-                
-                if (bravalue >= OP_BRA) {
-                    /* If we have not yet set a firstByte in this branch, take it from the
-                     subpattern, remembering that it was set here so that a repeat of more
-                     than one can replicate it as reqByte if necessary. If the subpattern has
-                     no firstByte, set "none" for the whole branch. In both cases, a zero
-                     repeat forces firstByte to "none". */
-                    
-                    if (firstByte == REQ_UNSET) {
-                        if (subFirstByte >= 0) {
-                            firstByte = subFirstByte;
-                            didGroupSetFirstByte = true;
-                        }
-                        else
-                            firstByte = REQ_NONE;
-                        zeroFirstByte = REQ_NONE;
-                    }
-                    
-                    /* If firstByte was previously set, convert the subpattern's firstByte
-                     into reqByte if there wasn't one, using the vary flag that was in
-                     existence beforehand. */
-                    
-                    else if (subFirstByte >= 0 && subReqByte < 0)
-                        subReqByte = subFirstByte | tempreqvary;
-                    
-                    /* If the subpattern set a required byte (or set a first byte that isn't
-                     really the first byte - see above), set it. */
-                    
-                    if (subReqByte >= 0)
-                        reqByte = subReqByte;
-                }
-                
-                /* For a forward assertion, we take the reqByte, if set. This can be
-                 helpful if the pattern that follows the assertion doesn't set a different
-                 char. For example, it's useful for /(?=abcde).+/. We can't set firstByte
-                 for an assertion, however because it leads to incorrect effect for patterns
-                 such as /(?=a)a.+/ when the "real" "a" would then become a reqByte instead
-                 of a firstByte. This is overcome by a scan at the end if there's no
-                 firstByte, looking for an asserted first char. */
-                
-                else if (bravalue == OP_ASSERT && subReqByte >= 0)
-                    reqByte = subReqByte;
-                
-                /* Now update the main code pointer to the end of the group. */
-                
-                code = tempcode;
-                
-                /* Error if hit end of pattern */
-                
-                if (ptr >= patternEnd || *ptr != ')') {
-                    *errorCodePtr = ERR14;
-                    goto FAILED;
-                }
-                break;
-                
-            /* Check \ for being a real metacharacter; if not, fall through and handle
-             it as a data character at the start of a string. Escape items are checked
-             for validity in the pre-compiling pass. */
-                
-            case '\\':
-                tempptr = ptr;
-                c = checkEscape(&ptr, patternEnd, errorCodePtr, cd.numCapturingBrackets, false);
-                
-                /* Handle metacharacters introduced by \. For ones like \d, the ESC_ values
-                 are arranged to be the negation of the corresponding OP_values. For the
-                 back references, the values are ESC_REF plus the reference number. Only
-                 back references and those types that consume a character may be repeated.
-                 We can test for values between ESC_b and ESC_w for the latter; this may
-                 have to change if any new ones are ever created. */
-                
-                if (c < 0) {
-                    /* For metasequences that actually match a character, we disable the
-                     setting of a first character if it hasn't already been set. */
-                    
-                    if (firstByte == REQ_UNSET && -c > ESC_b && -c <= ESC_w)
-                        firstByte = REQ_NONE;
-                    
-                    /* Set values to reset to if this is followed by a zero repeat. */
-                    
-                    zeroFirstByte = firstByte;
-                    zeroReqByte = reqByte;
-                    
-                    /* Back references are handled specially */
-                    
-                    if (-c >= ESC_REF) {
-                        int number = -c - ESC_REF;
-                        previous = code;
-                        *code++ = OP_REF;
-                        put2ByteValueAndAdvance(code, number);
-                    }
-                    
-                    /* For the rest, we can obtain the OP value by negating the escape
-                     value */
-                    
-                    else {
-                        previous = (-c > ESC_b && -c <= ESC_w) ? code : NULL;
-                        *code++ = -c;
-                    }
-                    continue;
-                }
-                
-                /* Fall through. */
-                
-                /* Handle a literal character. It is guaranteed not to be whitespace or #
-                 when the extended flag is set. If we are in UTF-8 mode, it may be a
-                 multi-byte literal character. */
-                
-                default:
-            NORMAL_CHAR:
-                
-                previous = code;
-                
-                if (c < 128) {
-                    mcLength = 1;
-                    mcbuffer[0] = c;
-                    
-                    if ((options & IgnoreCaseOption) && (c | 0x20) >= 'a' && (c | 0x20) <= 'z') {
-                        *code++ = OP_ASCII_LETTER_IGNORING_CASE;
-                        *code++ = c | 0x20;
-                    } else {
-                        *code++ = OP_ASCII_CHAR;
-                        *code++ = c;
-                    }
-                } else {
-                    mcLength = encodeUTF8(c, mcbuffer);
-                    
-                    *code++ = (options & IgnoreCaseOption) ? OP_CHAR_IGNORING_CASE : OP_CHAR;
-                    for (c = 0; c < mcLength; c++)
-                        *code++ = mcbuffer[c];
-                }
-                
-                /* Set the first and required bytes appropriately. If no previous first
-                 byte, set it from this character, but revert to none on a zero repeat.
-                 Otherwise, leave the firstByte value alone, and don't change it on a zero
-                 repeat. */
-                
-                if (firstByte == REQ_UNSET) {
-                    zeroFirstByte = REQ_NONE;
-                    zeroReqByte = reqByte;
-                    
-                    /* If the character is more than one byte long, we can set firstByte
-                     only if it is not to be matched caselessly. */
-                    
-                    if (mcLength == 1 || reqCaseOpt == 0) {
-                        firstByte = mcbuffer[0] | reqCaseOpt;
-                        if (mcLength != 1)
-                            reqByte = code[-1] | cd.reqVaryOpt;
-                    }
-                    else
-                        firstByte = reqByte = REQ_NONE;
-                }
-                
-                /* firstByte was previously set; we can set reqByte only the length is
-                 1 or the matching is caseful. */
-                
-                else {
-                    zeroFirstByte = firstByte;
-                    zeroReqByte = reqByte;
-                    if (mcLength == 1 || reqCaseOpt == 0)
-                        reqByte = code[-1] | reqCaseOpt | cd.reqVaryOpt;
-                }
-                
-                break;            /* End of literal character handling */
-        }
-    }                   /* end of big loop */
-    
-    /* Control never reaches here by falling through, only by a goto for all the
-     error states. Pass back the position in the pattern so that it can be displayed
-     to the user for diagnosing the error. */
-    
-FAILED:
-    *ptrPtr = ptr;
-    return false;
-}
-
-/*************************************************
-*     Compile sequence of alternatives           *
-*************************************************/
-
-/* On entry, ptr is pointing past the bracket character, but on return
-it points to the closing bracket, or vertical bar, or end of string.
-The code variable is pointing at the byte into which the BRA operator has been
-stored. If the ims options are changed at the start (for a (?ims: group) or
-during any branch, we need to insert an OP_OPT item at the start of every
-following branch to ensure they get set correctly at run time, and also pass
-the new options into every subsequent branch compile.
-
-Argument:
-  options        option bits, including any changes for this subpattern
-  brackets       -> int containing the number of extracting brackets used
-  codePtr        -> the address of the current code pointer
-  ptrPtr         -> the address of the current pattern pointer
-  errorCodePtr   -> pointer to error code variable
-  skipBytes      skip this many bytes at start (for OP_BRANUMBER)
-  firstbyteptr   place to put the first required character, or a negative number
-  reqbyteptr     place to put the last required character, or a negative number
-  cd             points to the data block with tables pointers etc.
-
-Returns:      true on success
-*/
-
-static bool
-compileBracket(int options, int* brackets, unsigned char** codePtr,
-    const UChar** ptrPtr, const UChar* patternEnd, ErrorCode* errorCodePtr, int skipBytes,
-    int* firstbyteptr, int* reqbyteptr, CompileData& cd)
-{
-    const UChar* ptr = *ptrPtr;
-    unsigned char* code = *codePtr;
-    unsigned char* lastBranch = code;
-    unsigned char* start_bracket = code;
-    int firstByte = REQ_UNSET;
-    int reqByte = REQ_UNSET;
-    
-    /* Offset is set zero to mark that this bracket is still open */
-    
-    putLinkValueAllowZero(code + 1, 0);
-    code += 1 + LINK_SIZE + skipBytes;
-    
-    /* Loop for each alternative branch */
-    
-    while (true) {
-        /* Now compile the branch */
-        
-        int branchFirstByte;
-        int branchReqByte;
-        if (!compileBranch(options, brackets, &code, &ptr, patternEnd, errorCodePtr,
-                            &branchFirstByte, &branchReqByte, cd)) {
-            *ptrPtr = ptr;
-            return false;
-        }
-        
-        /* If this is the first branch, the firstByte and reqByte values for the
-         branch become the values for the regex. */
-        
-        if (*lastBranch != OP_ALT) {
-            firstByte = branchFirstByte;
-            reqByte = branchReqByte;
-        }
-        
-        /* If this is not the first branch, the first char and reqByte have to
-         match the values from all the previous branches, except that if the previous
-         value for reqByte didn't have REQ_VARY set, it can still match, and we set
-         REQ_VARY for the regex. */
-        
-        else {
-            /* If we previously had a firstByte, but it doesn't match the new branch,
-             we have to abandon the firstByte for the regex, but if there was previously
-             no reqByte, it takes on the value of the old firstByte. */
-            
-            if (firstByte >= 0 && firstByte != branchFirstByte) {
-                if (reqByte < 0)
-                    reqByte = firstByte;
-                firstByte = REQ_NONE;
-            }
-            
-            /* If we (now or from before) have no firstByte, a firstByte from the
-             branch becomes a reqByte if there isn't a branch reqByte. */
-            
-            if (firstByte < 0 && branchFirstByte >= 0 && branchReqByte < 0)
-                branchReqByte = branchFirstByte;
-            
-            /* Now ensure that the reqbytes match */
-            
-            if ((reqByte & ~REQ_VARY) != (branchReqByte & ~REQ_VARY))
-                reqByte = REQ_NONE;
-            else
-                reqByte |= branchReqByte;   /* To "or" REQ_VARY */
-        }
-        
-        /* Reached end of expression, either ')' or end of pattern. Go back through
-         the alternative branches and reverse the chain of offsets, with the field in
-         the BRA item now becoming an offset to the first alternative. If there are
-         no alternatives, it points to the end of the group. The length in the
-         terminating ket is always the length of the whole bracketed item. If any of
-         the ims options were changed inside the group, compile a resetting op-code
-         following, except at the very end of the pattern. Return leaving the pointer
-         at the terminating char. */
-        
-        if (ptr >= patternEnd || *ptr != '|') {
-            int length = code - lastBranch;
-            do {
-                int prevLength = getLinkValueAllowZero(lastBranch + 1);
-                putLinkValue(lastBranch + 1, length);
-                length = prevLength;
-                lastBranch -= length;
-            } while (length > 0);
-            
-            /* Fill in the ket */
-            
-            *code = OP_KET;
-            putLinkValue(code + 1, code - start_bracket);
-            code += 1 + LINK_SIZE;
-            
-            /* Set values to pass back */
-            
-            *codePtr = code;
-            *ptrPtr = ptr;
-            *firstbyteptr = firstByte;
-            *reqbyteptr = reqByte;
-            return true;
-        }
-        
-        /* Another branch follows; insert an "or" node. Its length field points back
-         to the previous branch while the bracket remains open. At the end the chain
-         is reversed. It's done like this so that the start of the bracket has a
-         zero offset until it is closed, making it possible to detect recursion. */
-        
-        *code = OP_ALT;
-        putLinkValue(code + 1, code - lastBranch);
-        lastBranch = code;
-        code += 1 + LINK_SIZE;
-        ptr++;
-    }
-    ASSERT_NOT_REACHED();
-}
-
-/*************************************************
-*          Check for anchored expression         *
-*************************************************/
-
-/* Try to find out if this is an anchored regular expression. Consider each
-alternative branch. If they all start OP_CIRC, or with a bracket
-all of whose alternatives start OP_CIRC (recurse ad lib), then
-it's anchored.
-
-Arguments:
-  code          points to start of expression (the bracket)
-  captureMap    a bitmap of which brackets we are inside while testing; this
-                 handles up to substring 31; all brackets after that share
-                 the zero bit
-  backrefMap    the back reference bitmap
-*/
-
-static bool branchIsAnchored(const unsigned char* code)
-{
-    const unsigned char* scode = firstSignificantOpcode(code);
-    int op = *scode;
-
-    /* Brackets */
-    if (op >= OP_BRA || op == OP_ASSERT)
-        return bracketIsAnchored(scode);
-
-    /* Check for explicit anchoring */    
-    return op == OP_CIRC;
-}
-
-static bool bracketIsAnchored(const unsigned char* code)
-{
-    do {
-        if (!branchIsAnchored(code + 1 + LINK_SIZE))
-            return false;
-        code += getLinkValue(code + 1);
-    } while (*code == OP_ALT);   /* Loop for each alternative */
-    return true;
-}
-
-/*************************************************
-*         Check for starting with ^ or .*        *
-*************************************************/
-
-/* This is called to find out if every branch starts with ^ or .* so that
-"first char" processing can be done to speed things up in multiline
-matching and for non-DOTALL patterns that start with .* (which must start at
-the beginning or after \n)
-
-Except when the .* appears inside capturing parentheses, and there is a
-subsequent back reference to those parentheses. By keeping a bitmap of the
-first 31 back references, we can catch some of the more common cases more
-precisely; all the greater back references share a single bit.
-
-Arguments:
-  code          points to start of expression (the bracket)
-  captureMap    a bitmap of which brackets we are inside while testing; this
-                 handles up to substring 31; all brackets after that share
-                 the zero bit
-  backrefMap    the back reference bitmap
-*/
-
-static bool branchNeedsLineStart(const unsigned char* code, unsigned captureMap, unsigned backrefMap)
-{
-    const unsigned char* scode = firstSignificantOpcode(code);
-    int op = *scode;
-    
-    /* Capturing brackets */
-    if (op > OP_BRA) {
-        int captureNum = op - OP_BRA;
-        if (captureNum > EXTRACT_BASIC_MAX)
-            captureNum = get2ByteValue(scode + 2 + LINK_SIZE);
-        int bracketMask = (captureNum < 32) ? (1 << captureNum) : 1;
-        return bracketNeedsLineStart(scode, captureMap | bracketMask, backrefMap);
-    }
-    
-    /* Other brackets */
-    if (op == OP_BRA || op == OP_ASSERT)
-        return bracketNeedsLineStart(scode, captureMap, backrefMap);
-    
-    /* .* means "start at start or after \n" if it isn't in brackets that
-     may be referenced. */
-    
-    if (op == OP_TYPESTAR || op == OP_TYPEMINSTAR)
-        return scode[1] == OP_NOT_NEWLINE && !(captureMap & backrefMap);
-
-    /* Explicit ^ */
-    return op == OP_CIRC || op == OP_BOL;
-}
-
-static bool bracketNeedsLineStart(const unsigned char* code, unsigned captureMap, unsigned backrefMap)
-{
-    do {
-        if (!branchNeedsLineStart(code + 1 + LINK_SIZE, captureMap, backrefMap))
-            return false;
-        code += getLinkValue(code + 1);
-    } while (*code == OP_ALT);  /* Loop for each alternative */
-    return true;
-}
-
-/*************************************************
-*       Check for asserted fixed first char      *
-*************************************************/
-
-/* During compilation, the "first char" settings from forward assertions are
-discarded, because they can cause conflicts with actual literals that follow.
-However, if we end up without a first char setting for an unanchored pattern,
-it is worth scanning the regex to see if there is an initial asserted first
-char. If all branches start with the same asserted char, or with a bracket all
-of whose alternatives start with the same asserted char (recurse ad lib), then
-we return that char, otherwise -1.
-
-Arguments:
-  code       points to start of expression (the bracket)
-  options    pointer to the options (used to check casing changes)
-  inassert   true if in an assertion
-
-Returns:     -1 or the fixed first char
-*/
-
-static int branchFindFirstAssertedCharacter(const unsigned char* code, bool inassert)
-{
-    const unsigned char* scode = firstSignificantOpcodeSkippingAssertions(code);
-    int op = *scode;
-    
-    if (op >= OP_BRA)
-        op = OP_BRA;
-    
-    switch (op) {
-        default:
-            return -1;
-            
-        case OP_BRA:
-        case OP_ASSERT:
-            return bracketFindFirstAssertedCharacter(scode, op == OP_ASSERT);
-
-        case OP_EXACT:
-            scode += 2;
-            /* Fall through */
-
-        case OP_CHAR:
-        case OP_CHAR_IGNORING_CASE:
-        case OP_ASCII_CHAR:
-        case OP_ASCII_LETTER_IGNORING_CASE:
-        case OP_PLUS:
-        case OP_MINPLUS:
-            if (!inassert)
-                return -1;
-            return scode[1];
-    }
-}
-
-static int bracketFindFirstAssertedCharacter(const unsigned char* code, bool inassert)
-{
-    int c = -1;
-    do {
-        int d = branchFindFirstAssertedCharacter(code + 1 + LINK_SIZE, inassert);
-        if (d < 0)
-            return -1;
-        if (c < 0)
-            c = d;
-        else if (c != d)
-            return -1;
-        code += getLinkValue(code + 1);
-    } while (*code == OP_ALT);
-    return c;
-}
-
-static inline int multiplyWithOverflowCheck(int a, int b)
-{
-    if (!a || !b)
-        return 0;
-    if (a > MAX_PATTERN_SIZE / b)
-        return -1;
-    return a * b;
-}
-
-static int calculateCompiledPatternLength(const UChar* pattern, int patternLength, JSRegExpIgnoreCaseOption ignoreCase,
-    CompileData& cd, ErrorCode& errorcode)
-{
-    /* Make a pass over the pattern to compute the
-     amount of store required to hold the compiled code. This does not have to be
-     perfect as long as errors are overestimates. */
-
-    if (patternLength > MAX_PATTERN_SIZE) {
-        errorcode = ERR16;
-        return -1;
-    }
-
-    int length = 1 + LINK_SIZE;      /* For initial BRA plus length */
-    int branch_extra = 0;
-    int lastitemlength = 0;
-    unsigned brastackptr = 0;
-    FixedArray<int, BRASTACK_SIZE> brastack;
-    FixedArray<unsigned char, BRASTACK_SIZE> bralenstack;
-    int bracount = 0;
-    
-    const UChar* ptr = (const UChar*)(pattern - 1);
-    const UChar* patternEnd = (const UChar*)(pattern + patternLength);
-    
-    while (++ptr < patternEnd) {
-        int minRepeats = 0, maxRepeats = 0;
-        int c = *ptr;
-
-        switch (c) {
-            /* A backslashed item may be an escaped data character or it may be a
-             character type. */
-
-            case '\\':
-                c = checkEscape(&ptr, patternEnd, &errorcode, cd.numCapturingBrackets, false);
-                if (errorcode != 0)
-                    return -1;
-                
-                lastitemlength = 1;     /* Default length of last item for repeats */
-                
-                if (c >= 0) {            /* Data character */
-                    length += 2;          /* For a one-byte character */
-                    
-                    if (c > 127) {
-                        int i;
-                        for (i = 0; i < jsc_pcre_utf8_table1_size; i++)
-                            if (c <= jsc_pcre_utf8_table1[i]) break;
-                        length += i;
-                        lastitemlength += i;
-                    }
-                    
-                    continue;
-                }
-                
-                /* Other escapes need one byte */
-                
-                length++;
-                
-                /* A back reference needs an additional 2 bytes, plus either one or 5
-                 bytes for a repeat. We also need to keep the value of the highest
-                 back reference. */
-                
-                if (c <= -ESC_REF) {
-                    int refnum = -c - ESC_REF;
-                    cd.backrefMap |= (refnum < 32) ? (1 << refnum) : 1;
-                    if (refnum > cd.topBackref)
-                        cd.topBackref = refnum;
-                    length += 2;   /* For single back reference */
-                    if (safelyCheckNextChar(ptr, patternEnd, '{') && isCountedRepeat(ptr + 2, patternEnd)) {
-                        ptr = readRepeatCounts(ptr + 2, &minRepeats, &maxRepeats, &errorcode);
-                        if (errorcode)
-                            return -1;
-                        if ((minRepeats == 0 && (maxRepeats == 1 || maxRepeats == -1)) ||
-                            (minRepeats == 1 && maxRepeats == -1))
-                            length++;
-                        else
-                            length += 5;
-                        if (safelyCheckNextChar(ptr, patternEnd, '?'))
-                            ptr++;
-                    }
-                }
-                continue;
-                
-            case '^':     /* Single-byte metacharacters */
-            case '.':
-            case '$':
-                length++;
-                lastitemlength = 1;
-                continue;
-                
-            case '*':            /* These repeats won't be after brackets; */
-            case '+':            /* those are handled separately */
-            case '?':
-                length++;
-                goto POSSESSIVE;
-                
-            /* This covers the cases of braced repeats after a single char, metachar,
-             class, or back reference. */
-
-            case '{':
-                if (!isCountedRepeat(ptr + 1, patternEnd))
-                    goto NORMAL_CHAR;
-                ptr = readRepeatCounts(ptr + 1, &minRepeats, &maxRepeats, &errorcode);
-                if (errorcode != 0)
-                    return -1;
-                
-                /* These special cases just insert one extra opcode */
-                
-                if ((minRepeats == 0 && (maxRepeats == 1 || maxRepeats == -1)) ||
-                    (minRepeats == 1 && maxRepeats == -1))
-                    length++;
-                
-                /* These cases might insert additional copies of a preceding character. */
-                
-                else {
-                    if (minRepeats != 1) {
-                        length -= lastitemlength;   /* Uncount the original char or metachar */
-                        if (minRepeats > 0)
-                            length += 3 + lastitemlength;
-                    }
-                    length += lastitemlength + ((maxRepeats > 0) ? 3 : 1);
-                }
-                
-                if (safelyCheckNextChar(ptr, patternEnd, '?'))
-                    ptr++;      /* Needs no extra length */
-
-            POSSESSIVE:                     /* Test for possessive quantifier */
-                if (safelyCheckNextChar(ptr, patternEnd, '+')) {
-                    ptr++;
-                    length += 2 + 2 * LINK_SIZE;   /* Allow for atomic brackets */
-                }
-                continue;
-                
-            /* An alternation contains an offset to the next branch or ket. If any ims
-             options changed in the previous branch(es), and/or if we are in a
-             lookbehind assertion, extra space will be needed at the start of the
-             branch. This is handled by branch_extra. */
-                
-            case '|':
-                if (brastackptr == 0)
-                    cd.needOuterBracket = true;
-                length += 1 + LINK_SIZE + branch_extra;
-                continue;
-                
-            /* A character class uses 33 characters provided that all the character
-             values are less than 256. Otherwise, it uses a bit map for low valued
-             characters, and individual items for others. Don't worry about character
-             types that aren't allowed in classes - they'll get picked up during the
-             compile. A character class that contains only one single-byte character
-             uses 2 or 3 bytes, depending on whether it is negated or not. Notice this
-             where we can. (In UTF-8 mode we can do this only for chars < 128.) */
-                
-            case '[': {
-                int class_optcount;
-                if (*(++ptr) == '^') {
-                    class_optcount = 10;  /* Greater than one */
-                    ptr++;
-                }
-                else
-                    class_optcount = 0;
-                
-                bool class_utf8 = false;
-                
-                for (; ptr < patternEnd && *ptr != ']'; ++ptr) {
-                    /* Check for escapes */
-                    
-                    if (*ptr == '\\') {
-                        c = checkEscape(&ptr, patternEnd, &errorcode, cd.numCapturingBrackets, true);
-                        if (errorcode != 0)
-                            return -1;
-                        
-                        /* Handle escapes that turn into characters */
-                        
-                        if (c >= 0)
-                            goto NON_SPECIAL_CHARACTER;
-                        
-                        /* Escapes that are meta-things. The normal ones just affect the
-                         bit map, but Unicode properties require an XCLASS extended item. */
-                        
-                        else
-                            class_optcount = 10;         /* \d, \s etc; make sure > 1 */
-                    }
-                    
-                    /* Anything else increments the possible optimization count. We have to
-                     detect ranges here so that we can compute the number of extra ranges for
-                     caseless wide characters when UCP support is available. If there are wide
-                     characters, we are going to have to use an XCLASS, even for single
-                     characters. */
-                    
-                    else {
-                        c = *ptr;
-                        
-                        /* Come here from handling \ above when it escapes to a char value */
-                        
-                    NON_SPECIAL_CHARACTER:
-                        class_optcount++;
-                        
-                        int d = -1;
-                        if (safelyCheckNextChar(ptr, patternEnd, '-')) {
-                            const UChar* hyptr = ptr++;
-                            if (safelyCheckNextChar(ptr, patternEnd, '\\')) {
-                                ptr++;
-                                d = checkEscape(&ptr, patternEnd, &errorcode, cd.numCapturingBrackets, true);
-                                if (errorcode != 0)
-                                    return -1;
-                            }
-                            else if ((ptr + 1 < patternEnd) && ptr[1] != ']')
-                                d = *++ptr;
-                            if (d < 0)
-                                ptr = hyptr;      /* go back to hyphen as data */
-                        }
-                        
-                        /* If d >= 0 we have a range. In UTF-8 mode, if the end is > 255, or >
-                         127 for caseless matching, we will need to use an XCLASS. */
-                        
-                        if (d >= 0) {
-                            class_optcount = 10;     /* Ensure > 1 */
-                            if (d < c) {
-                                errorcode = ERR8;
-                                return -1;
-                            }
-                            
-                            if ((d > 255 || (ignoreCase && d > 127))) {
-                                unsigned char buffer[6];
-                                if (!class_utf8)         /* Allow for XCLASS overhead */
-                                {
-                                    class_utf8 = true;
-                                    length += LINK_SIZE + 2;
-                                }
-                                
-                                /* If we have UCP support, find out how many extra ranges are
-                                 needed to map the other case of characters within this range. We
-                                 have to mimic the range optimization here, because extending the
-                                 range upwards might push d over a boundary that makes it use
-                                 another byte in the UTF-8 representation. */
-                                
-                                if (ignoreCase) {
-                                    int occ, ocd;
-                                    int cc = c;
-                                    int origd = d;
-                                    while (getOthercaseRange(&cc, origd, &occ, &ocd)) {
-                                        if (occ >= c && ocd <= d)
-                                            continue;   /* Skip embedded */
-                                        
-                                        if (occ < c  && ocd >= c - 1)  /* Extend the basic range */
-                                        {                            /* if there is overlap,   */
-                                            c = occ;                     /* noting that if occ < c */
-                                            continue;                    /* we can't have ocd > d  */
-                                        }                            /* because a subrange is  */
-                                        if (ocd > d && occ <= d + 1)   /* always shorter than    */
-                                        {                            /* the basic range.       */
-                                            d = ocd;
-                                            continue;
-                                        }
-                                        
-                                        /* An extra item is needed */
-                                        
-                                        length += 1 + encodeUTF8(occ, buffer) +
-                                        ((occ == ocd) ? 0 : encodeUTF8(ocd, buffer));
-                                    }
-                                }
-                                
-                                /* The length of the (possibly extended) range */
-                                
-                                length += 1 + encodeUTF8(c, buffer) + encodeUTF8(d, buffer);
-                            }
-                            
-                        }
-                        
-                        /* We have a single character. There is nothing to be done unless we
-                         are in UTF-8 mode. If the char is > 255, or 127 when caseless, we must
-                         allow for an XCL_SINGLE item, doubled for caselessness if there is UCP
-                         support. */
-                        
-                        else {
-                            if ((c > 255 || (ignoreCase && c > 127))) {
-                                unsigned char buffer[6];
-                                class_optcount = 10;     /* Ensure > 1 */
-                                if (!class_utf8)         /* Allow for XCLASS overhead */
-                                {
-                                    class_utf8 = true;
-                                    length += LINK_SIZE + 2;
-                                }
-                                length += (ignoreCase ? 2 : 1) * (1 + encodeUTF8(c, buffer));
-                            }
-                        }
-                    }
-                }
-                
-                if (ptr >= patternEnd) {   /* Missing terminating ']' */
-                    errorcode = ERR6;
-                    return -1;
-                }
-                
-                /* We can optimize when there was only one optimizable character.
-                 Note that this does not detect the case of a negated single character.
-                 In that case we do an incorrect length computation, but it's not a serious
-                 problem because the computed length is too large rather than too small. */
-
-                if (class_optcount == 1)
-                    goto NORMAL_CHAR;
-
-                /* Here, we handle repeats for the class opcodes. */
-                {
-                    length += 33;
-                    
-                    /* A repeat needs either 1 or 5 bytes. If it is a possessive quantifier,
-                     we also need extra for wrapping the whole thing in a sub-pattern. */
-                    
-                    if (safelyCheckNextChar(ptr, patternEnd, '{') && isCountedRepeat(ptr + 2, patternEnd)) {
-                        ptr = readRepeatCounts(ptr + 2, &minRepeats, &maxRepeats, &errorcode);
-                        if (errorcode != 0)
-                            return -1;
-                        if ((minRepeats == 0 && (maxRepeats == 1 || maxRepeats == -1)) ||
-                            (minRepeats == 1 && maxRepeats == -1))
-                            length++;
-                        else
-                            length += 5;
-                        if (safelyCheckNextChar(ptr, patternEnd, '+')) {
-                            ptr++;
-                            length += 2 + 2 * LINK_SIZE;
-                        } else if (safelyCheckNextChar(ptr, patternEnd, '?'))
-                            ptr++;
-                    }
-                }
-                continue;
-            }
-
-            /* Brackets may be genuine groups or special things */
-                
-            case '(': {
-                int branch_newextra = 0;
-                int bracket_length = 1 + LINK_SIZE;
-                bool capturing = false;
-                
-                /* Handle special forms of bracket, which all start (? */
-                
-                if (safelyCheckNextChar(ptr, patternEnd, '?')) {
-                    switch (c = (ptr + 2 < patternEnd ? ptr[2] : 0)) {
-                        /* Non-referencing groups and lookaheads just move the pointer on, and
-                         then behave like a non-special bracket, except that they don't increment
-                         the count of extracting brackets. Ditto for the "once only" bracket,
-                         which is in Perl from version 5.005. */
-                            
-                        case ':':
-                        case '=':
-                        case '!':
-                            ptr += 2;
-                            break;
-                            
-                        /* Else loop checking valid options until ) is met. Anything else is an
-                         error. If we are without any brackets, i.e. at top level, the settings
-                         act as if specified in the options, so massage the options immediately.
-                         This is for backward compatibility with Perl 5.004. */
-                            
-                        default:
-                            errorcode = ERR12;
-                            return -1;
-                    }
-                } else
-                    capturing = 1;
-                
-                /* Capturing brackets must be counted so we can process escapes in a
-                 Perlish way. If the number exceeds EXTRACT_BASIC_MAX we are going to need
-                 an additional 3 bytes of memory per capturing bracket. */
-                
-                if (capturing) {
-                    bracount++;
-                    if (bracount > EXTRACT_BASIC_MAX)
-                        bracket_length += 3;
-                }
-                
-                /* Save length for computing whole length at end if there's a repeat that
-                 requires duplication of the group. Also save the current value of
-                 branch_extra, and start the new group with the new value. If non-zero, this
-                 will either be 2 for a (?imsx: group, or 3 for a lookbehind assertion. */
-                
-                if (brastackptr >= sizeof(brastack)/sizeof(int)) {
-                    errorcode = ERR17;
-                    return -1;
-                }
-                
-                bralenstack[brastackptr] = branch_extra;
-                branch_extra = branch_newextra;
-                
-                brastack[brastackptr++] = length;
-                length += bracket_length;
-                continue;
-            }
-
-            /* Handle ket. Look for subsequent maxRepeats/minRepeats; for certain sets of values we
-             have to replicate this bracket up to that many times. If brastackptr is
-             0 this is an unmatched bracket which will generate an error, but take care
-             not to try to access brastack[-1] when computing the length and restoring
-             the branch_extra value. */
-
-            case ')': {
-                int duplength;
-                length += 1 + LINK_SIZE;
-                if (brastackptr > 0) {
-                    duplength = length - brastack[--brastackptr];
-                    branch_extra = bralenstack[brastackptr];
-                }
-                else
-                    duplength = 0;
-                
-                /* Leave ptr at the final char; for readRepeatCounts this happens
-                 automatically; for the others we need an increment. */
-                
-                if ((ptr + 1 < patternEnd) && (c = ptr[1]) == '{' && isCountedRepeat(ptr + 2, patternEnd)) {
-                    ptr = readRepeatCounts(ptr + 2, &minRepeats, &maxRepeats, &errorcode);
-                    if (errorcode)
-                        return -1;
-                } else if (c == '*') {
-                    minRepeats = 0;
-                    maxRepeats = -1;
-                    ptr++;
-                } else if (c == '+') {
-                    minRepeats = 1;
-                    maxRepeats = -1;
-                    ptr++;
-                } else if (c == '?') {
-                    minRepeats = 0;
-                    maxRepeats = 1;
-                    ptr++;
-                } else {
-                    minRepeats = 1;
-                    maxRepeats = 1;
-                }
-                
-                /* If the minimum is zero, we have to allow for an OP_BRAZERO before the
-                 group, and if the maximum is greater than zero, we have to replicate
-                 maxval-1 times; each replication acquires an OP_BRAZERO plus a nesting
-                 bracket set. */
-                
-                int repeatsLength;
-                if (minRepeats == 0) {
-                    length++;
-                    if (maxRepeats > 0) {
-                        repeatsLength = multiplyWithOverflowCheck(maxRepeats - 1, duplength + 3 + 2 * LINK_SIZE);
-                        if (repeatsLength < 0) {
-                            errorcode = ERR16;
-                            return -1;
-                        }
-                        length += repeatsLength;
-                        if (length > MAX_PATTERN_SIZE) {
-                            errorcode = ERR16;
-                            return -1;
-                        }
-                    }
-                }
-                
-                /* When the minimum is greater than zero, we have to replicate up to
-                 minval-1 times, with no additions required in the copies. Then, if there
-                 is a limited maximum we have to replicate up to maxval-1 times allowing
-                 for a BRAZERO item before each optional copy and nesting brackets for all
-                 but one of the optional copies. */
-                
-                else {
-                    repeatsLength = multiplyWithOverflowCheck(minRepeats - 1, duplength);
-                    if (repeatsLength < 0) {
-                        errorcode = ERR16;
-                        return -1;
-                    }
-                    length += repeatsLength;
-                    if (maxRepeats > minRepeats) { /* Need this test as maxRepeats=-1 means no limit */
-                        repeatsLength = multiplyWithOverflowCheck(maxRepeats - minRepeats, duplength + 3 + 2 * LINK_SIZE);
-                        if (repeatsLength < 0) {
-                            errorcode = ERR16;
-                            return -1;
-                        }
-                        length += repeatsLength - (2 + 2 * LINK_SIZE);
-                    }
-                    if (length > MAX_PATTERN_SIZE) {
-                        errorcode = ERR16;
-                        return -1;
-                    }
-                }
-                
-                /* Allow space for once brackets for "possessive quantifier" */
-                
-                if (safelyCheckNextChar(ptr, patternEnd, '+')) {
-                    ptr++;
-                    length += 2 + 2 * LINK_SIZE;
-                }
-                continue;
-            }
-
-            /* Non-special character. It won't be space or # in extended mode, so it is
-             always a genuine character. If we are in a \Q...\E sequence, check for the
-             end; if not, we have a literal. */
-                
-            default:
-            NORMAL_CHAR:
-                length += 2;          /* For a one-byte character */
-                lastitemlength = 1;   /* Default length of last item for repeats */
-
-                if (c > 127) {
-                    int i;
-                    for (i = 0; i < jsc_pcre_utf8_table1_size; i++)
-                        if (c <= jsc_pcre_utf8_table1[i])
-                            break;
-                    length += i;
-                    lastitemlength += i;
-                }
-                
-                continue;
-        }
-    }
-    
-    length += 2 + LINK_SIZE;    /* For final KET and END */
-
-    cd.numCapturingBrackets = bracount;
-    return length;
-}
-
-/*************************************************
-*        Compile a Regular Expression            *
-*************************************************/
-
-/* This function takes a string and returns a pointer to a block of store
-holding a compiled version of the expression. The original API for this
-function had no error code return variable; it is retained for backwards
-compatibility. The new function is given a new name.
-
-Arguments:
-  pattern       the regular expression
-  options       various option bits
-  errorCodePtr  pointer to error code variable (pcre_compile2() only)
-                  can be NULL if you don't want a code value
-  errorPtr      pointer to pointer to error text
-  erroroffset   ptr offset in pattern where error was detected
-  tables        pointer to character tables or NULL
-
-Returns:        pointer to compiled data block, or NULL on error,
-                with errorPtr and erroroffset set
-*/
-
-static inline JSRegExp* returnError(ErrorCode errorcode, const char** errorPtr)
-{
-    *errorPtr = errorText(errorcode);
-    return 0;
-}
-
-JSRegExp* jsRegExpCompile(const UChar* pattern, int patternLength,
-                JSRegExpIgnoreCaseOption ignoreCase, JSRegExpMultilineOption multiline,
-                unsigned* numSubpatterns, const char** errorPtr)
-{
-    /* We can't pass back an error message if errorPtr is NULL; I guess the best we
-     can do is just return NULL, but we can set a code value if there is a code pointer. */
-    if (!errorPtr)
-        return 0;
-    *errorPtr = NULL;
-    
-    CompileData cd;
-    
-    ErrorCode errorcode = ERR0;
-    /* Call this once just to count the brackets. */
-    calculateCompiledPatternLength(pattern, patternLength, ignoreCase, cd, errorcode);
-    /* Call it again to compute the length. */
-    int length = calculateCompiledPatternLength(pattern, patternLength, ignoreCase, cd, errorcode);
-    if (errorcode)
-        return returnError(errorcode, errorPtr);
-    
-    if (length > MAX_PATTERN_SIZE)
-        return returnError(ERR16, errorPtr);
-    
-    size_t size = length + sizeof(JSRegExp);
-#if REGEXP_HISTOGRAM
-    size_t stringOffset = (size + sizeof(UChar) - 1) / sizeof(UChar) * sizeof(UChar);
-    size = stringOffset + patternLength * sizeof(UChar);
-#endif
-    JSRegExp* re = reinterpret_cast_ptr<JSRegExp*>(new char[size]);
-    
-    if (!re)
-        return returnError(ERR13, errorPtr);
-    
-    re->options = (ignoreCase ? IgnoreCaseOption : 0) | (multiline ? MatchAcrossMultipleLinesOption : 0);
-    
-    /* The starting points of the name/number translation table and of the code are
-     passed around in the compile data block. */
-    
-    const unsigned char* codeStart = (const unsigned char*)(re + 1);
-    
-    /* Set up a starting, non-extracting bracket, then compile the expression. On
-     error, errorcode will be set non-zero, so we don't need to look at the result
-     of the function here. */
-    
-    const UChar* ptr = (const UChar*)pattern;
-    const UChar* patternEnd = pattern + patternLength;
-    unsigned char* code = const_cast<unsigned char*>(codeStart);
-    int firstByte, reqByte;
-    int bracketCount = 0;
-    if (!cd.needOuterBracket)
-        compileBranch(re->options, &bracketCount, &code, &ptr, patternEnd, &errorcode, &firstByte, &reqByte, cd);
-    else {
-        *code = OP_BRA;
-        compileBracket(re->options, &bracketCount, &code, &ptr, patternEnd, &errorcode, 0, &firstByte, &reqByte, cd);
-    }
-    re->topBracket = bracketCount;
-    re->topBackref = cd.topBackref;
-    
-    /* If not reached end of pattern on success, there's an excess bracket. */
-    
-    if (errorcode == 0 && ptr < patternEnd)
-        errorcode = ERR10;
-    
-    /* Fill in the terminating state and check for disastrous overflow, but
-     if debugging, leave the test till after things are printed out. */
-    
-    *code++ = OP_END;
-
-    ASSERT(code - codeStart <= length);
-    if (code - codeStart > length)
-        errorcode = ERR7;
-    
-    /* Give an error if there's back reference to a non-existent capturing
-     subpattern. */
-    
-    if (re->topBackref > re->topBracket)
-        errorcode = ERR15;
-    
-    /* Failed to compile, or error while post-processing */
-    
-    if (errorcode != ERR0) {
-        delete [] reinterpret_cast<char*>(re);
-        return returnError(errorcode, errorPtr);
-    }
-    
-    /* If the anchored option was not passed, set the flag if we can determine that
-     the pattern is anchored by virtue of ^ characters or \A or anything else (such
-     as starting with .* when DOTALL is set).
-     
-     Otherwise, if we know what the first character has to be, save it, because that
-     speeds up unanchored matches no end. If not, see if we can set the
-     UseMultiLineFirstByteOptimizationOption flag. This is helpful for multiline matches when all branches
-     start with ^. and also when all branches start with .* for non-DOTALL matches.
-     */
-    
-    if (cd.needOuterBracket ? bracketIsAnchored(codeStart) : branchIsAnchored(codeStart))
-        re->options |= IsAnchoredOption;
-    else {
-        if (firstByte < 0) {
-            firstByte = (cd.needOuterBracket
-                    ? bracketFindFirstAssertedCharacter(codeStart, false)
-                    : branchFindFirstAssertedCharacter(codeStart, false))
-                | ((re->options & IgnoreCaseOption) ? REQ_IGNORE_CASE : 0);
-        }
-        if (firstByte >= 0) {
-            int ch = firstByte & 255;
-            if (ch < 127) {
-                re->firstByte = ((firstByte & REQ_IGNORE_CASE) && flipCase(ch) == ch) ? ch : firstByte;
-                re->options |= UseFirstByteOptimizationOption;
-            }
-        } else {
-            if (cd.needOuterBracket ? bracketNeedsLineStart(codeStart, 0, cd.backrefMap) : branchNeedsLineStart(codeStart, 0, cd.backrefMap))
-                re->options |= UseMultiLineFirstByteOptimizationOption;
-        }
-    }
-    
-    /* For an anchored pattern, we use the "required byte" only if it follows a
-     variable length item in the regex. Remove the caseless flag for non-caseable
-     bytes. */
-    
-    if (reqByte >= 0 && (!(re->options & IsAnchoredOption) || (reqByte & REQ_VARY))) {
-        int ch = reqByte & 255;
-        if (ch < 127) {
-            re->reqByte = ((reqByte & REQ_IGNORE_CASE) && flipCase(ch) == ch) ? (reqByte & ~REQ_IGNORE_CASE) : reqByte;
-            re->options |= UseRequiredByteOptimizationOption;
-        }
-    }
-    
-#if REGEXP_HISTOGRAM
-    re->stringOffset = stringOffset;
-    re->stringLength = patternLength;
-    memcpy(reinterpret_cast<char*>(re) + stringOffset, pattern, patternLength * 2);
-#endif
-
-    if (numSubpatterns)
-        *numSubpatterns = re->topBracket;
-    return re;
-}
-
-void jsRegExpFree(JSRegExp* re)
-{
-    delete [] reinterpret_cast<char*>(re);
-}
diff --git a/Source/JavaScriptCore/pcre/pcre_exec.cpp b/Source/JavaScriptCore/pcre/pcre_exec.cpp
deleted file mode 100644 (file)
index b7018aa..0000000
+++ /dev/null
@@ -1,2179 +0,0 @@
-/* This is JavaScriptCore's variant of the PCRE library. While this library
-started out as a copy of PCRE, many of the features of PCRE have been
-removed. This library now supports only the regular expression features
-required by the JavaScript language specification, and has only the functions
-needed by JavaScriptCore and the rest of WebKit.
-
-                 Originally written by Philip Hazel
-           Copyright (c) 1997-2006 University of Cambridge
-    Copyright (C) 2002, 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-    Copyright (C) 2007 Eric Seidel <eric@webkit.org>
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-    * Neither the name of the University of Cambridge nor the names of its
-      contributors may be used to endorse or promote products derived from
-      this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-/* This module contains jsRegExpExecute(), the externally visible function
-that does pattern matching using an NFA algorithm, following the rules from
-the JavaScript specification. There are also some supporting functions. */
-
-#include "config.h"
-#include "pcre_internal.h"
-
-#include <limits.h>
-#include <wtf/ASCIICType.h>
-#include <wtf/Vector.h>
-
-#if REGEXP_HISTOGRAM
-#include <wtf/DateMath.h>
-#include <runtime/UString.h>
-#endif
-
-using namespace WTF;
-
-#if HAVE(COMPUTED_GOTO)
-#define USE_COMPUTED_GOTO_FOR_MATCH_RECURSION
-//#define USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP
-#endif
-
-/* Avoid warnings on Windows. */
-#undef min
-#undef max
-
-#ifndef USE_COMPUTED_GOTO_FOR_MATCH_RECURSION
-typedef int ReturnLocation;
-#else
-typedef void* ReturnLocation;
-#endif
-
-#if !REGEXP_HISTOGRAM
-
-class HistogramTimeLogger {
-public:
-    HistogramTimeLogger(const JSRegExp*) { }
-};
-
-#else
-
-using namespace JSC;
-
-class Histogram {
-public:
-    ~Histogram();
-    void add(const JSRegExp*, double);
-
-private:
-    typedef HashMap<RefPtr<StringImpl>, double> Map;
-    Map times;
-};
-
-class HistogramTimeLogger {
-public:
-    HistogramTimeLogger(const JSRegExp*);
-    ~HistogramTimeLogger();
-
-private:
-    const JSRegExp* m_re;
-    double m_startTime;
-};
-
-#endif
-
-/* Structure for building a chain of data for holding the values of
-the subject pointer at the start of each bracket, used to detect when
-an empty string has been matched by a bracket to break infinite loops. */ 
-struct BracketChainNode {
-    BracketChainNode* previousBracket;
-    const UChar* bracketStart;
-};
-
-struct MatchFrame {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    ReturnLocation returnLocation;
-    struct MatchFrame* previousFrame;
-    
-    /* Function arguments that may change */
-    struct {
-        const UChar* subjectPtr;
-        const unsigned char* instructionPtr;
-        int offsetTop;
-        BracketChainNode* bracketChain;
-    } args;
-    
-    
-    /* PCRE uses "fake" recursion built off of gotos, thus
-     stack-based local variables are not safe to use.  Instead we have to
-     store local variables on the current MatchFrame. */
-    struct {
-        const unsigned char* data;
-        const unsigned char* startOfRepeatingBracket;
-        const UChar* subjectPtrAtStartOfInstruction; // Several instrutions stash away a subjectPtr here for later compare
-        const unsigned char* instructionPtrAtStartOfOnce;
-        
-        int repeatOthercase;
-        
-        int ctype;
-        int fc;
-        int fi;
-        int length;
-        int max;
-        int number;
-        int offset;
-        int saveOffset1;
-        int saveOffset2;
-        int saveOffset3;
-        
-        BracketChainNode bracketChainNode;
-    } locals;
-};
-
-/* Structure for passing "static" information around between the functions
-doing traditional NFA matching, so that they are thread-safe. */
-
-struct MatchData {
-  int*   offsetVector;         /* Offset vector */
-  int    offsetEnd;            /* One past the end */
-  int    offsetMax;            /* The maximum usable for return data */
-  bool   offsetOverflow;       /* Set if too many extractions */
-  const UChar*  startSubject;         /* Start of the subject string */
-  const UChar*  endSubject;           /* End of the subject string */
-  const UChar*  endMatchPtr;         /* Subject position at end match */
-  int    endOffsetTop;        /* Highwater mark at end of match */
-  bool   multiline;
-  bool   ignoreCase;
-};
-
-/* The maximum remaining length of subject we are prepared to search for a
-reqByte match. */
-
-#define REQ_BYTE_MAX 1000
-
-/* The below limit restricts the number of "recursive" match calls in order to
-avoid spending exponential time on complex regular expressions. */
-
-static const unsigned matchLimit = 1000000;
-
-#ifdef DEBUG
-/*************************************************
-*        Debugging function to print chars       *
-*************************************************/
-
-/* Print a sequence of chars in printable format, stopping at the end of the
-subject if the requested.
-
-Arguments:
-  p           points to characters
-  length      number to print
-  isSubject  true if printing from within md.startSubject
-  md          pointer to matching data block, if isSubject is true
-*/
-
-static void pchars(const UChar* p, int length, bool isSubject, const MatchData& md)
-{
-    if (isSubject && length > md.endSubject - p)
-        length = md.endSubject - p;
-    while (length-- > 0) {
-        int c;
-        if (isASCIIPrintable(c = *(p++)))
-            printf("%c", c);
-        else if (c < 256)
-            printf("\\x%02x", c);
-        else
-            printf("\\x{%x}", c);
-    }
-}
-#endif
-
-/*************************************************
-*          Match a back-reference                *
-*************************************************/
-
-/* If a back reference hasn't been set, the length that is passed is greater
-than the number of characters left in the string, so the match fails.
-
-Arguments:
-  offset      index into the offset vector
-  subjectPtr        points into the subject
-  length      length to be matched
-  md          points to match data block
-
-Returns:      true if matched
-*/
-
-static bool matchRef(int offset, const UChar* subjectPtr, int length, const MatchData& md)
-{
-    const UChar* p = md.startSubject + md.offsetVector[offset];
-    
-#ifdef DEBUG
-    if (subjectPtr >= md.endSubject)
-        printf("matching subject <null>");
-    else {
-        printf("matching subject ");
-        pchars(subjectPtr, length, true, md);
-    }
-    printf(" against backref ");
-    pchars(p, length, false, md);
-    printf("\n");
-#endif
-    
-    /* Always fail if not enough characters left */
-    
-    if (length > md.endSubject - subjectPtr)
-        return false;
-    
-    /* Separate the caselesss case for speed */
-    
-    if (md.ignoreCase) {
-        while (length-- > 0) {
-            UChar c = *p++;
-            int othercase = jsc_pcre_ucp_othercase(c);
-            UChar d = *subjectPtr++;
-            if (c != d && othercase != d)
-                return false;
-        }
-    }
-    else {
-        while (length-- > 0)
-            if (*p++ != *subjectPtr++)
-                return false;
-    }
-    
-    return true;
-}
-
-#ifndef USE_COMPUTED_GOTO_FOR_MATCH_RECURSION
-
-/* Use numbered labels and switch statement at the bottom of the match function. */
-
-#define RMATCH_WHERE(num) num
-#define RRETURN_LABEL RRETURN_SWITCH
-
-#else
-
-/* Use GCC's computed goto extension. */
-
-/* For one test case this is more than 40% faster than the switch statement.
-We could avoid the use of the num argument entirely by using local labels,
-but using it for the GCC case as well as the non-GCC case allows us to share
-a bit more code and notice if we use conflicting numbers.*/
-
-#define RMATCH_WHERE(num) &&RRETURN_##num
-#define RRETURN_LABEL *stack.currentFrame->returnLocation
-
-#endif
-
-#define RECURSIVE_MATCH_COMMON(num) \
-    goto RECURSE;\
-    RRETURN_##num: \
-    stack.popCurrentFrame();
-
-#define RECURSIVE_MATCH(num, ra, rb) \
-    do { \
-        stack.pushNewFrame((ra), (rb), RMATCH_WHERE(num)); \
-        RECURSIVE_MATCH_COMMON(num) \
-    } while (0)
-
-#define RECURSIVE_MATCH_NEW_GROUP(num, ra, rb) \
-    do { \
-        stack.pushNewFrame((ra), (rb), RMATCH_WHERE(num)); \
-        startNewGroup(stack.currentFrame); \
-        RECURSIVE_MATCH_COMMON(num) \
-    } while (0)
-
-#define RRETURN goto RRETURN_LABEL
-
-#define RRETURN_NO_MATCH do { isMatch = false; RRETURN; } while (0)
-
-/*************************************************
-*         Match from current position            *
-*************************************************/
-
-/* On entry instructionPtr points to the first opcode, and subjectPtr to the first character
-in the subject string, while substringStart holds the value of subjectPtr at the start of the
-last bracketed group - used for breaking infinite loops matching zero-length
-strings. This function is called recursively in many circumstances. Whenever it
-returns a negative (error) response, the outer match() call must also return the
-same response.
-
-Arguments:
-   subjectPtr        pointer in subject
-   instructionPtr       position in code
-   offsetTop  current top pointer
-   md          pointer to "static" info for the match
-
-Returns:       1 if matched          )  these values are >= 0
-               0 if failed to match  )
-               a negative error value if aborted by an error condition
-                 (e.g. stopped by repeated call or recursion limit)
-*/
-
-static const unsigned numFramesOnStack = 16;
-
-struct MatchStack {
-    MatchStack()
-        : framesEnd(frames + numFramesOnStack)
-        , currentFrame(frames)
-        , size(1) // match() creates accesses the first frame w/o calling pushNewFrame
-    {
-        ASSERT((sizeof(frames) / sizeof(frames[0])) == numFramesOnStack);
-    }
-    
-    MatchFrame frames[numFramesOnStack];
-    MatchFrame* framesEnd;
-    MatchFrame* currentFrame;
-    unsigned size;
-    
-    inline bool canUseStackBufferForNextFrame()
-    {
-        return size < numFramesOnStack;
-    }
-    
-    inline MatchFrame* allocateNextFrame()
-    {
-        if (canUseStackBufferForNextFrame())
-            return currentFrame + 1;
-        return new MatchFrame;
-    }
-    
-    inline void pushNewFrame(const unsigned char* instructionPtr, BracketChainNode* bracketChain, ReturnLocation returnLocation)
-    {
-        MatchFrame* newframe = allocateNextFrame();
-        newframe->previousFrame = currentFrame;
-
-        newframe->args.subjectPtr = currentFrame->args.subjectPtr;
-        newframe->args.offsetTop = currentFrame->args.offsetTop;
-        newframe->args.instructionPtr = instructionPtr;
-        newframe->args.bracketChain = bracketChain;
-        newframe->returnLocation = returnLocation;
-        size++;
-
-        currentFrame = newframe;
-    }
-    
-    inline void popCurrentFrame()
-    {
-        MatchFrame* oldFrame = currentFrame;
-        currentFrame = currentFrame->previousFrame;
-        if (size > numFramesOnStack)
-            delete oldFrame;
-        size--;
-    }
-
-    void popAllFrames()
-    {
-        while (size)
-            popCurrentFrame();
-    }
-};
-
-static int matchError(int errorCode, MatchStack& stack)
-{
-    stack.popAllFrames();
-    return errorCode;
-}
-
-/* Get the next UTF-8 character, not advancing the pointer, incrementing length
- if there are extra bytes. This is called when we know we are in UTF-8 mode. */
-
-static inline void getUTF8CharAndIncrementLength(int& c, const unsigned char* subjectPtr, int& len)
-{
-    c = *subjectPtr;
-    if ((c & 0xc0) == 0xc0) {
-        int gcaa = jsc_pcre_utf8_table4[c & 0x3f];  /* Number of additional bytes */
-        int gcss = 6 * gcaa;
-        c = (c & jsc_pcre_utf8_table3[gcaa]) << gcss;
-        for (int gcii = 1; gcii <= gcaa; gcii++) {
-            gcss -= 6;
-            c |= (subjectPtr[gcii] & 0x3f) << gcss;
-        }
-        len += gcaa;
-    }
-}
-
-static inline void startNewGroup(MatchFrame* currentFrame)
-{
-    /* At the start of a bracketed group, add the current subject pointer to the
-     stack of such pointers, to be re-instated at the end of the group when we hit
-     the closing ket. When match() is called in other circumstances, we don't add to
-     this stack. */
-    
-    currentFrame->locals.bracketChainNode.previousBracket = currentFrame->args.bracketChain;
-    currentFrame->locals.bracketChainNode.bracketStart = currentFrame->args.subjectPtr;
-    currentFrame->args.bracketChain = &currentFrame->locals.bracketChainNode;
-}
-
-// FIXME: "minimize" means "not greedy", we should invert the callers to ask for "greedy" to be less confusing
-static inline void repeatInformationFromInstructionOffset(int instructionOffset, bool& minimize, int& minimumRepeats, int& maximumRepeats)
-{
-    // Instruction offsets are based off of OP_CRSTAR, OP_STAR, OP_TYPESTAR, OP_NOTSTAR
-    static const char minimumRepeatsFromInstructionOffset[] = { 0, 0, 1, 1, 0, 0 };
-    static const int maximumRepeatsFromInstructionOffset[] = { INT_MAX, INT_MAX, INT_MAX, INT_MAX, 1, 1 };
-
-    ASSERT(instructionOffset >= 0);
-    ASSERT(instructionOffset <= (OP_CRMINQUERY - OP_CRSTAR));
-
-    minimize = (instructionOffset & 1); // this assumes ordering: Instruction, MinimizeInstruction, Instruction2, MinimizeInstruction2
-    minimumRepeats = minimumRepeatsFromInstructionOffset[instructionOffset];
-    maximumRepeats = maximumRepeatsFromInstructionOffset[instructionOffset];
-}
-
-static int match(const UChar* subjectPtr, const unsigned char* instructionPtr, int offsetTop, MatchData& md)
-{
-    bool isMatch = false;
-    int min;
-    bool minimize = false; /* Initialization not really needed, but some compilers think so. */
-    unsigned remainingMatchCount = matchLimit;
-    int othercase; /* Declare here to avoid errors during jumps */
-    
-    MatchStack stack;
-
-    /* The opcode jump table. */
-#ifdef USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP
-#define EMIT_JUMP_TABLE_ENTRY(opcode) &&LABEL_OP_##opcode,
-    static void* opcodeJumpTable[256] = { FOR_EACH_OPCODE(EMIT_JUMP_TABLE_ENTRY) };
-#undef EMIT_JUMP_TABLE_ENTRY
-#endif
-    
-    /* One-time setup of the opcode jump table. */
-#ifdef USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP
-    for (int i = 255; !opcodeJumpTable[i]; i--)
-        opcodeJumpTable[i] = &&CAPTURING_BRACKET;
-#endif
-    
-#ifdef USE_COMPUTED_GOTO_FOR_MATCH_RECURSION
-    // Shark shows this as a hot line
-    // Using a static const here makes this line disappear, but makes later access hotter (not sure why)
-    stack.currentFrame->returnLocation = &&RETURN;
-#else
-    stack.currentFrame->returnLocation = 0;
-#endif
-    stack.currentFrame->args.subjectPtr = subjectPtr;
-    stack.currentFrame->args.instructionPtr = instructionPtr;
-    stack.currentFrame->args.offsetTop = offsetTop;
-    stack.currentFrame->args.bracketChain = 0;
-    startNewGroup(stack.currentFrame);
-    
-    /* This is where control jumps back to to effect "recursion" */
-    
-RECURSE:
-    if (!--remainingMatchCount)
-        return matchError(JSRegExpErrorHitLimit, stack);
-
-    /* Now start processing the operations. */
-    
-#ifndef USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP
-    while (true)
-#endif
-    {
-        
-#ifdef USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP
-#define BEGIN_OPCODE(opcode) LABEL_OP_##opcode
-#define NEXT_OPCODE goto *opcodeJumpTable[*stack.currentFrame->args.instructionPtr]
-#else
-#define BEGIN_OPCODE(opcode) case OP_##opcode
-#define NEXT_OPCODE continue
-#endif
-        
-#ifdef USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP
-        NEXT_OPCODE;
-#else
-        switch (*stack.currentFrame->args.instructionPtr)
-#endif
-        {
-            /* Non-capturing bracket: optimized */
-                
-            BEGIN_OPCODE(BRA):
-            NON_CAPTURING_BRACKET:
-                DPRINTF(("start bracket 0\n"));
-                do {
-                    RECURSIVE_MATCH_NEW_GROUP(2, stack.currentFrame->args.instructionPtr + 1 + LINK_SIZE, stack.currentFrame->args.bracketChain);
-                    if (isMatch)
-                        RRETURN;
-                    stack.currentFrame->args.instructionPtr += getLinkValue(stack.currentFrame->args.instructionPtr + 1);
-                } while (*stack.currentFrame->args.instructionPtr == OP_ALT);
-                DPRINTF(("bracket 0 failed\n"));
-                RRETURN;
-                
-            /* Skip over large extraction number data if encountered. */
-                
-            BEGIN_OPCODE(BRANUMBER):
-                stack.currentFrame->args.instructionPtr += 3;
-                NEXT_OPCODE;
-                
-            /* End of the pattern. */
-                
-            BEGIN_OPCODE(END):
-                md.endMatchPtr = stack.currentFrame->args.subjectPtr;          /* Record where we ended */
-                md.endOffsetTop = stack.currentFrame->args.offsetTop;   /* and how many extracts were taken */
-                isMatch = true;
-                RRETURN;
-                
-            /* Assertion brackets. Check the alternative branches in turn - the
-             matching won't pass the KET for an assertion. If any one branch matches,
-             the assertion is true. Lookbehind assertions have an OP_REVERSE item at the
-             start of each branch to move the current point backwards, so the code at
-             this level is identical to the lookahead case. */
-                
-            BEGIN_OPCODE(ASSERT):
-                do {
-                    RECURSIVE_MATCH_NEW_GROUP(6, stack.currentFrame->args.instructionPtr + 1 + LINK_SIZE, NULL);
-                    if (isMatch)
-                        break;
-                    stack.currentFrame->args.instructionPtr += getLinkValue(stack.currentFrame->args.instructionPtr + 1);
-                } while (*stack.currentFrame->args.instructionPtr == OP_ALT);
-                if (*stack.currentFrame->args.instructionPtr == OP_KET)
-                    RRETURN_NO_MATCH;
-                
-                /* Continue from after the assertion, updating the offsets high water
-                 mark, since extracts may have been taken during the assertion. */
-                
-                advanceToEndOfBracket(stack.currentFrame->args.instructionPtr);
-                stack.currentFrame->args.instructionPtr += 1 + LINK_SIZE;
-                stack.currentFrame->args.offsetTop = md.endOffsetTop;
-                NEXT_OPCODE;
-                
-            /* Negative assertion: all branches must fail to match */
-                
-            BEGIN_OPCODE(ASSERT_NOT):
-                do {
-                    RECURSIVE_MATCH_NEW_GROUP(7, stack.currentFrame->args.instructionPtr + 1 + LINK_SIZE, NULL);
-                    if (isMatch)
-                        RRETURN_NO_MATCH;
-                    stack.currentFrame->args.instructionPtr += getLinkValue(stack.currentFrame->args.instructionPtr + 1);
-                } while (*stack.currentFrame->args.instructionPtr == OP_ALT);
-                
-                stack.currentFrame->args.instructionPtr += 1 + LINK_SIZE;
-                NEXT_OPCODE;
-                
-            /* An alternation is the end of a branch; scan along to find the end of the
-             bracketed group and go to there. */
-                
-            BEGIN_OPCODE(ALT):
-                advanceToEndOfBracket(stack.currentFrame->args.instructionPtr);
-                NEXT_OPCODE;
-                
-            /* BRAZERO and BRAMINZERO occur just before a bracket group, indicating
-             that it may occur zero times. It may repeat infinitely, or not at all -
-             i.e. it could be ()* or ()? in the pattern. Brackets with fixed upper
-             repeat limits are compiled as a number of copies, with the optional ones
-             preceded by BRAZERO or BRAMINZERO. */
-                
-            BEGIN_OPCODE(BRAZERO): {
-                stack.currentFrame->locals.startOfRepeatingBracket = stack.currentFrame->args.instructionPtr + 1;
-                RECURSIVE_MATCH_NEW_GROUP(14, stack.currentFrame->locals.startOfRepeatingBracket, stack.currentFrame->args.bracketChain);
-                if (isMatch)
-                    RRETURN;
-                advanceToEndOfBracket(stack.currentFrame->locals.startOfRepeatingBracket);
-                stack.currentFrame->args.instructionPtr = stack.currentFrame->locals.startOfRepeatingBracket + 1 + LINK_SIZE;
-                NEXT_OPCODE;
-            }
-                
-            BEGIN_OPCODE(BRAMINZERO): {
-                stack.currentFrame->locals.startOfRepeatingBracket = stack.currentFrame->args.instructionPtr + 1;
-                advanceToEndOfBracket(stack.currentFrame->locals.startOfRepeatingBracket);
-                RECURSIVE_MATCH_NEW_GROUP(15, stack.currentFrame->locals.startOfRepeatingBracket + 1 + LINK_SIZE, stack.currentFrame->args.bracketChain);
-                if (isMatch)
-                    RRETURN;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-            }
-                
-            /* End of a group, repeated or non-repeating. If we are at the end of
-             an assertion "group", stop matching and return 1, but record the
-             current high water mark for use by positive assertions. Do this also
-             for the "once" (not-backup up) groups. */
-                
-            BEGIN_OPCODE(KET):
-            BEGIN_OPCODE(KETRMIN):
-            BEGIN_OPCODE(KETRMAX):
-                stack.currentFrame->locals.instructionPtrAtStartOfOnce = stack.currentFrame->args.instructionPtr - getLinkValue(stack.currentFrame->args.instructionPtr + 1);
-                stack.currentFrame->locals.subjectPtrAtStartOfInstruction = stack.currentFrame->args.bracketChain->bracketStart;
-
-                /* Back up the stack of bracket start pointers. */
-
-                stack.currentFrame->args.bracketChain = stack.currentFrame->args.bracketChain->previousBracket;
-
-                if (*stack.currentFrame->locals.instructionPtrAtStartOfOnce == OP_ASSERT || *stack.currentFrame->locals.instructionPtrAtStartOfOnce == OP_ASSERT_NOT) {
-                    md.endOffsetTop = stack.currentFrame->args.offsetTop;
-                    isMatch = true;
-                    RRETURN;
-                }
-                
-                /* In all other cases except a conditional group we have to check the
-                 group number back at the start and if necessary complete handling an
-                 extraction by setting the offsets and bumping the high water mark. */
-                
-                stack.currentFrame->locals.number = *stack.currentFrame->locals.instructionPtrAtStartOfOnce - OP_BRA;
-                
-                /* For extended extraction brackets (large number), we have to fish out
-                 the number from a dummy opcode at the start. */
-                
-                if (stack.currentFrame->locals.number > EXTRACT_BASIC_MAX)
-                    stack.currentFrame->locals.number = get2ByteValue(stack.currentFrame->locals.instructionPtrAtStartOfOnce + 2 + LINK_SIZE);
-                stack.currentFrame->locals.offset = stack.currentFrame->locals.number << 1;
-                
-#ifdef DEBUG
-                printf("end bracket %d", stack.currentFrame->locals.number);
-                printf("\n");
-#endif
-                
-                /* Test for a numbered group. This includes groups called as a result
-                 of recursion. Note that whole-pattern recursion is coded as a recurse
-                 into group 0, so it won't be picked up here. Instead, we catch it when
-                 the OP_END is reached. */
-                
-                if (stack.currentFrame->locals.number > 0) {
-                    if (stack.currentFrame->locals.offset >= md.offsetMax)
-                        md.offsetOverflow = true;
-                    else {
-                        md.offsetVector[stack.currentFrame->locals.offset] =
-                        md.offsetVector[md.offsetEnd - stack.currentFrame->locals.number];
-                        md.offsetVector[stack.currentFrame->locals.offset+1] = stack.currentFrame->args.subjectPtr - md.startSubject;
-                        if (stack.currentFrame->args.offsetTop <= stack.currentFrame->locals.offset)
-                            stack.currentFrame->args.offsetTop = stack.currentFrame->locals.offset + 2;
-                    }
-                }
-                
-                /* For a non-repeating ket, just continue at this level. This also
-                 happens for a repeating ket if no characters were matched in the group.
-                 This is the forcible breaking of infinite loops as implemented in Perl
-                 5.005. If there is an options reset, it will get obeyed in the normal
-                 course of events. */
-                
-                if (*stack.currentFrame->args.instructionPtr == OP_KET || stack.currentFrame->args.subjectPtr == stack.currentFrame->locals.subjectPtrAtStartOfInstruction) {
-                    stack.currentFrame->args.instructionPtr += 1 + LINK_SIZE;
-                    NEXT_OPCODE;
-                }
-                
-                /* The repeating kets try the rest of the pattern or restart from the
-                 preceding bracket, in the appropriate order. */
-                
-                if (*stack.currentFrame->args.instructionPtr == OP_KETRMIN) {
-                    RECURSIVE_MATCH(16, stack.currentFrame->args.instructionPtr + 1 + LINK_SIZE, stack.currentFrame->args.bracketChain);
-                    if (isMatch)
-                        RRETURN;
-                    RECURSIVE_MATCH_NEW_GROUP(17, stack.currentFrame->locals.instructionPtrAtStartOfOnce, stack.currentFrame->args.bracketChain);
-                    if (isMatch)
-                        RRETURN;
-                } else { /* OP_KETRMAX */
-                    RECURSIVE_MATCH_NEW_GROUP(18, stack.currentFrame->locals.instructionPtrAtStartOfOnce, stack.currentFrame->args.bracketChain);
-                    if (isMatch)
-                        RRETURN;
-                    RECURSIVE_MATCH(19, stack.currentFrame->args.instructionPtr + 1 + LINK_SIZE, stack.currentFrame->args.bracketChain);
-                    if (isMatch)
-                        RRETURN;
-                }
-                RRETURN;
-                
-            /* Start of subject. */
-
-            BEGIN_OPCODE(CIRC):
-                if (stack.currentFrame->args.subjectPtr != md.startSubject)
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-
-            /* After internal newline if multiline. */
-
-            BEGIN_OPCODE(BOL):
-                if (stack.currentFrame->args.subjectPtr != md.startSubject && !isNewline(stack.currentFrame->args.subjectPtr[-1]))
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-
-            /* End of subject. */
-
-            BEGIN_OPCODE(DOLL):
-                if (stack.currentFrame->args.subjectPtr < md.endSubject)
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-
-            /* Before internal newline if multiline. */
-
-            BEGIN_OPCODE(EOL):
-                if (stack.currentFrame->args.subjectPtr < md.endSubject && !isNewline(*stack.currentFrame->args.subjectPtr))
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-                
-            /* Word boundary assertions */
-                
-            BEGIN_OPCODE(NOT_WORD_BOUNDARY):
-            BEGIN_OPCODE(WORD_BOUNDARY): {
-                bool currentCharIsWordChar = false;
-                bool previousCharIsWordChar = false;
-                
-                if (stack.currentFrame->args.subjectPtr > md.startSubject)
-                    previousCharIsWordChar = isWordChar(stack.currentFrame->args.subjectPtr[-1]);
-                if (stack.currentFrame->args.subjectPtr < md.endSubject)
-                    currentCharIsWordChar = isWordChar(*stack.currentFrame->args.subjectPtr);
-                
-                /* Now see if the situation is what we want */
-                bool wordBoundaryDesired = (*stack.currentFrame->args.instructionPtr++ == OP_WORD_BOUNDARY);
-                if (wordBoundaryDesired ? currentCharIsWordChar == previousCharIsWordChar : currentCharIsWordChar != previousCharIsWordChar)
-                    RRETURN_NO_MATCH;
-                NEXT_OPCODE;
-            }
-                
-            /* Match a single character type; inline for speed */
-                
-            BEGIN_OPCODE(NOT_NEWLINE):
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                if (isNewline(*stack.currentFrame->args.subjectPtr++))
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-
-            BEGIN_OPCODE(NOT_DIGIT):
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                if (isASCIIDigit(*stack.currentFrame->args.subjectPtr++))
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-
-            BEGIN_OPCODE(DIGIT):
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                if (!isASCIIDigit(*stack.currentFrame->args.subjectPtr++))
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-
-            BEGIN_OPCODE(NOT_WHITESPACE):
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                if (isSpaceChar(*stack.currentFrame->args.subjectPtr++))
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-
-            BEGIN_OPCODE(WHITESPACE):
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                if (!isSpaceChar(*stack.currentFrame->args.subjectPtr++))
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-                
-            BEGIN_OPCODE(NOT_WORDCHAR):
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                if (isWordChar(*stack.currentFrame->args.subjectPtr++))
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-                
-            BEGIN_OPCODE(WORDCHAR):
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                if (!isWordChar(*stack.currentFrame->args.subjectPtr++))
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr++;
-                NEXT_OPCODE;
-                
-            /* Match a back reference, possibly repeatedly. Look past the end of the
-             item to see if there is repeat information following. The code is similar
-             to that for character classes, but repeated for efficiency. Then obey
-             similar code to character type repeats - written out again for speed.
-             However, if the referenced string is the empty string, always treat
-             it as matched, any number of times (otherwise there could be infinite
-             loops). */
-                
-            BEGIN_OPCODE(REF):
-                stack.currentFrame->locals.offset = get2ByteValue(stack.currentFrame->args.instructionPtr + 1) << 1;               /* Doubled ref number */
-                stack.currentFrame->args.instructionPtr += 3;                                 /* Advance past item */
-                
-                /* If the reference is unset, set the length to be longer than the amount
-                 of subject left; this ensures that every attempt at a match fails. We
-                 can't just fail here, because of the possibility of quantifiers with zero
-                 minima. */
-                
-                if (stack.currentFrame->locals.offset >= stack.currentFrame->args.offsetTop || md.offsetVector[stack.currentFrame->locals.offset] < 0)
-                    stack.currentFrame->locals.length = 0;
-                else
-                    stack.currentFrame->locals.length = md.offsetVector[stack.currentFrame->locals.offset+1] - md.offsetVector[stack.currentFrame->locals.offset];
-                
-                /* Set up for repetition, or handle the non-repeated case */
-                
-                switch (*stack.currentFrame->args.instructionPtr) {
-                    case OP_CRSTAR:
-                    case OP_CRMINSTAR:
-                    case OP_CRPLUS:
-                    case OP_CRMINPLUS:
-                    case OP_CRQUERY:
-                    case OP_CRMINQUERY:
-                        repeatInformationFromInstructionOffset(*stack.currentFrame->args.instructionPtr++ - OP_CRSTAR, minimize, min, stack.currentFrame->locals.max);
-                        break;
-                        
-                    case OP_CRRANGE:
-                    case OP_CRMINRANGE:
-                        minimize = (*stack.currentFrame->args.instructionPtr == OP_CRMINRANGE);
-                        min = get2ByteValue(stack.currentFrame->args.instructionPtr + 1);
-                        stack.currentFrame->locals.max = get2ByteValue(stack.currentFrame->args.instructionPtr + 3);
-                        if (stack.currentFrame->locals.max == 0)
-                            stack.currentFrame->locals.max = INT_MAX;
-                        stack.currentFrame->args.instructionPtr += 5;
-                        break;
-                    
-                    default:               /* No repeat follows */
-                        if (!matchRef(stack.currentFrame->locals.offset, stack.currentFrame->args.subjectPtr, stack.currentFrame->locals.length, md))
-                            RRETURN_NO_MATCH;
-                        stack.currentFrame->args.subjectPtr += stack.currentFrame->locals.length;
-                        NEXT_OPCODE;
-                }
-                
-                /* If the length of the reference is zero, just continue with the
-                 main loop. */
-                
-                if (stack.currentFrame->locals.length == 0)
-                    NEXT_OPCODE;
-                
-                /* First, ensure the minimum number of matches are present. */
-                
-                for (int i = 1; i <= min; i++) {
-                    if (!matchRef(stack.currentFrame->locals.offset, stack.currentFrame->args.subjectPtr, stack.currentFrame->locals.length, md))
-                        RRETURN_NO_MATCH;
-                    stack.currentFrame->args.subjectPtr += stack.currentFrame->locals.length;
-                }
-                
-                /* If min = max, continue at the same level without recursion.
-                 They are not both allowed to be zero. */
-                
-                if (min == stack.currentFrame->locals.max)
-                    NEXT_OPCODE;
-                
-                /* If minimizing, keep trying and advancing the pointer */
-                
-                if (minimize) {
-                    for (stack.currentFrame->locals.fi = min;; stack.currentFrame->locals.fi++) {
-                        RECURSIVE_MATCH(20, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                        if (isMatch)
-                            RRETURN;
-                        if (stack.currentFrame->locals.fi >= stack.currentFrame->locals.max || !matchRef(stack.currentFrame->locals.offset, stack.currentFrame->args.subjectPtr, stack.currentFrame->locals.length, md))
-                            RRETURN;
-                        stack.currentFrame->args.subjectPtr += stack.currentFrame->locals.length;
-                    }
-                    /* Control never reaches here */
-                }
-                
-                /* If maximizing, find the longest string and work backwards */
-                
-                else {
-                    stack.currentFrame->locals.subjectPtrAtStartOfInstruction = stack.currentFrame->args.subjectPtr;
-                    for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                        if (!matchRef(stack.currentFrame->locals.offset, stack.currentFrame->args.subjectPtr, stack.currentFrame->locals.length, md))
-                            break;
-                        stack.currentFrame->args.subjectPtr += stack.currentFrame->locals.length;
-                    }
-                    while (stack.currentFrame->args.subjectPtr >= stack.currentFrame->locals.subjectPtrAtStartOfInstruction) {
-                        RECURSIVE_MATCH(21, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                        if (isMatch)
-                            RRETURN;
-                        stack.currentFrame->args.subjectPtr -= stack.currentFrame->locals.length;
-                    }
-                    RRETURN_NO_MATCH;
-                }
-                /* Control never reaches here */
-                
-            /* Match a bit-mapped character class, possibly repeatedly. This op code is
-             used when all the characters in the class have values in the range 0-255,
-             and either the matching is caseful, or the characters are in the range
-             0-127 when UTF-8 processing is enabled. The only difference between
-             OP_CLASS and OP_NCLASS occurs when a data character outside the range is
-             encountered.
-             
-             First, look past the end of the item to see if there is repeat information
-             following. Then obey similar code to character type repeats - written out
-             again for speed. */
-                
-            BEGIN_OPCODE(NCLASS):
-            BEGIN_OPCODE(CLASS):
-                stack.currentFrame->locals.data = stack.currentFrame->args.instructionPtr + 1;                /* Save for matching */
-                stack.currentFrame->args.instructionPtr += 33;                     /* Advance past the item */
-                
-                switch (*stack.currentFrame->args.instructionPtr) {
-                    case OP_CRSTAR:
-                    case OP_CRMINSTAR:
-                    case OP_CRPLUS:
-                    case OP_CRMINPLUS:
-                    case OP_CRQUERY:
-                    case OP_CRMINQUERY:
-                        repeatInformationFromInstructionOffset(*stack.currentFrame->args.instructionPtr++ - OP_CRSTAR, minimize, min, stack.currentFrame->locals.max);
-                        break;
-                        
-                    case OP_CRRANGE:
-                    case OP_CRMINRANGE:
-                        minimize = (*stack.currentFrame->args.instructionPtr == OP_CRMINRANGE);
-                        min = get2ByteValue(stack.currentFrame->args.instructionPtr + 1);
-                        stack.currentFrame->locals.max = get2ByteValue(stack.currentFrame->args.instructionPtr + 3);
-                        if (stack.currentFrame->locals.max == 0)
-                            stack.currentFrame->locals.max = INT_MAX;
-                        stack.currentFrame->args.instructionPtr += 5;
-                        break;
-                        
-                    default:               /* No repeat follows */
-                        min = stack.currentFrame->locals.max = 1;
-                        break;
-                }
-                
-                /* First, ensure the minimum number of matches are present. */
-                
-                for (int i = 1; i <= min; i++) {
-                    if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                        RRETURN_NO_MATCH;
-                    int c = *stack.currentFrame->args.subjectPtr++;
-                    if (c > 255) {
-                        if (stack.currentFrame->locals.data[-1] == OP_CLASS)
-                            RRETURN_NO_MATCH;
-                    } else {
-                        if (!(stack.currentFrame->locals.data[c / 8] & (1 << (c & 7))))
-                            RRETURN_NO_MATCH;
-                    }
-                }
-                
-                /* If max == min we can continue with the main loop without the
-                 need to recurse. */
-                
-                if (min == stack.currentFrame->locals.max)
-                    NEXT_OPCODE;      
-                
-                /* If minimizing, keep testing the rest of the expression and advancing
-                 the pointer while it matches the class. */
-                if (minimize) {
-                    for (stack.currentFrame->locals.fi = min;; stack.currentFrame->locals.fi++) {
-                        RECURSIVE_MATCH(22, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                        if (isMatch)
-                            RRETURN;
-                        if (stack.currentFrame->locals.fi >= stack.currentFrame->locals.max || stack.currentFrame->args.subjectPtr >= md.endSubject)
-                            RRETURN;
-                        int c = *stack.currentFrame->args.subjectPtr++;
-                        if (c > 255) {
-                            if (stack.currentFrame->locals.data[-1] == OP_CLASS)
-                                RRETURN;
-                        } else {
-                            if ((stack.currentFrame->locals.data[c/8] & (1 << (c&7))) == 0)
-                                RRETURN;
-                        }
-                    }
-                    /* Control never reaches here */
-                }
-                /* If maximizing, find the longest possible run, then work backwards. */
-                else {
-                    stack.currentFrame->locals.subjectPtrAtStartOfInstruction = stack.currentFrame->args.subjectPtr;
-                    
-                    for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                        if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                            break;
-                        int c = *stack.currentFrame->args.subjectPtr;
-                        if (c > 255) {
-                            if (stack.currentFrame->locals.data[-1] == OP_CLASS)
-                                break;
-                        } else {
-                            if (!(stack.currentFrame->locals.data[c / 8] & (1 << (c & 7))))
-                                break;
-                        }
-                        ++stack.currentFrame->args.subjectPtr;
-                    }
-                    for (;;) {
-                        RECURSIVE_MATCH(24, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                        if (isMatch)
-                            RRETURN;
-                        if (stack.currentFrame->args.subjectPtr-- == stack.currentFrame->locals.subjectPtrAtStartOfInstruction)
-                            break;        /* Stop if tried at original pos */
-                    }
-                    
-                    RRETURN;
-                }
-                /* Control never reaches here */
-                
-            /* Match an extended character class. */
-                
-            BEGIN_OPCODE(XCLASS):
-                stack.currentFrame->locals.data = stack.currentFrame->args.instructionPtr + 1 + LINK_SIZE;                /* Save for matching */
-                stack.currentFrame->args.instructionPtr += getLinkValue(stack.currentFrame->args.instructionPtr + 1);                      /* Advance past the item */
-                
-                switch (*stack.currentFrame->args.instructionPtr) {
-                    case OP_CRSTAR:
-                    case OP_CRMINSTAR:
-                    case OP_CRPLUS:
-                    case OP_CRMINPLUS:
-                    case OP_CRQUERY:
-                    case OP_CRMINQUERY:
-                        repeatInformationFromInstructionOffset(*stack.currentFrame->args.instructionPtr++ - OP_CRSTAR, minimize, min, stack.currentFrame->locals.max);
-                        break;
-                        
-                    case OP_CRRANGE:
-                    case OP_CRMINRANGE:
-                        minimize = (*stack.currentFrame->args.instructionPtr == OP_CRMINRANGE);
-                        min = get2ByteValue(stack.currentFrame->args.instructionPtr + 1);
-                        stack.currentFrame->locals.max = get2ByteValue(stack.currentFrame->args.instructionPtr + 3);
-                        if (stack.currentFrame->locals.max == 0)
-                            stack.currentFrame->locals.max = INT_MAX;
-                        stack.currentFrame->args.instructionPtr += 5;
-                        break;
-                        
-                    default:               /* No repeat follows */
-                        min = stack.currentFrame->locals.max = 1;
-                }
-                
-                /* First, ensure the minimum number of matches are present. */
-                
-                for (int i = 1; i <= min; i++) {
-                    if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                        RRETURN_NO_MATCH;
-                    int c = *stack.currentFrame->args.subjectPtr++;
-                    if (!jsc_pcre_xclass(c, stack.currentFrame->locals.data))
-                        RRETURN_NO_MATCH;
-                }
-                
-                /* If max == min we can continue with the main loop without the
-                 need to recurse. */
-                
-                if (min == stack.currentFrame->locals.max)
-                    NEXT_OPCODE;
-                
-                /* If minimizing, keep testing the rest of the expression and advancing
-                 the pointer while it matches the class. */
-                
-                if (minimize) {
-                    for (stack.currentFrame->locals.fi = min;; stack.currentFrame->locals.fi++) {
-                        RECURSIVE_MATCH(26, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                        if (isMatch)
-                            RRETURN;
-                        if (stack.currentFrame->locals.fi >= stack.currentFrame->locals.max || stack.currentFrame->args.subjectPtr >= md.endSubject)
-                            RRETURN;
-                        int c = *stack.currentFrame->args.subjectPtr++;
-                        if (!jsc_pcre_xclass(c, stack.currentFrame->locals.data))
-                            RRETURN;
-                    }
-                    /* Control never reaches here */
-                }
-                
-                /* If maximizing, find the longest possible run, then work backwards. */
-                
-                else {
-                    stack.currentFrame->locals.subjectPtrAtStartOfInstruction = stack.currentFrame->args.subjectPtr;
-                    for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                        if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                            break;
-                        int c = *stack.currentFrame->args.subjectPtr;
-                        if (!jsc_pcre_xclass(c, stack.currentFrame->locals.data))
-                            break;
-                        ++stack.currentFrame->args.subjectPtr;
-                    }
-                    for(;;) {
-                        RECURSIVE_MATCH(27, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                        if (isMatch)
-                            RRETURN;
-                        if (stack.currentFrame->args.subjectPtr-- == stack.currentFrame->locals.subjectPtrAtStartOfInstruction)
-                            break;        /* Stop if tried at original pos */
-                    }
-                    RRETURN;
-                }
-                
-                /* Control never reaches here */
-                
-            /* Match a single character, casefully */
-                
-            BEGIN_OPCODE(CHAR):
-                stack.currentFrame->locals.length = 1;
-                stack.currentFrame->args.instructionPtr++;
-                getUTF8CharAndIncrementLength(stack.currentFrame->locals.fc, stack.currentFrame->args.instructionPtr, stack.currentFrame->locals.length);
-                stack.currentFrame->args.instructionPtr += stack.currentFrame->locals.length;
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                if (stack.currentFrame->locals.fc != *stack.currentFrame->args.subjectPtr++)
-                    RRETURN_NO_MATCH;
-                NEXT_OPCODE;
-                
-            /* Match a single character, caselessly */
-                
-            BEGIN_OPCODE(CHAR_IGNORING_CASE): {
-                stack.currentFrame->locals.length = 1;
-                stack.currentFrame->args.instructionPtr++;
-                getUTF8CharAndIncrementLength(stack.currentFrame->locals.fc, stack.currentFrame->args.instructionPtr, stack.currentFrame->locals.length);
-                stack.currentFrame->args.instructionPtr += stack.currentFrame->locals.length;
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                int dc = *stack.currentFrame->args.subjectPtr++;
-                if (stack.currentFrame->locals.fc != dc && jsc_pcre_ucp_othercase(stack.currentFrame->locals.fc) != dc)
-                    RRETURN_NO_MATCH;
-                NEXT_OPCODE;
-            }
-                
-            /* Match a single ASCII character. */
-                
-            BEGIN_OPCODE(ASCII_CHAR):
-                if (md.endSubject == stack.currentFrame->args.subjectPtr)
-                    RRETURN_NO_MATCH;
-                if (*stack.currentFrame->args.subjectPtr != stack.currentFrame->args.instructionPtr[1])
-                    RRETURN_NO_MATCH;
-                ++stack.currentFrame->args.subjectPtr;
-                stack.currentFrame->args.instructionPtr += 2;
-                NEXT_OPCODE;
-                
-            /* Match one of two cases of an ASCII letter. */
-                
-            BEGIN_OPCODE(ASCII_LETTER_IGNORING_CASE):
-                if (md.endSubject == stack.currentFrame->args.subjectPtr)
-                    RRETURN_NO_MATCH;
-                if ((*stack.currentFrame->args.subjectPtr | 0x20) != stack.currentFrame->args.instructionPtr[1])
-                    RRETURN_NO_MATCH;
-                ++stack.currentFrame->args.subjectPtr;
-                stack.currentFrame->args.instructionPtr += 2;
-                NEXT_OPCODE;
-                
-            /* Match a single character repeatedly; different opcodes share code. */
-                
-            BEGIN_OPCODE(EXACT):
-                min = stack.currentFrame->locals.max = get2ByteValue(stack.currentFrame->args.instructionPtr + 1);
-                minimize = false;
-                stack.currentFrame->args.instructionPtr += 3;
-                goto REPEATCHAR;
-                
-            BEGIN_OPCODE(UPTO):
-            BEGIN_OPCODE(MINUPTO):
-                min = 0;
-                stack.currentFrame->locals.max = get2ByteValue(stack.currentFrame->args.instructionPtr + 1);
-                minimize = *stack.currentFrame->args.instructionPtr == OP_MINUPTO;
-                stack.currentFrame->args.instructionPtr += 3;
-                goto REPEATCHAR;
-                
-            BEGIN_OPCODE(STAR):
-            BEGIN_OPCODE(MINSTAR):
-            BEGIN_OPCODE(PLUS):
-            BEGIN_OPCODE(MINPLUS):
-            BEGIN_OPCODE(QUERY):
-            BEGIN_OPCODE(MINQUERY):
-                repeatInformationFromInstructionOffset(*stack.currentFrame->args.instructionPtr++ - OP_STAR, minimize, min, stack.currentFrame->locals.max);
-                
-                /* Common code for all repeated single-character matches. We can give
-                 up quickly if there are fewer than the minimum number of characters left in
-                 the subject. */
-                
-            REPEATCHAR:
-                
-                stack.currentFrame->locals.length = 1;
-                getUTF8CharAndIncrementLength(stack.currentFrame->locals.fc, stack.currentFrame->args.instructionPtr, stack.currentFrame->locals.length);
-                if (min * (stack.currentFrame->locals.fc > 0xFFFF ? 2 : 1) > md.endSubject - stack.currentFrame->args.subjectPtr)
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->args.instructionPtr += stack.currentFrame->locals.length;
-                
-                if (stack.currentFrame->locals.fc <= 0xFFFF) {
-                    othercase = md.ignoreCase ? jsc_pcre_ucp_othercase(stack.currentFrame->locals.fc) : -1;
-                    
-                    for (int i = 1; i <= min; i++) {
-                        if (*stack.currentFrame->args.subjectPtr != stack.currentFrame->locals.fc && *stack.currentFrame->args.subjectPtr != othercase)
-                            RRETURN_NO_MATCH;
-                        ++stack.currentFrame->args.subjectPtr;
-                    }
-                    
-                    if (min == stack.currentFrame->locals.max)
-                        NEXT_OPCODE;
-                    
-                    if (minimize) {
-                        stack.currentFrame->locals.repeatOthercase = othercase;
-                        for (stack.currentFrame->locals.fi = min;; stack.currentFrame->locals.fi++) {
-                            RECURSIVE_MATCH(28, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                            if (isMatch)
-                                RRETURN;
-                            if (stack.currentFrame->locals.fi >= stack.currentFrame->locals.max || stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                RRETURN;
-                            if (*stack.currentFrame->args.subjectPtr != stack.currentFrame->locals.fc && *stack.currentFrame->args.subjectPtr != stack.currentFrame->locals.repeatOthercase)
-                                RRETURN;
-                            ++stack.currentFrame->args.subjectPtr;
-                        }
-                        /* Control never reaches here */
-                    } else {
-                        stack.currentFrame->locals.subjectPtrAtStartOfInstruction = stack.currentFrame->args.subjectPtr;
-                        for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                            if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                break;
-                            if (*stack.currentFrame->args.subjectPtr != stack.currentFrame->locals.fc && *stack.currentFrame->args.subjectPtr != othercase)
-                                break;
-                            ++stack.currentFrame->args.subjectPtr;
-                        }
-                        while (stack.currentFrame->args.subjectPtr >= stack.currentFrame->locals.subjectPtrAtStartOfInstruction) {
-                            RECURSIVE_MATCH(29, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                            if (isMatch)
-                                RRETURN;
-                            --stack.currentFrame->args.subjectPtr;
-                        }
-                        RRETURN_NO_MATCH;
-                    }
-                    /* Control never reaches here */
-                } else {
-                    /* No case on surrogate pairs, so no need to bother with "othercase". */
-                    
-                    for (int i = 1; i <= min; i++) {
-                        if (*stack.currentFrame->args.subjectPtr != stack.currentFrame->locals.fc)
-                            RRETURN_NO_MATCH;
-                        stack.currentFrame->args.subjectPtr += 2;
-                    }
-                    
-                    if (min == stack.currentFrame->locals.max)
-                        NEXT_OPCODE;
-                    
-                    if (minimize) {
-                        for (stack.currentFrame->locals.fi = min;; stack.currentFrame->locals.fi++) {
-                            RECURSIVE_MATCH(30, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                            if (isMatch)
-                                RRETURN;
-                            if (stack.currentFrame->locals.fi >= stack.currentFrame->locals.max || stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                RRETURN;
-                            if (*stack.currentFrame->args.subjectPtr != stack.currentFrame->locals.fc)
-                                RRETURN;
-                            stack.currentFrame->args.subjectPtr += 2;
-                        }
-                        /* Control never reaches here */
-                    } else {
-                        stack.currentFrame->locals.subjectPtrAtStartOfInstruction = stack.currentFrame->args.subjectPtr;
-                        for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                            if (stack.currentFrame->args.subjectPtr > md.endSubject - 2)
-                                break;
-                            if (*stack.currentFrame->args.subjectPtr != stack.currentFrame->locals.fc)
-                                break;
-                            stack.currentFrame->args.subjectPtr += 2;
-                        }
-                        while (stack.currentFrame->args.subjectPtr >= stack.currentFrame->locals.subjectPtrAtStartOfInstruction) {
-                            RECURSIVE_MATCH(31, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                            if (isMatch)
-                                RRETURN;
-                            stack.currentFrame->args.subjectPtr -= 2;
-                        }
-                        RRETURN_NO_MATCH;
-                    }
-                    /* Control never reaches here */
-                }
-                /* Control never reaches here */
-                
-            /* Match a negated single one-byte character. */
-                
-            BEGIN_OPCODE(NOT): {
-                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                    RRETURN_NO_MATCH;
-                int b = stack.currentFrame->args.instructionPtr[1];
-                int c = *stack.currentFrame->args.subjectPtr++;
-                stack.currentFrame->args.instructionPtr += 2;
-                if (md.ignoreCase) {
-                    if (c < 128)
-                        c = toLowerCase(c);
-                    if (toLowerCase(b) == c)
-                        RRETURN_NO_MATCH;
-                } else {
-                    if (b == c)
-                        RRETURN_NO_MATCH;
-                }
-                NEXT_OPCODE;
-            }
-                
-            /* Match a negated single one-byte character repeatedly. This is almost a
-             repeat of the code for a repeated single character, but I haven't found a
-             nice way of commoning these up that doesn't require a test of the
-             positive/negative option for each character match. Maybe that wouldn't add
-             very much to the time taken, but character matching *is* what this is all
-             about... */
-                
-            BEGIN_OPCODE(NOTEXACT):
-                min = stack.currentFrame->locals.max = get2ByteValue(stack.currentFrame->args.instructionPtr + 1);
-                minimize = false;
-                stack.currentFrame->args.instructionPtr += 3;
-                goto REPEATNOTCHAR;
-                
-            BEGIN_OPCODE(NOTUPTO):
-            BEGIN_OPCODE(NOTMINUPTO):
-                min = 0;
-                stack.currentFrame->locals.max = get2ByteValue(stack.currentFrame->args.instructionPtr + 1);
-                minimize = *stack.currentFrame->args.instructionPtr == OP_NOTMINUPTO;
-                stack.currentFrame->args.instructionPtr += 3;
-                goto REPEATNOTCHAR;
-                
-            BEGIN_OPCODE(NOTSTAR):
-            BEGIN_OPCODE(NOTMINSTAR):
-            BEGIN_OPCODE(NOTPLUS):
-            BEGIN_OPCODE(NOTMINPLUS):
-            BEGIN_OPCODE(NOTQUERY):
-            BEGIN_OPCODE(NOTMINQUERY):
-                repeatInformationFromInstructionOffset(*stack.currentFrame->args.instructionPtr++ - OP_NOTSTAR, minimize, min, stack.currentFrame->locals.max);
-                
-            /* Common code for all repeated single-byte matches. We can give up quickly
-             if there are fewer than the minimum number of bytes left in the
-             subject. */
-                
-            REPEATNOTCHAR:
-                if (min > md.endSubject - stack.currentFrame->args.subjectPtr)
-                    RRETURN_NO_MATCH;
-                stack.currentFrame->locals.fc = *stack.currentFrame->args.instructionPtr++;
-                
-                /* The code is duplicated for the caseless and caseful cases, for speed,
-                 since matching characters is likely to be quite common. First, ensure the
-                 minimum number of matches are present. If min = max, continue at the same
-                 level without recursing. Otherwise, if minimizing, keep trying the rest of
-                 the expression and advancing one matching character if failing, up to the
-                 maximum. Alternatively, if maximizing, find the maximum number of
-                 characters and work backwards. */
-                
-                DPRINTF(("negative matching %c{%d,%d}\n", stack.currentFrame->locals.fc, min, stack.currentFrame->locals.max));
-                
-                if (md.ignoreCase) {
-                    if (stack.currentFrame->locals.fc < 128)
-                        stack.currentFrame->locals.fc = toLowerCase(stack.currentFrame->locals.fc);
-                    
-                    for (int i = 1; i <= min; i++) {
-                        int d = *stack.currentFrame->args.subjectPtr++;
-                        if (d < 128)
-                            d = toLowerCase(d);
-                        if (stack.currentFrame->locals.fc == d)
-                            RRETURN_NO_MATCH;
-                    }
-                    
-                    if (min == stack.currentFrame->locals.max)
-                        NEXT_OPCODE;      
-                    
-                    if (minimize) {
-                        for (stack.currentFrame->locals.fi = min;; stack.currentFrame->locals.fi++) {
-                            RECURSIVE_MATCH(38, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                            if (isMatch)
-                                RRETURN;
-                            int d = *stack.currentFrame->args.subjectPtr++;
-                            if (d < 128)
-                                d = toLowerCase(d);
-                            if (stack.currentFrame->locals.fi >= stack.currentFrame->locals.max || stack.currentFrame->args.subjectPtr >= md.endSubject || stack.currentFrame->locals.fc == d)
-                                RRETURN;
-                        }
-                        /* Control never reaches here */
-                    }
-                    
-                    /* Maximize case */
-                    
-                    else {
-                        stack.currentFrame->locals.subjectPtrAtStartOfInstruction = stack.currentFrame->args.subjectPtr;
-                        
-                        for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                            if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                break;
-                            int d = *stack.currentFrame->args.subjectPtr;
-                            if (d < 128)
-                                d = toLowerCase(d);
-                            if (stack.currentFrame->locals.fc == d)
-                                break;
-                            ++stack.currentFrame->args.subjectPtr;
-                        }
-                        for (;;) {
-                            RECURSIVE_MATCH(40, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                            if (isMatch)
-                                RRETURN;
-                            if (stack.currentFrame->args.subjectPtr-- == stack.currentFrame->locals.subjectPtrAtStartOfInstruction)
-                                break;        /* Stop if tried at original pos */
-                        }
-                        
-                        RRETURN;
-                    }
-                    /* Control never reaches here */
-                }
-                
-                /* Caseful comparisons */
-                
-                else {
-                    for (int i = 1; i <= min; i++) {
-                        int d = *stack.currentFrame->args.subjectPtr++;
-                        if (stack.currentFrame->locals.fc == d)
-                            RRETURN_NO_MATCH;
-                    }
-
-                    if (min == stack.currentFrame->locals.max)
-                        NEXT_OPCODE;
-                    
-                    if (minimize) {
-                        for (stack.currentFrame->locals.fi = min;; stack.currentFrame->locals.fi++) {
-                            RECURSIVE_MATCH(42, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                            if (isMatch)
-                                RRETURN;
-                            int d = *stack.currentFrame->args.subjectPtr++;
-                            if (stack.currentFrame->locals.fi >= stack.currentFrame->locals.max || stack.currentFrame->args.subjectPtr >= md.endSubject || stack.currentFrame->locals.fc == d)
-                                RRETURN;
-                        }
-                        /* Control never reaches here */
-                    }
-                    
-                    /* Maximize case */
-                    
-                    else {
-                        stack.currentFrame->locals.subjectPtrAtStartOfInstruction = stack.currentFrame->args.subjectPtr;
-                        
-                        for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                            if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                break;
-                            int d = *stack.currentFrame->args.subjectPtr;
-                            if (stack.currentFrame->locals.fc == d)
-                                break;
-                            ++stack.currentFrame->args.subjectPtr;
-                        }
-                        for (;;) {
-                            RECURSIVE_MATCH(44, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                            if (isMatch)
-                                RRETURN;
-                            if (stack.currentFrame->args.subjectPtr-- == stack.currentFrame->locals.subjectPtrAtStartOfInstruction)
-                                break;        /* Stop if tried at original pos */
-                        }
-
-                        RRETURN;
-                    }
-                }
-                /* Control never reaches here */
-                
-            /* Match a single character type repeatedly; several different opcodes
-             share code. This is very similar to the code for single characters, but we
-             repeat it in the interests of efficiency. */
-                
-            BEGIN_OPCODE(TYPEEXACT):
-                min = stack.currentFrame->locals.max = get2ByteValue(stack.currentFrame->args.instructionPtr + 1);
-                minimize = true;
-                stack.currentFrame->args.instructionPtr += 3;
-                goto REPEATTYPE;
-                
-            BEGIN_OPCODE(TYPEUPTO):
-            BEGIN_OPCODE(TYPEMINUPTO):
-                min = 0;
-                stack.currentFrame->locals.max = get2ByteValue(stack.currentFrame->args.instructionPtr + 1);
-                minimize = *stack.currentFrame->args.instructionPtr == OP_TYPEMINUPTO;
-                stack.currentFrame->args.instructionPtr += 3;
-                goto REPEATTYPE;
-                
-            BEGIN_OPCODE(TYPESTAR):
-            BEGIN_OPCODE(TYPEMINSTAR):
-            BEGIN_OPCODE(TYPEPLUS):
-            BEGIN_OPCODE(TYPEMINPLUS):
-            BEGIN_OPCODE(TYPEQUERY):
-            BEGIN_OPCODE(TYPEMINQUERY):
-                repeatInformationFromInstructionOffset(*stack.currentFrame->args.instructionPtr++ - OP_TYPESTAR, minimize, min, stack.currentFrame->locals.max);
-                
-                /* Common code for all repeated single character type matches. Note that
-                 in UTF-8 mode, '.' matches a character of any length, but for the other
-                 character types, the valid characters are all one-byte long. */
-                
-            REPEATTYPE:
-                stack.currentFrame->locals.ctype = *stack.currentFrame->args.instructionPtr++;      /* Code for the character type */
-                
-                /* First, ensure the minimum number of matches are present. Use inline
-                 code for maximizing the speed, and do the type test once at the start
-                 (i.e. keep it out of the loop). Also we can test that there are at least
-                 the minimum number of characters before we start. */
-                
-                if (min > md.endSubject - stack.currentFrame->args.subjectPtr)
-                    RRETURN_NO_MATCH;
-                if (min > 0) {
-                    switch (stack.currentFrame->locals.ctype) {
-                        case OP_NOT_NEWLINE:
-                            for (int i = 1; i <= min; i++) {
-                                if (isNewline(*stack.currentFrame->args.subjectPtr))
-                                    RRETURN_NO_MATCH;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_NOT_DIGIT:
-                            for (int i = 1; i <= min; i++) {
-                                if (isASCIIDigit(*stack.currentFrame->args.subjectPtr))
-                                    RRETURN_NO_MATCH;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_DIGIT:
-                            for (int i = 1; i <= min; i++) {
-                                if (!isASCIIDigit(*stack.currentFrame->args.subjectPtr))
-                                    RRETURN_NO_MATCH;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_NOT_WHITESPACE:
-                            for (int i = 1; i <= min; i++) {
-                                if (isSpaceChar(*stack.currentFrame->args.subjectPtr))
-                                    RRETURN_NO_MATCH;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_WHITESPACE:
-                            for (int i = 1; i <= min; i++) {
-                                if (!isSpaceChar(*stack.currentFrame->args.subjectPtr))
-                                    RRETURN_NO_MATCH;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_NOT_WORDCHAR:
-                            for (int i = 1; i <= min; i++) {
-                                if (isWordChar(*stack.currentFrame->args.subjectPtr))
-                                    RRETURN_NO_MATCH;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_WORDCHAR:
-                            for (int i = 1; i <= min; i++) {
-                                if (!isWordChar(*stack.currentFrame->args.subjectPtr))
-                                    RRETURN_NO_MATCH;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        default:
-                            ASSERT_NOT_REACHED();
-                            return matchError(JSRegExpErrorInternal, stack);
-                    }  /* End switch(stack.currentFrame->locals.ctype) */
-                }
-                
-                /* If min = max, continue at the same level without recursing */
-                
-                if (min == stack.currentFrame->locals.max)
-                    NEXT_OPCODE;    
-                
-                /* If minimizing, we have to test the rest of the pattern before each
-                 subsequent match. */
-                
-                if (minimize) {
-                    for (stack.currentFrame->locals.fi = min;; stack.currentFrame->locals.fi++) {
-                        RECURSIVE_MATCH(48, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                        if (isMatch)
-                            RRETURN;
-                        if (stack.currentFrame->locals.fi >= stack.currentFrame->locals.max || stack.currentFrame->args.subjectPtr >= md.endSubject)
-                            RRETURN;
-                        
-                        int c = *stack.currentFrame->args.subjectPtr++;
-                        switch (stack.currentFrame->locals.ctype) {
-                            case OP_NOT_NEWLINE:
-                                if (isNewline(c))
-                                    RRETURN;
-                                break;
-                                
-                            case OP_NOT_DIGIT:
-                                if (isASCIIDigit(c))
-                                    RRETURN;
-                                break;
-                                
-                            case OP_DIGIT:
-                                if (!isASCIIDigit(c))
-                                    RRETURN;
-                                break;
-                                
-                            case OP_NOT_WHITESPACE:
-                                if (isSpaceChar(c))
-                                    RRETURN;
-                                break;
-                                
-                            case OP_WHITESPACE:
-                                if (!isSpaceChar(c))
-                                    RRETURN;
-                                break;
-                                
-                            case OP_NOT_WORDCHAR:
-                                if (isWordChar(c))
-                                    RRETURN;
-                                break;
-                                
-                            case OP_WORDCHAR:
-                                if (!isWordChar(c))
-                                    RRETURN;
-                                break;
-                                
-                            default:
-                                ASSERT_NOT_REACHED();
-                                return matchError(JSRegExpErrorInternal, stack);
-                        }
-                    }
-                    /* Control never reaches here */
-                }
-                
-                /* If maximizing it is worth using inline code for speed, doing the type
-                 test once at the start (i.e. keep it out of the loop). */
-                
-                else {
-                    stack.currentFrame->locals.subjectPtrAtStartOfInstruction = stack.currentFrame->args.subjectPtr;  /* Remember where we started */
-                    
-                    switch (stack.currentFrame->locals.ctype) {
-                        case OP_NOT_NEWLINE:
-                            for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                                if (stack.currentFrame->args.subjectPtr >= md.endSubject || isNewline(*stack.currentFrame->args.subjectPtr))
-                                    break;
-                                stack.currentFrame->args.subjectPtr++;
-                            }
-                            break;
-                            
-                        case OP_NOT_DIGIT:
-                            for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                    break;
-                                int c = *stack.currentFrame->args.subjectPtr;
-                                if (isASCIIDigit(c))
-                                    break;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_DIGIT:
-                            for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                    break;
-                                int c = *stack.currentFrame->args.subjectPtr;
-                                if (!isASCIIDigit(c))
-                                    break;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_NOT_WHITESPACE:
-                            for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                    break;
-                                int c = *stack.currentFrame->args.subjectPtr;
-                                if (isSpaceChar(c))
-                                    break;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_WHITESPACE:
-                            for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                    break;
-                                int c = *stack.currentFrame->args.subjectPtr;
-                                if (!isSpaceChar(c))
-                                    break;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_NOT_WORDCHAR:
-                            for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                    break;
-                                int c = *stack.currentFrame->args.subjectPtr;
-                                if (isWordChar(c))
-                                    break;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        case OP_WORDCHAR:
-                            for (int i = min; i < stack.currentFrame->locals.max; i++) {
-                                if (stack.currentFrame->args.subjectPtr >= md.endSubject)
-                                    break;
-                                int c = *stack.currentFrame->args.subjectPtr;
-                                if (!isWordChar(c))
-                                    break;
-                                ++stack.currentFrame->args.subjectPtr;
-                            }
-                            break;
-                            
-                        default:
-                            ASSERT_NOT_REACHED();
-                            return matchError(JSRegExpErrorInternal, stack);
-                    }
-                    
-                    /* stack.currentFrame->args.subjectPtr is now past the end of the maximum run */
-                    
-                    for (;;) {
-                        RECURSIVE_MATCH(52, stack.currentFrame->args.instructionPtr, stack.currentFrame->args.bracketChain);
-                        if (isMatch)
-                            RRETURN;
-                        if (stack.currentFrame->args.subjectPtr-- == stack.currentFrame->locals.subjectPtrAtStartOfInstruction)
-                            break;        /* Stop if tried at original pos */
-                    }
-                    
-                    /* Get here if we can't make it match with any permitted repetitions */
-                    
-                    RRETURN;
-                }
-                /* Control never reaches here */
-                
-            BEGIN_OPCODE(CRMINPLUS):
-            BEGIN_OPCODE(CRMINQUERY):
-            BEGIN_OPCODE(CRMINRANGE):
-            BEGIN_OPCODE(CRMINSTAR):
-            BEGIN_OPCODE(CRPLUS):
-            BEGIN_OPCODE(CRQUERY):
-            BEGIN_OPCODE(CRRANGE):
-            BEGIN_OPCODE(CRSTAR):
-                ASSERT_NOT_REACHED();
-                return matchError(JSRegExpErrorInternal, stack);
-                
-#ifdef USE_COMPUTED_GOTO_FOR_MATCH_OPCODE_LOOP
-            CAPTURING_BRACKET:
-#else
-            default:
-#endif
-                /* Opening capturing bracket. If there is space in the offset vector, save
-                 the current subject position in the working slot at the top of the vector. We
-                 mustn't change the current values of the data slot, because they may be set
-                 from a previous iteration of this group, and be referred to by a reference
-                 inside the group.
-                 
-                 If the bracket fails to match, we need to restore this value and also the
-                 values of the final offsets, in case they were set by a previous iteration of
-                 the same bracket.
-                 
-                 If there isn't enough space in the offset vector, treat this as if it were a
-                 non-capturing bracket. Don't worry about setting the flag for the error case
-                 here; that is handled in the code for KET. */
-                
-                ASSERT(*stack.currentFrame->args.instructionPtr > OP_BRA);
-                
-                stack.currentFrame->locals.number = *stack.currentFrame->args.instructionPtr - OP_BRA;
-                
-                /* For extended extraction brackets (large number), we have to fish out the
-                 number from a dummy opcode at the start. */
-                
-                if (stack.currentFrame->locals.number > EXTRACT_BASIC_MAX)
-                    stack.currentFrame->locals.number = get2ByteValue(stack.currentFrame->args.instructionPtr + 2 + LINK_SIZE);
-                stack.currentFrame->locals.offset = stack.currentFrame->locals.number << 1;
-                
-#ifdef DEBUG
-                printf("start bracket %d subject=", stack.currentFrame->locals.number);
-                pchars(stack.currentFrame->args.subjectPtr, 16, true, md);
-                printf("\n");
-#endif
-                
-                if (stack.currentFrame->locals.offset < md.offsetMax) {
-                    stack.currentFrame->locals.saveOffset1 = md.offsetVector[stack.currentFrame->locals.offset];
-                    stack.currentFrame->locals.saveOffset2 = md.offsetVector[stack.currentFrame->locals.offset + 1];
-                    stack.currentFrame->locals.saveOffset3 = md.offsetVector[md.offsetEnd - stack.currentFrame->locals.number];
-                    
-                    DPRINTF(("saving %d %d %d\n", stack.currentFrame->locals.saveOffset1, stack.currentFrame->locals.saveOffset2, stack.currentFrame->locals.saveOffset3));
-                    md.offsetVector[md.offsetEnd - stack.currentFrame->locals.number] = stack.currentFrame->args.subjectPtr - md.startSubject;
-                    
-                    do {
-                        RECURSIVE_MATCH_NEW_GROUP(1, stack.currentFrame->args.instructionPtr + 1 + LINK_SIZE, stack.currentFrame->args.bracketChain);
-                        if (isMatch)
-                            RRETURN;
-                        stack.currentFrame->args.instructionPtr += getLinkValue(stack.currentFrame->args.instructionPtr + 1);
-                    } while (*stack.currentFrame->args.instructionPtr == OP_ALT);
-                    
-                    DPRINTF(("bracket %d failed\n", stack.currentFrame->locals.number));
-                    
-                    md.offsetVector[stack.currentFrame->locals.offset] = stack.currentFrame->locals.saveOffset1;
-                    md.offsetVector[stack.currentFrame->locals.offset + 1] = stack.currentFrame->locals.saveOffset2;
-                    md.offsetVector[md.offsetEnd - stack.currentFrame->locals.number] = stack.currentFrame->locals.saveOffset3;
-                    
-                    RRETURN;
-                }
-                
-                /* Insufficient room for saving captured contents */
-                
-                goto NON_CAPTURING_BRACKET;
-        }
-        
-        /* Do not stick any code in here without much thought; it is assumed
-         that "continue" in the code above comes out to here to repeat the main
-         loop. */
-        
-    } /* End of main loop */
-    
-    ASSERT_NOT_REACHED();
-    
-#ifndef USE_COMPUTED_GOTO_FOR_MATCH_RECURSION
-    
-RRETURN_SWITCH:
-    switch (stack.currentFrame->returnLocation) {
-        case 0: goto RETURN;
-        case 1: goto RRETURN_1;
-        case 2: goto RRETURN_2;
-        case 6: goto RRETURN_6;
-        case 7: goto RRETURN_7;
-        case 14: goto RRETURN_14;
-        case 15: goto RRETURN_15;
-        case 16: goto RRETURN_16;
-        case 17: goto RRETURN_17;
-        case 18: goto RRETURN_18;
-        case 19: goto RRETURN_19;
-        case 20: goto RRETURN_20;
-        case 21: goto RRETURN_21;
-        case 22: goto RRETURN_22;
-        case 24: goto RRETURN_24;
-        case 26: goto RRETURN_26;
-        case 27: goto RRETURN_27;
-        case 28: goto RRETURN_28;
-        case 29: goto RRETURN_29;
-        case 30: goto RRETURN_30;
-        case 31: goto RRETURN_31;
-        case 38: goto RRETURN_38;
-        case 40: goto RRETURN_40;
-        case 42: goto RRETURN_42;
-        case 44: goto RRETURN_44;
-        case 48: goto RRETURN_48;
-        case 52: goto RRETURN_52;
-    }
-    
-    ASSERT_NOT_REACHED();
-    return matchError(JSRegExpErrorInternal, stack);
-    
-#endif
-    
-RETURN:
-    return isMatch;
-}
-
-
-/*************************************************
-*         Execute a Regular Expression           *
-*************************************************/
-
-/* This function applies a compiled re to a subject string and picks out
-portions of the string if it matches. Two elements in the vector are set for
-each substring: the offsets to the start and end of the substring.
-
-Arguments:
-  re              points to the compiled expression
-  extra_data      points to extra data or is NULL
-  subject         points to the subject string
-  length          length of subject string (may contain binary zeros)
-  start_offset    where to start in the subject string
-  options         option bits
-  offsets         points to a vector of ints to be filled in with offsets
-  offsetCount     the number of elements in the vector
-
-Returns:          > 0 => success; value is the number of elements filled in
-                  = 0 => success, but offsets is not big enough
-                   -1 => failed to match
-                 < -1 => some kind of unexpected problem
-*/
-
-static void tryFirstByteOptimization(const UChar*& subjectPtr, const UChar* endSubject, int firstByte, bool firstByteIsCaseless, bool useMultiLineFirstCharOptimization, const UChar* originalSubjectStart)
-{
-    // If firstByte is set, try scanning to the first instance of that byte
-    // no need to try and match against any earlier part of the subject string.
-    if (firstByte >= 0) {
-        UChar firstChar = firstByte;
-        if (firstByteIsCaseless)
-            while (subjectPtr < endSubject) {
-                int c = *subjectPtr;
-                if (c > 127)
-                    break;
-                if (toLowerCase(c) == firstChar)
-                    break;
-                subjectPtr++;
-            }
-        else {
-            while (subjectPtr < endSubject && *subjectPtr != firstChar)
-                subjectPtr++;
-        }
-    } else if (useMultiLineFirstCharOptimization) {
-        /* Or to just after \n for a multiline match if possible */
-        // I'm not sure why this != originalSubjectStart check is necessary -- ecs 11/18/07
-        if (subjectPtr > originalSubjectStart) {
-            while (subjectPtr < endSubject && !isNewline(subjectPtr[-1]))
-                subjectPtr++;
-        }
-    }
-}
-
-static bool tryRequiredByteOptimization(const UChar*& subjectPtr, const UChar* endSubject, int reqByte, int reqByte2, bool reqByteIsCaseless, bool hasFirstByte, const UChar*& reqBytePtr)
-{
-    /* If reqByte is set, we know that that character must appear in the subject
-     for the match to succeed. If the first character is set, reqByte must be
-     later in the subject; otherwise the test starts at the match point. This
-     optimization can save a huge amount of backtracking in patterns with nested
-     unlimited repeats that aren't going to match. Writing separate code for
-     cased/caseless versions makes it go faster, as does using an autoincrement
-     and backing off on a match.
-     
-     HOWEVER: when the subject string is very, very long, searching to its end can
-     take a long time, and give bad performance on quite ordinary patterns. This
-     showed up when somebody was matching /^C/ on a 32-megabyte string... so we
-     don't do this when the string is sufficiently long.
-    */
-
-    if (reqByte >= 0 && endSubject - subjectPtr < REQ_BYTE_MAX) {
-        const UChar* p = subjectPtr + (hasFirstByte ? 1 : 0);
-
-        /* We don't need to repeat the search if we haven't yet reached the
-         place we found it at last time. */
-
-        if (p > reqBytePtr) {
-            if (reqByteIsCaseless) {
-                while (p < endSubject) {
-                    int pp = *p++;
-                    if (pp == reqByte || pp == reqByte2) {
-                        p--;
-                        break;
-                    }
-                }
-            } else {
-                while (p < endSubject) {
-                    if (*p++ == reqByte) {
-                        p--;
-                        break;
-                    }
-                }
-            }
-
-            /* If we can't find the required character, break the matching loop */
-
-            if (p >= endSubject)
-                return true;
-
-            /* If we have found the required character, save the point where we
-             found it, so that we don't search again next time round the loop if
-             the start hasn't passed this character yet. */
-
-            reqBytePtr = p;
-        }
-    }
-    return false;
-}
-
-int jsRegExpExecute(const JSRegExp* re,
-                    const UChar* subject, int length, int start_offset, int* offsets,
-                    int offsetCount)
-{
-    ASSERT(re);
-    ASSERT(subject || !length);
-    ASSERT(offsetCount >= 0);
-    ASSERT(offsets || offsetCount == 0);
-
-    HistogramTimeLogger logger(re);
-
-    MatchData matchBlock;
-    matchBlock.startSubject = subject;
-    matchBlock.endSubject = matchBlock.startSubject + length;
-    const UChar* endSubject = matchBlock.endSubject;
-    
-    matchBlock.multiline = (re->options & MatchAcrossMultipleLinesOption);
-    matchBlock.ignoreCase = (re->options & IgnoreCaseOption);
-    
-    /* If the expression has got more back references than the offsets supplied can
-     hold, we get a temporary chunk of working store to use during the matching.
-     Otherwise, we can use the vector supplied, rounding down its size to a multiple
-     of 3. */
-    
-    int ocount = offsetCount - (offsetCount % 3);
-    
-    // FIXME: This is lame that we have to second-guess our caller here.
-    // The API should change to either fail-hard when we don't have enough offset space
-    // or that we shouldn't ask our callers to pre-allocate in the first place.
-    bool usingTemporaryOffsets = false;
-    if (re->topBackref > 0 && re->topBackref >= ocount/3) {
-        ocount = re->topBackref * 3 + 3;
-        matchBlock.offsetVector = new int[ocount];
-        if (!matchBlock.offsetVector)
-            return JSRegExpErrorNoMemory;
-        usingTemporaryOffsets = true;
-    } else
-        matchBlock.offsetVector = offsets;
-    
-    matchBlock.offsetEnd = ocount;
-    matchBlock.offsetMax = (2*ocount)/3;
-    matchBlock.offsetOverflow = false;
-    
-    /* Compute the minimum number of offsets that we need to reset each time. Doing
-     this makes a huge difference to execution time when there aren't many brackets
-     in the pattern. */
-    
-    int resetCount = 2 + re->topBracket * 2;
-    if (resetCount > offsetCount)
-        resetCount = ocount;
-    
-    /* Reset the working variable associated with each extraction. These should
-     never be used unless previously set, but they get saved and restored, and so we
-     initialize them to avoid reading uninitialized locations. */
-    
-    if (matchBlock.offsetVector) {
-        int* iptr = matchBlock.offsetVector + ocount;
-        int* iend = iptr - resetCount/2 + 1;
-        while (--iptr >= iend)
-            *iptr = -1;
-    }
-    
-    /* Set up the first character to match, if available. The firstByte value is
-     never set for an anchored regular expression, but the anchoring may be forced
-     at run time, so we have to test for anchoring. The first char may be unset for
-     an unanchored pattern, of course. If there's no first char and the pattern was
-     studied, there may be a bitmap of possible first characters. */
-    
-    bool firstByteIsCaseless = false;
-    int firstByte = -1;
-    if (re->options & UseFirstByteOptimizationOption) {
-        firstByte = re->firstByte & 255;
-        if ((firstByteIsCaseless = (re->firstByte & REQ_IGNORE_CASE)))
-            firstByte = toLowerCase(firstByte);
-    }
-    
-    /* For anchored or unanchored matches, there may be a "last known required
-     character" set. */
-    
-    bool reqByteIsCaseless = false;
-    int reqByte = -1;
-    int reqByte2 = -1;
-    if (re->options & UseRequiredByteOptimizationOption) {
-        reqByte = re->reqByte & 255; // FIXME: This optimization could be made to work for UTF16 chars as well...
-        reqByteIsCaseless = (re->reqByte & REQ_IGNORE_CASE);
-        reqByte2 = flipCase(reqByte);
-    }
-    
-    /* Loop for handling unanchored repeated matching attempts; for anchored regexs
-     the loop runs just once. */
-    
-    const UChar* startMatch = subject + start_offset;
-    const UChar* reqBytePtr = startMatch - 1;
-    bool useMultiLineFirstCharOptimization = re->options & UseMultiLineFirstByteOptimizationOption;
-    
-    do {
-        /* Reset the maximum number of extractions we might see. */
-        if (matchBlock.offsetVector) {
-            int* iptr = matchBlock.offsetVector;
-            int* iend = iptr + resetCount;
-            while (iptr < iend)
-                *iptr++ = -1;
-        }
-        
-        tryFirstByteOptimization(startMatch, endSubject, firstByte, firstByteIsCaseless, useMultiLineFirstCharOptimization, matchBlock.startSubject + start_offset);
-        if (tryRequiredByteOptimization(startMatch, endSubject, reqByte, reqByte2, reqByteIsCaseless, firstByte >= 0, reqBytePtr))
-            break;
-                
-        /* When a match occurs, substrings will be set for all internal extractions;
-         we just need to set up the whole thing as substring 0 before returning. If
-         there were too many extractions, set the return code to zero. In the case
-         where we had to get some local store to hold offsets for backreferences, copy
-         those back references that we can. In this case there need not be overflow
-         if certain parts of the pattern were not used. */
-        
-        /* The code starts after the JSRegExp block and the capture name table. */
-        const unsigned char* start_code = (const unsigned char*)(re + 1);
-        
-        int returnCode = match(startMatch, start_code, 2, matchBlock);
-        
-        /* When the result is no match, advance the pointer to the next character
-         and continue. */
-        if (returnCode == 0) {
-            startMatch++;
-            continue;
-        }
-
-        if (returnCode != 1) {
-            ASSERT(returnCode == JSRegExpErrorHitLimit || returnCode == JSRegExpErrorNoMemory);
-            DPRINTF((">>>> error: returning %d\n", returnCode));
-            return returnCode;
-        }
-        
-        /* We have a match! Copy the offset information from temporary store if
-         necessary */
-        
-        if (usingTemporaryOffsets) {
-            if (offsetCount >= 4) {
-                memcpy(offsets + 2, matchBlock.offsetVector + 2, (offsetCount - 2) * sizeof(int));
-                DPRINTF(("Copied offsets from temporary memory\n"));
-            }
-            if (matchBlock.endOffsetTop > offsetCount)
-                matchBlock.offsetOverflow = true;
-            
-            DPRINTF(("Freeing temporary memory\n"));
-            delete [] matchBlock.offsetVector;
-        }
-        
-        returnCode = matchBlock.offsetOverflow ? 0 : matchBlock.endOffsetTop / 2;
-        
-        if (offsetCount < 2)
-            returnCode = 0;
-        else {
-            offsets[0] = startMatch - matchBlock.startSubject;
-            offsets[1] = matchBlock.endMatchPtr - matchBlock.startSubject;
-        }
-        
-        DPRINTF((">>>> returning %d\n", returnCode));
-        return returnCode;
-    } while (!(re->options & IsAnchoredOption) && startMatch <= endSubject);
-    
-    if (usingTemporaryOffsets) {
-        DPRINTF(("Freeing temporary memory\n"));
-        delete [] matchBlock.offsetVector;
-    }
-    
-    DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n"));
-    return JSRegExpErrorNoMatch;
-}
-
-#if REGEXP_HISTOGRAM
-
-class CompareHistogramEntries {
-public:
-    bool operator()(const pair<UString, double>& a, const pair<UString, double>& b)
-    {
-        if (a.second == b.second)
-            return a.first < b.first;
-        return a.second < b.second;
-    }
-};
-
-Histogram::~Histogram()
-{
-    Vector<pair<UString, double> > values;
-    Map::iterator end = times.end();
-    for (Map::iterator it = times.begin(); it != end; ++it)
-        values.append(*it);
-    sort(values.begin(), values.end(), CompareHistogramEntries());
-    size_t size = values.size();
-    printf("Regular Expressions, sorted by time spent evaluating them:\n");
-    for (size_t i = 0; i < size; ++i)
-        printf("    %f - %s\n", values[size - i - 1].second, values[size - i - 1].first.utf8().c_str());
-}
-
-void Histogram::add(const JSRegExp* re, double elapsedTime)
-{
-    UString string(reinterpret_cast<const UChar*>(reinterpret_cast<const char*>(re) + re->stringOffset), re->stringLength);
-    if (re->options & IgnoreCaseOption && re->options & MatchAcrossMultipleLinesOption)
-        string += " (multi-line, ignore case)";
-    else {
-        if (re->options & IgnoreCaseOption)
-            string += " (ignore case)";
-        if (re->options & MatchAcrossMultipleLinesOption)
-            string += " (multi-line)";
-    }
-    pair<Map::iterator, bool> result = times.add(string.impl(), elapsedTime);
-    if (!result.second)
-        result.first->second += elapsedTime;
-}
-
-HistogramTimeLogger::HistogramTimeLogger(const JSRegExp* re)
-    : m_re(re)
-    , m_startTime(currentTimeMS())
-{
-}
-
-HistogramTimeLogger::~HistogramTimeLogger()
-{
-    static Histogram histogram;
-    histogram.add(m_re, currentTimeMS() - m_startTime);
-}
-
-#endif
diff --git a/Source/JavaScriptCore/pcre/pcre_internal.h b/Source/JavaScriptCore/pcre/pcre_internal.h
deleted file mode 100644 (file)
index 0016bb5..0000000
+++ /dev/null
@@ -1,455 +0,0 @@
-/* This is JavaScriptCore's variant of the PCRE library. While this library
-started out as a copy of PCRE, many of the features of PCRE have been
-removed. This library now supports only the regular expression features
-required by the JavaScript language specification, and has only the functions
-needed by JavaScriptCore and the rest of WebKit.
-
-                 Originally written by Philip Hazel
-           Copyright (c) 1997-2006 University of Cambridge
-    Copyright (C) 2002, 2004, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
-
------------------------------------------------------------------------------
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice,
-      this list of conditions and the following disclaimer.
-
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-
-    * Neither the name of the University of Cambridge nor the names of its
-      contributors may be used to endorse or promote products derived from
-      this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
------------------------------------------------------------------------------
-*/
-
-/* This header contains definitions that are shared between the different
-modules, but which are not relevant to the exported API. This includes some
-functions whose names all begin with "_pcre_". */
-
-#ifndef PCRE_INTERNAL_H
-#define PCRE_INTERNAL_H
-
-/* Bit definitions for entries in the pcre_ctypes table. */
-
-#define ctype_space   0x01
-#define ctype_xdigit  0x08
-#define ctype_word    0x10   /* alphameric or '_' */
-
-/* Offsets for the bitmap tables in pcre_cbits. Each table contains a set
-of bits for a class map. Some classes are built by combining these tables. */
-
-#define cbit_space     0      /* \s */
-#define cbit_digit    32      /* \d */
-#define cbit_word     64      /* \w */
-#define cbit_length   96      /* Length of the cbits table */
-
-/* Offsets of the various tables from the base tables pointer, and
-total length. */
-
-#define lcc_offset      0
-#define fcc_offset    128
-#define cbits_offset  256
-#define ctypes_offset (cbits_offset + cbit_length)
-#define tables_length (ctypes_offset + 128)
-
-#ifndef DFTABLES
-
-// Change the following to 1 to dump used regular expressions at process exit time.
-#define REGEXP_HISTOGRAM 0
-
-#include "Assertions.h"
-
-#if COMPILER(MSVC)
-#pragma warning(disable: 4232)
-#pragma warning(disable: 4244)
-#endif
-
-#include "pcre.h"
-
-/* The value of LINK_SIZE determines the number of bytes used to store links as
-offsets within the compiled regex. The default is 2, which allows for compiled
-patterns up to 64K long. */
-
-#define LINK_SIZE   3
-
-/* Define DEBUG to get debugging output on stdout. */
-
-#if 0
-#define DEBUG
-#endif
-
-/* Use a macro for debugging printing, 'cause that eliminates the use of #ifdef
-inline, and there are *still* stupid compilers about that don't like indented
-pre-processor statements, or at least there were when I first wrote this. After
-all, it had only been about 10 years then... */
-
-#ifdef DEBUG
-#define DPRINTF(p) printf p
-#else
-#define DPRINTF(p) /*nothing*/
-#endif
-
-/* PCRE keeps offsets in its compiled code as 2-byte quantities (always stored
-in big-endian order) by default. These are used, for example, to link from the
-start of a subpattern to its alternatives and its end. The use of 2 bytes per
-offset limits the size of the compiled regex to around 64K, which is big enough
-for almost everybody. However, I received a request for an even bigger limit.
-For this reason, and also to make the code easier to maintain, the storing&nb