/[pcre]/code/trunk/pcre_jit_compile.c
ViewVC logotype

Diff of /code/trunk/pcre_jit_compile.c

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

revision 1084 by chpe, Tue Oct 16 15:55:28 2012 UTC revision 1121 by chpe, Tue Oct 16 15:57:42 2012 UTC
# Line 591  switch(*cc) Line 591  switch(*cc)
591    case OP_NOTPOSPLUSI:    case OP_NOTPOSPLUSI:
592    case OP_NOTPOSQUERYI:    case OP_NOTPOSQUERYI:
593    cc += 2;    cc += 2;
594  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
595    if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);    if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
596  #endif  #endif
597    return cc;    return cc;
# Line 613  switch(*cc) Line 613  switch(*cc)
613    case OP_NOTEXACTI:    case OP_NOTEXACTI:
614    case OP_NOTPOSUPTOI:    case OP_NOTPOSUPTOI:
615    cc += 2 + IMM2_SIZE;    cc += 2 + IMM2_SIZE;
616  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
617    if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);    if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
618  #endif  #endif
619    return cc;    return cc;
# Line 936  while (cc < ccend) Line 936  while (cc < ccend)
936      if (size < 0)      if (size < 0)
937        {        {
938        cc += -size;        cc += -size;
939  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
940        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
941  #endif  #endif
942        }        }
# Line 1076  while (cc < ccend) Line 1076  while (cc < ccend)
1076      if (size < 0)      if (size < 0)
1077        {        {
1078        cc += -size;        cc += -size;
1079  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1080        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1081  #endif  #endif
1082        }        }
# Line 1320  while (cc < ccend) Line 1320  while (cc < ccend)
1320      if (PRIVATE_DATA(cc))      if (PRIVATE_DATA(cc))
1321        private_data_length++;        private_data_length++;
1322      cc += 2;      cc += 2;
1323  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1324      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1325  #endif  #endif
1326      break;      break;
# Line 1329  while (cc < ccend) Line 1329  while (cc < ccend)
1329      if (PRIVATE_DATA(cc))      if (PRIVATE_DATA(cc))
1330        private_data_length += 2;        private_data_length += 2;
1331      cc += 2;      cc += 2;
1332  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1333      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1334  #endif  #endif
1335      break;      break;
# Line 1338  while (cc < ccend) Line 1338  while (cc < ccend)
1338      if (PRIVATE_DATA(cc))      if (PRIVATE_DATA(cc))
1339        private_data_length += 2;        private_data_length += 2;
1340      cc += 2 + IMM2_SIZE;      cc += 2 + IMM2_SIZE;
1341  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1342      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1343  #endif  #endif
1344      break;      break;
# Line 1497  while (status != end) Line 1497  while (status != end)
1497          srcw[0] = PRIVATE_DATA(cc);          srcw[0] = PRIVATE_DATA(cc);
1498          }          }
1499        cc += 2;        cc += 2;
1500  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1501        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1502  #endif  #endif
1503        break;        break;
# Line 1510  while (status != end) Line 1510  while (status != end)
1510          srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_w);          srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_w);
1511          }          }
1512        cc += 2;        cc += 2;
1513  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1514        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1515  #endif  #endif
1516        break;        break;
# Line 1523  while (status != end) Line 1523  while (status != end)
1523          srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_w);          srcw[1] = PRIVATE_DATA(cc) + sizeof(sljit_w);
1524          }          }
1525        cc += 2 + IMM2_SIZE;        cc += 2 + IMM2_SIZE;
1526  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
1527        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);        if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
1528  #endif  #endif
1529        break;        break;
# Line 2452  struct sljit_label *newlinelabel = NULL; Line 2452  struct sljit_label *newlinelabel = NULL;
2452  struct sljit_jump *start;  struct sljit_jump *start;
2453  struct sljit_jump *end = NULL;  struct sljit_jump *end = NULL;
2454  struct sljit_jump *nl = NULL;  struct sljit_jump *nl = NULL;
2455  #ifdef SUPPORT_UTF  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32
2456  struct sljit_jump *singlechar;  struct sljit_jump *singlechar;
2457  #endif  #endif
2458  jump_list *newline = NULL;  jump_list *newline = NULL;
# Line 2643  while (TRUE) Line 2643  while (TRUE)
2643        break;        break;
2644    
2645    len = 1;    len = 1;
2646  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
2647    if (common->utf && HAS_EXTRALEN(cc[0])) len += GET_EXTRALEN(cc[0]);    if (common->utf && HAS_EXTRALEN(cc[0])) len += GET_EXTRALEN(cc[0]);
2648  #endif  #endif
2649    
# Line 3529  if (caseless && char_has_othercase(commo Line 3529  if (caseless && char_has_othercase(commo
3529    othercasechar = cc + (othercasebit >> 8);    othercasechar = cc + (othercasebit >> 8);
3530    othercasebit &= 0xff;    othercasebit &= 0xff;
3531  #elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32  #elif defined COMPILE_PCRE16 || defined COMPILE_PCRE32
3532      /* Note that this code only handles characters in the BMP. If there
3533      ever are characters outside the BMP whose othercase differs in only one
3534      bit from itself (there currently are none), this code will need to be
3535      revised for COMPILE_PCRE32. */
3536    othercasechar = cc + (othercasebit >> 9);    othercasechar = cc + (othercasebit >> 9);
3537    if ((othercasebit & 0x100) != 0)    if ((othercasebit & 0x100) != 0)
3538      othercasebit = (othercasebit & 0xff) << 8;      othercasebit = (othercasebit & 0xff) << 8;
# Line 3563  if (context->sourcereg == -1) Line 3567  if (context->sourcereg == -1)
3567    
3568  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3569  utflength = 1;  utflength = 1;
 #ifndef COMPILE_PCRE32  
