/[pcre]/code/branches/pcre16/pcre_jit_compile.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_jit_compile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 780 by zherczeg, Thu Dec 1 06:08:45 2011 UTC revision 781 by zherczeg, Sat Dec 3 07:58:30 2011 UTC
# Line 298  typedef struct compiler_common { Line 298  typedef struct compiler_common {
298    jump_list *caselesscmp;    jump_list *caselesscmp;
299    BOOL jscript_compat;    BOOL jscript_compat;
300  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
301    BOOL utf8;    BOOL utf;
302  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
303    BOOL useucp;    BOOL useucp;
304  #endif  #endif
# Line 497  switch(*cc) Line 497  switch(*cc)
497    
498    case OP_ANYBYTE:    case OP_ANYBYTE:
499  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
500    if (common->utf8) return NULL;    if (common->utf) return NULL;
501  #endif  #endif
502    return cc + 1;    return cc + 1;
503    
# Line 544  switch(*cc) Line 544  switch(*cc)
544    case OP_NOTPOSQUERYI:    case OP_NOTPOSQUERYI:
545    cc += 2;    cc += 2;
546  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
547    if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];    if (common->utf && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
548  #endif  #endif
549    return cc;    return cc;
550    
# Line 566  switch(*cc) Line 566  switch(*cc)
566    case OP_NOTPOSUPTOI:    case OP_NOTPOSUPTOI:
567    cc += 2 + IMM2_SIZE;    cc += 2 + IMM2_SIZE;
568  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
569    if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];    if (common->utf && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
570  #endif  #endif
571    return cc;    return cc;
572    
# Line 1264  static SLJIT_INLINE BOOL char_has_otherc Line 1264  static SLJIT_INLINE BOOL char_has_otherc
1264  unsigned int c;  unsigned int c;
1265    
1266  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1267  if (common->utf8)  if (common->utf)
1268    {    {
1269    GETCHAR(c, cc);    GETCHAR(c, cc);
1270    if (c > 127)    if (c > 127)
# Line 1286  static SLJIT_INLINE unsigned int char_ot Line 1286  static SLJIT_INLINE unsigned int char_ot
1286  {  {
1287  /* Returns with the othercase. */  /* Returns with the othercase. */
1288  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1289  if (common->utf8 && c > 127)  if (common->utf && c > 127)
1290    {    {
1291  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
1292    return UCD_OTHERCASE(c);    return UCD_OTHERCASE(c);
# Line 1307  int n; Line 1307  int n;
1307  #endif  #endif
1308    
1309  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1310  if (common->utf8)  if (common->utf)
1311    {    {
1312    GETCHAR(c, cc);    GETCHAR(c, cc);
1313    if (c <= 127)    if (c <= 127)
# Line 1343  if (!ispowerof2(bit)) Line 1343  if (!ispowerof2(bit))
1343    return 0;    return 0;
1344    
1345  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1346  if (common->utf8 && c > 127)  if (common->utf && c > 127)
1347    {    {
1348    n = PRIV(utf8_table4)[*cc & 0x3f];    n = PRIV(utf8_table4)[*cc & 0x3f];
1349    while ((bit & 0x3f) == 0)    while ((bit & 0x3f) == 0)
# Line 1374  struct sljit_jump *jump; Line 1374  struct sljit_jump *jump;
1374    
1375  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
1376  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1377  if (common->utf8)  if (common->utf)
1378    {    {
1379    jump = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);    jump = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
1380    add_jump(compiler, &common->utf8readchar, JUMP(SLJIT_FAST_CALL));    add_jump(compiler, &common->utf8readchar, JUMP(SLJIT_FAST_CALL));
# Line 1395  struct sljit_jump *jump; Line 1395  struct sljit_jump *jump;
1395    
1396  OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);  OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
1397  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1398  if (common->utf8)  if (common->utf)
1399    {    {
1400    jump = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);    jump = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
1401    add_jump(compiler, &common->utf8readchar, JUMP(SLJIT_FAST_CALL));    add_jump(compiler, &common->utf8readchar, JUMP(SLJIT_FAST_CALL));
# Line 1414  struct sljit_jump *jump; Line 1414  struct sljit_jump *jump;
1414  #endif  #endif
1415    
1416  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1417  if (common->utf8)  if (common->utf)
1418    {    {
1419    OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(STR_PTR), 0);    OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(STR_PTR), 0);
1420    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);
# Line 1439  DEFINE_COMPILER; Line 1439  DEFINE_COMPILER;
1439  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1440  struct sljit_label *label;  struct sljit_label *label;
1441    
1442  if (common->utf8)  if (common->utf)
1443    {    {
1444    label = LABEL();    label = LABEL();
1445    OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);    OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);
# Line 1697  mainloop = LABEL(); Line 1697  mainloop = LABEL();
1697    
1698  /* Increasing the STR_PTR here requires one less jump in the most common case. */  /* Increasing the STR_PTR here requires one less jump in the most common case. */
1699  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1700  if (common->utf8) readuchar = TRUE;  if (common->utf) readuchar = TRUE;
1701  #endif  #endif
1702  if (newlinecheck) readuchar = TRUE;  if (newlinecheck) readuchar = TRUE;
1703    
# Line 1709  if (newlinecheck) Line 1709  if (newlinecheck)
1709    
1710  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
1711  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1712  if (common->utf8)  if (common->utf)
1713    {    {
1714    singlebyte = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);    singlebyte = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
1715    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);
# Line 1771  else Line 1771  else
1771    
1772  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
1773  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1774  if (common->utf8)  if (common->utf)
1775    {    {
1776    CMPTO(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0, start);    CMPTO(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0, start);
1777    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);
# Line 1882  start = LABEL(); Line 1882  start = LABEL();
1882  leave = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);  leave = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
1883  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
1884  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
1885  if (common->utf8)  if (common->utf)
1886    OP1(SLJIT_MOV, TMP3, 0, TMP1, 0);    OP1(SLJIT_MOV, TMP3, 0, TMP1, 0);
1887  #endif  #endif
1888  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
# Line 1896  OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSE Line 1896  OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSE
1896  found = JUMP(SLJIT_C_NOT_ZERO);  found = JUMP(SLJIT_C_NOT_ZERO);
1897    
1898  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
1899  if (common->utf8)  if (common->utf)
1900    OP1(SLJIT_MOV, TMP1, 0, TMP3, 0);    OP1(SLJIT_MOV, TMP1, 0, TMP3, 0);
1901  #endif  #endif
1902  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));  OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
1903  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1904  if (common->utf8)  if (common->utf)
1905    {    {
1906    CMPTO(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0, start);    CMPTO(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0, start);
1907    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(utf8_table4) - 0xc0);
# Line 2051  else Line 2051  else
2051  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2052    /* Here LOCALS1 has already been zeroed. */    /* Here LOCALS1 has already been zeroed. */
2053    jump = NULL;    jump = NULL;
2054    if (common->utf8)    if (common->utf)
2055      jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);      jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);
2056  #endif  #endif
2057    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes);    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), common->ctypes);
# Line 2090  else Line 2090  else
2090  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2091    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 0);    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, 0);
2092    jump = NULL;    jump = NULL;
2093    if (common->utf8)    if (common->utf)
2094      jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);      jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);
2095  #endif  #endif
2096    OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP1), common->ctypes);    OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM1(TMP1), common->ctypes);
# Line 2119  OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSE Line 2119  OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSE
2119  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_LESS_EQUAL);  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_LESS_EQUAL);
2120  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a);  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a);
2121  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2122  if (common->utf8)  if (common->utf)
2123    {    {
2124    COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);    COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);
2125    OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x1);    OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x1);
# Line 2143  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSE Line 2143  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSE
2143  COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);  COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);
2144  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xa0);  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0xa0);
2145  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2146  if (common->utf8)  if (common->utf)
2147    {    {
2148    COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);    COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);
2149    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x1680);    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x1680);
# Line 2177  OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSE Line 2177  OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSE
2177  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_LESS_EQUAL);  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_LESS_EQUAL);
2178  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a);  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x85 - 0x0a);
2179  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2180  if (common->utf8)  if (common->utf)
2181    {    {
2182    COND_VALUE(SLJIT_OR | SLJIT_SET_E, TMP2, 0, SLJIT_C_EQUAL);    COND_VALUE(SLJIT_OR | SLJIT_SET_E, TMP2, 0, SLJIT_C_EQUAL);
2183    OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x1);    OP2(SLJIT_OR, TMP1, 0, TMP1, 0, SLJIT_IMM, 0x1);
# Line 2289  DEFINE_COMPILER; Line 2289  DEFINE_COMPILER;
2289  unsigned int othercasebit = 0;  unsigned int othercasebit = 0;
2290  pcre_uchar *othercasechar = NULL;  pcre_uchar *othercasechar = NULL;
2291  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2292  int utf8length;  int utflength;
2293  #endif  #endif
2294    
2295  if (caseless && char_has_othercase(common, cc))  if (caseless && char_has_othercase(common, cc))
# Line 2336  if (context->sourcereg == -1) Line 2336  if (context->sourcereg == -1)
2336    }    }
2337    
2338  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2339  utf8length = 1;  utflength = 1;
2340  if (common->utf8 && *cc >= 0xc0)  if (common->utf && *cc >= 0xc0)
2341    utf8length += PRIV(utf8_table4)[*cc & 0x3f];    utflength += PRIV(utf8_table4)[*cc & 0x3f];
2342    
2343  do  do
2344    {    {
# Line 2432  do Line 2432  do
2432    
2433    cc++;    cc++;
2434  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2435    utf8length--;    utflength--;
2436    }    }
2437  while (utf8length > 0);  while (utflength > 0);
2438  #endif  #endif
2439    
2440  return cc;  return cc;
# Line 2480  unsigned int typeoffset; Line 2480  unsigned int typeoffset;
2480  int invertcmp, numberofcmps;  int invertcmp, numberofcmps;
2481  unsigned int charoffset;  unsigned int charoffset;
2482    
2483  /* Although SUPPORT_UTF8 must be defined, we are not necessary in utf8 mode. */  /* Although SUPPORT_UTF must be defined, we are not necessary in utf mode. */
2484  check_input_end(common, fallbacks);  check_input_end(common, fallbacks);
2485  read_char(common);  read_char(common);
2486    
# Line 2490  if ((*cc++ & XCL_MAP) != 0) Line 2490  if ((*cc++ & XCL_MAP) != 0)
2490  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
2491    jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);    jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);
2492  #elif defined SUPPORT_UTF8  #elif defined SUPPORT_UTF8
2493    if (common->utf8)    if (common->utf)
2494      jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);      jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);
2495  #endif  #endif
2496    
# Line 2504  if ((*cc++ & XCL_MAP) != 0) Line 2504  if ((*cc++ & XCL_MAP) != 0)
2504  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
2505    JUMPHERE(jump);    JUMPHERE(jump);
2506  #elif defined SUPPORT_UTF8  #elif defined SUPPORT_UTF8
2507    if (common->utf8)    if (common->utf)
2508      JUMPHERE(jump);      JUMPHERE(jump);
2509  #endif  #endif
2510    OP1(SLJIT_MOV, TMP1, 0, TMP3, 0);    OP1(SLJIT_MOV, TMP1, 0, TMP3, 0);
# Line 2524  while (*cc != XCL_END) Line 2524  while (*cc != XCL_END)
2524      {      {
2525      cc += 2;      cc += 2;
2526  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2527      if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];      if (common->utf && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
2528  #endif  #endif
2529  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
2530      needschar = TRUE;      needschar = TRUE;
# Line 2534  while (*cc != XCL_END) Line 2534  while (*cc != XCL_END)
2534      {      {
2535      cc += 2;      cc += 2;
2536  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2537      if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];      if (common->utf && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
2538  #endif  #endif
2539      cc++;      cc++;
2540  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2541      if (common->utf8 && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];      if (common->utf && cc[-1] >= 0xc0) cc += PRIV(utf8_table4)[cc[-1] & 0x3f];
2542  #endif  #endif
2543  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
2544      needschar = TRUE;      needschar = TRUE;
# Line 2639  while (*cc != XCL_END) Line 2639  while (*cc != XCL_END)
2639      {      {
2640      cc ++;      cc ++;
2641  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2642      if (common->utf8)      if (common->utf)
2643        {        {
2644        GETCHARINC(c, cc);        GETCHARINC(c, cc);
2645        }        }
# Line 2670  while (*cc != XCL_END) Line 2670  while (*cc != XCL_END)
2670      {      {
2671      cc ++;      cc ++;
2672  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2673      if (common->utf8)      if (common->utf)
2674        {        {
2675        GETCHARINC(c, cc);        GETCHARINC(c, cc);
2676        }        }
# Line 2679  while (*cc != XCL_END) Line 2679  while (*cc != XCL_END)
2679        c = *cc++;        c = *cc++;
2680      SET_CHAR_OFFSET(c);      SET_CHAR_OFFSET(c);
2681  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2682      if (common->utf8)      if (common->utf)
2683        {        {
2684        GETCHARINC(c, cc);        GETCHARINC(c, cc);
2685        }        }
# Line 2876  switch(type) Line 2876  switch(type)
2876    case OP_ALLANY:    case OP_ALLANY:
2877    check_input_end(common, fallbacks);    check_input_end(common, fallbacks);
2878  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
2879    if (common->utf8)    if (common->utf)
2880      {      {
2881      OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);      OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
2882      OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);      OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);
# Line 3096  switch(type) Line 3096  switch(type)
3096    case OP_CHARI:    case OP_CHARI:
3097    length = 1;    length = 1;
3098  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3099    if (common->utf8 && *cc >= 0xc0) length += PRIV(utf8_table4)[*cc & 0x3f];    if (common->utf && *cc >= 0xc0) length += PRIV(utf8_table4)[*cc & 0x3f];
3100  #endif  #endif
3101    if (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0)    if (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0)
3102      {      {
# Line 3113  switch(type) Line 3113  switch(type)
3113    check_input_end(common, fallbacks);    check_input_end(common, fallbacks);
3114    read_char(common);    read_char(common);
3115  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3116    if (common->utf8)    if (common->utf)
3117      {      {
3118      GETCHAR(c, cc);      GETCHAR(c, cc);
3119      }      }
# Line 3130  switch(type) Line 3130  switch(type)
3130    case OP_NOT:    case OP_NOT:
3131    case OP_NOTI:    case OP_NOTI:
3132  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3133    if (common->utf8)    if (common->utf)
3134      {      {
3135      length = 1;      length = 1;
3136      if (*cc >= 0xc0) length += PRIV(utf8_table4)[*cc & 0x3f];      if (*cc >= 0xc0) length += PRIV(utf8_table4)[*cc & 0x3f];
# Line 3196  switch(type) Line 3196  switch(type)
3196    jump[0] = NULL;    jump[0] = NULL;
3197  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3198    /* This check can only be skipped in pure 8 bit mode. */    /* This check can only be skipped in pure 8 bit mode. */
3199    if (common->utf8)    if (common->utf)
3200  #endif  #endif
3201      {      {
3202      jump[0] = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);      jump[0] = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);
# Line 3231  switch(type) Line 3231  switch(type)
3231    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
3232    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));    OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(TMP1), SLJIT_OFFSETOF(jit_arguments, begin));
3233  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3234    if (common->utf8)    if (common->utf)
3235      {      {
3236      OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, length);      OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, length);
3237      label = LABEL();      label = LABEL();
# Line 3269  do Line 3269  do
3269      {      {
3270      size = 1;      size = 1;
3271  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3272      if (common->utf8 && cc[1] >= 0xc0)      if (common->utf && cc[1] >= 0xc0)
3273        size += PRIV(utf8_table4)[cc[1] & 0x3f];        size += PRIV(utf8_table4)[cc[1] & 0x3f];
3274  #endif  #endif
3275      }      }
# Line 3277  do Line 3277  do
3277      {      {
3278      size = 1;      size = 1;
3279  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3280      if (common->utf8)      if (common->utf)
3281        {        {
3282        if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0)        if (char_has_othercase(common, cc + 1) && char_get_othercase_bit(common, cc + 1) == 0)
3283          size = 0;          size = 0;
# Line 3381  if (withchecks && !common->jscript_compa Line 3381  if (withchecks && !common->jscript_compa
3381    
3382  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3383  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3384  if (common->utf8 && *cc == OP_REFI)  if (common->utf && *cc == OP_REFI)
3385    {    {
3386    SLJIT_ASSERT(TMP1 == SLJIT_TEMPORARY_REG1 && STACK_TOP == SLJIT_TEMPORARY_REG2 && TMP2 == SLJIT_TEMPORARY_REG3);    SLJIT_ASSERT(TMP1 == SLJIT_TEMPORARY_REG1 && STACK_TOP == SLJIT_TEMPORARY_REG2 && TMP2 == SLJIT_TEMPORARY_REG3);
3387    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(offset + 1));    OP1(SLJIT_MOV, TMP2, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(offset + 1));
# Line 4787  if (end != NULL) Line 4787  if (end != NULL)
4787    {    {
4788    *end = cc + 1;    *end = cc + 1;
4789  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
4790    if (common->utf8 && *cc >= 0xc0) *end += PRIV(utf8_table4)[*cc & 0x3f];    if (common->utf && *cc >= 0xc0) *end += PRIV(utf8_table4)[*cc & 0x3f];
4791  #endif  #endif
4792    }    }
4793  return cc;  return cc;
# Line 6254  common->casefulcmp = NULL; Line 6254  common->casefulcmp = NULL;
6254  common->caselesscmp = NULL;  common->caselesscmp = NULL;
6255  common->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;  common->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;
6256  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
6257  common->utf8 = (re->options & PCRE_UTF8) != 0;  /* PCRE_UTF16 has the same value as PCRE_UTF8. */
6258    common->utf = (re->options & PCRE_UTF8) != 0;
6259  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
6260  common->useucp = (re->options & PCRE_UCP) != 0;  common->useucp = (re->options & PCRE_UCP) != 0;
6261  #endif  #endif

Legend:
Removed from v.780  
changed lines
  Added in v.781

  ViewVC Help
Powered by ViewVC 1.1.5