3570  if (common->utf && HAS_EXTRALEN(*cc))  if (common->utf && HAS_EXTRALEN(*cc))
3571    utflength += GET_EXTRALEN(*cc);    utflength += GET_EXTRALEN(*cc);
 #endif  
3572    
3573  do  do
3574    {    {
# Line 3759  while (*cc != XCL_END) Line 3761  while (*cc != XCL_END)
3761    if (*cc == XCL_SINGLE)    if (*cc == XCL_SINGLE)
3762      {      {
3763      cc += 2;      cc += 2;
3764  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
3765      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
3766  #endif  #endif
3767  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
# Line 3769  while (*cc != XCL_END) Line 3771  while (*cc != XCL_END)
3771    else if (*cc == XCL_RANGE)    else if (*cc == XCL_RANGE)
3772      {      {
3773      cc += 2;      cc += 2;
3774  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
3775      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
3776  #endif  #endif
3777      cc++;      cc++;
3778  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
3779      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);      if (common->utf && HAS_EXTRALEN(cc[-1])) cc += GET_EXTRALEN(cc[-1]);
3780  #endif  #endif
3781  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
# Line 4467  switch(type) Line 4469  switch(type)
4469    case OP_CHAR:    case OP_CHAR:
4470    case OP_CHARI:    case OP_CHARI:
4471    length = 1;    length = 1;
4472  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
4473    if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc);    if (common->utf && HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc);
4474  #endif  #endif
4475    if (common->mode == JIT_COMPILE && (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0))    if (common->mode == JIT_COMPILE && (type == OP_CHAR || !char_has_othercase(common, cc) || char_get_othercase_bit(common, cc) != 0))
# Line 4662  do Line 4664  do
4664    if (*cc == OP_CHAR)    if (*cc == OP_CHAR)
4665      {      {
4666      size = 1;      size = 1;
4667  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
4668      if (common->utf && HAS_EXTRALEN(cc[1]))      if (common->utf && HAS_EXTRALEN(cc[1]))
4669        size += GET_EXTRALEN(cc[1]);        size += GET_EXTRALEN(cc[1]);
4670  #endif  #endif
# Line 4675  do Line 4677  do
4677        {        {
4678        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)
4679          size = 0;          size = 0;
 #ifndef COMPILE_PCRE32  
4680        else if (HAS_EXTRALEN(cc[1]))        else if (HAS_EXTRALEN(cc[1]))
4681          size += GET_EXTRALEN(cc[1]);          size += GET_EXTRALEN(cc[1]);
 #endif  
4682        }        }
4683      else      else
4684  #endif  #endif
# Line 6266  if (*type == 0) Line 6266  if (*type == 0)
6266  if (end != NULL)  if (end != NULL)
6267    {    {
6268    *end = cc + 1;    *end = cc + 1;
6269  #if defined SUPPORT_UTF && !defined COMPILE_PCRE32  #ifdef SUPPORT_UTF
6270    if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc);    if (common->utf && HAS_EXTRALEN(*cc)) *end += GET_EXTRALEN(*cc);
6271  #endif  #endif
6272    }    }

Legend:
Removed from v.1084  
changed lines
  Added in v.1121

  ViewVC Help
Powered by ViewVC 1.1.5