/[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 785 by zherczeg, Mon Dec 5 20:12:24 2011 UTC revision 786 by zherczeg, Tue Dec 6 11:33:41 2011 UTC
# Line 297  typedef struct compiler_common { Line 297  typedef struct compiler_common {
297    jump_list *casefulcmp;    jump_list *casefulcmp;
298    jump_list *caselesscmp;    jump_list *caselesscmp;
299    BOOL jscript_compat;    BOOL jscript_compat;
300  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
301    BOOL utf;    BOOL utf;
302  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
303    BOOL use_ucp;    BOOL use_ucp;
# Line 306  typedef struct compiler_common { Line 306  typedef struct compiler_common {
306  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
307    jump_list *utfreadtype8;    jump_list *utfreadtype8;
308  #endif  #endif
309  #endif /* SUPPORT_UTF8 */  #endif /* SUPPORT_UTF */
310  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
311    jump_list *getucd;    jump_list *getucd;
312  #endif  #endif
# Line 500  switch(*cc) Line 500  switch(*cc)
500    return cc + 1;    return cc + 1;
501    
502    case OP_ANYBYTE:    case OP_ANYBYTE:
503  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
504    if (common->utf) return NULL;    if (common->utf) return NULL;
505  #endif  #endif
506    return cc + 1;    return cc + 1;
# Line 576  switch(*cc) Line 576  switch(*cc)
576    
577    case OP_NOTPROP:    case OP_NOTPROP:
578    case OP_PROP:    case OP_PROP:
579      return cc + 1 + 2;
580    
581    case OP_TYPEUPTO:    case OP_TYPEUPTO:
582    case OP_TYPEMINUPTO:    case OP_TYPEMINUPTO:
583    case OP_TYPEEXACT:    case OP_TYPEEXACT:
# Line 1267  static SLJIT_INLINE BOOL char_has_otherc Line 1269  static SLJIT_INLINE BOOL char_has_otherc
1269  /* Detects if the character has an othercase. */  /* Detects if the character has an othercase. */
1270  unsigned int c;  unsigned int c;
1271    
1272  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
1273  if (common->utf)  if (common->utf)
1274    {    {
1275    GETCHAR(c, cc);    GETCHAR(c, cc);
# Line 1279  if (common->utf) Line 1281  if (common->utf)
1281      return FALSE;      return FALSE;
1282  #endif  #endif
1283      }      }
1284    #ifndef COMPILE_PCRE8
1285      return common->fcc[c] != c;
1286    #endif
1287    }    }
1288  else  else
1289  #endif  #endif
# Line 1769  if (newlinecheck) Line 1774  if (newlinecheck)
1774    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
1775    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, common->newline & 0xff);    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, common->newline & 0xff);
1776    COND_VALUE(SLJIT_MOV, TMP1, 0, SLJIT_C_EQUAL);    COND_VALUE(SLJIT_MOV, TMP1, 0, SLJIT_C_EQUAL);
1777    #ifdef COMPILE_PCRE16
1778      OP2(SLJIT_SHL, TMP1, 0, TMP1, 0, SLJIT_IMM, 1);
1779    #endif
1780    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
1781    nl = JUMP(SLJIT_JUMP);    nl = JUMP(SLJIT_JUMP);
1782    }    }
# Line 1776  if (newlinecheck) Line 1784  if (newlinecheck)
1784  mainloop = LABEL();  mainloop = LABEL();
1785    
1786  /* 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. */
1787  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
1788  if (common->utf) readuchar = TRUE;  if (common->utf) readuchar = TRUE;
1789  #endif  #endif
1790  if (newlinecheck) readuchar = TRUE;  if (newlinecheck) readuchar = TRUE;
# Line 1843  if (caseless) Line 1851  if (caseless)
1851    {    {
1852    oc = TABLE_GET(first_char, common->fcc, first_char);    oc = TABLE_GET(first_char, common->fcc, first_char);
1853  #if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)  #if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)
1854    if (first_char > 127 && common->utf && common->use_ucp)    if (first_char > 127 && common->utf)
1855      oc = UCD_OTHERCASE(first_char);      oc = UCD_OTHERCASE(first_char);
1856  #endif  #endif
1857    }    }
# Line 2077  if (caseless) Line 2085  if (caseless)
2085    {    {
2086    oc = TABLE_GET(req_char, common->fcc, req_char);    oc = TABLE_GET(req_char, common->fcc, req_char);
2087  #if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)  #if defined SUPPORT_UCP && !(defined COMPILE_PCRE8)
2088    if (req_char > 127 && common->utf && common->use_ucp)    if (req_char > 127 && common->utf)
2089      oc = UCD_OTHERCASE(req_char);      oc = UCD_OTHERCASE(req_char);
2090  #endif  #endif
2091    }    }
# Line 2265  OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_I Line 2273  OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_I
2273  OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a);  OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a);
2274  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_LESS_EQUAL);  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_LESS_EQUAL);
2275  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);
2276  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
2277  if (common->utf)  if (common->utf)
2278    {    {
2279    COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);    COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);
# Line 2289  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_E Line 2297  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_E
2297  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x20);  OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x20);
2298  COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);  COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);
2299  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);
2300  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
2301  if (common->utf)  if (common->utf)
2302    {    {
2303    COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);    COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);
# Line 2323  OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_I Line 2331  OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_I
2331  OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a);  OP2(SLJIT_SUB | SLJIT_SET_U, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, 0x0d - 0x0a);
2332  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_LESS_EQUAL);  COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_LESS_EQUAL);
2333  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);
2334  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
2335  if (common->utf)  if (common->utf)
2336    {    {
2337    COND_VALUE(SLJIT_OR | SLJIT_SET_E, TMP2, 0, SLJIT_C_EQUAL);    COND_VALUE(SLJIT_OR | SLJIT_SET_E, TMP2, 0, SLJIT_C_EQUAL);
# Line 2415  sljit_emit_fast_return(compiler, RETURN_ Line 2423  sljit_emit_fast_return(compiler, RETURN_
2423  #undef CHAR1  #undef CHAR1
2424  #undef CHAR2  #undef CHAR2
2425    
2426  #ifdef SUPPORT_UTF8  #if defined SUPPORT_UTF && defined SUPPORT_UCP
 #ifdef SUPPORT_UCP  
2427    
2428  static const pcre_uchar *SLJIT_CALL do_utf_caselesscmp(pcre_uchar *src1, jit_arguments *args, pcre_uchar *end1)  static const pcre_uchar *SLJIT_CALL do_utf_caselesscmp(pcre_uchar *src1, jit_arguments *args, pcre_uchar *end1)
2429  {  {
# Line 2436  while (src1 < end1) Line 2443  while (src1 < end1)
2443  return src2;  return src2;
2444  }  }
2445    
2446  #endif  #endif /* SUPPORT_UTF && SUPPORT_UCP */
 #endif  
2447    
2448  static pcre_uchar *byte_sequence_compare(compiler_common *common, BOOL caseless, pcre_uchar *cc,  static pcre_uchar *byte_sequence_compare(compiler_common *common, BOOL caseless, pcre_uchar *cc,
2449      compare_context* context, jump_list **fallbacks)      compare_context* context, jump_list **fallbacks)
# Line 2445  static pcre_uchar *byte_sequence_compare Line 2451  static pcre_uchar *byte_sequence_compare
2451  DEFINE_COMPILER;  DEFINE_COMPILER;
2452  unsigned int othercasebit = 0;  unsigned int othercasebit = 0;
2453  pcre_uchar *othercasechar = NULL;  pcre_uchar *othercasechar = NULL;
2454  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
2455  int utflength;  int utflength;
2456  #endif  #endif
2457    
# Line 2588  do Line 2594  do
2594  #endif  #endif
2595    
2596    cc++;    cc++;
2597  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
2598    utflength--;    utflength--;
2599    }    }
2600  while (utflength > 0);  while (utflength > 0);
# Line 2646  if ((*cc++ & XCL_MAP) != 0) Line 2652  if ((*cc++ & XCL_MAP) != 0)
2652    OP1(SLJIT_MOV, TMP3, 0, TMP1, 0);    OP1(SLJIT_MOV, TMP3, 0, TMP1, 0);
2653  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
2654    jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);    jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);
2655  #elif defined SUPPORT_UTF8  #elif defined SUPPORT_UTF
2656    if (common->utf)    if (common->utf)
2657      jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);      jump = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);
2658  #endif  #endif
# Line 2660  if ((*cc++ & XCL_MAP) != 0) Line 2666  if ((*cc++ & XCL_MAP) != 0)
2666    
2667  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
2668    JUMPHERE(jump);    JUMPHERE(jump);
2669  #elif defined SUPPORT_UTF8  #elif defined SUPPORT_UTF
2670    if (common->utf)    if (common->utf)
2671      JUMPHERE(jump);      JUMPHERE(jump);
2672  #endif  #endif
# Line 2795  while (*cc != XCL_END) Line 2801  while (*cc != XCL_END)
2801    if (*cc == XCL_SINGLE)    if (*cc == XCL_SINGLE)
2802      {      {
2803      cc ++;      cc ++;
2804  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
2805      if (common->utf)      if (common->utf)
2806        {        {
2807        GETCHARINC(c, cc);        GETCHARINC(c, cc);
# Line 2826  while (*cc != XCL_END) Line 2832  while (*cc != XCL_END)
2832    else if (*cc == XCL_RANGE)    else if (*cc == XCL_RANGE)
2833      {      {
2834      cc ++;      cc ++;
2835  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
2836      if (common->utf)      if (common->utf)
2837        {        {
2838        GETCHARINC(c, cc);        GETCHARINC(c, cc);
# Line 2835  while (*cc != XCL_END) Line 2841  while (*cc != XCL_END)
2841  #endif  #endif
2842        c = *cc++;        c = *cc++;
2843      SET_CHAR_OFFSET(c);      SET_CHAR_OFFSET(c);
2844  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
2845      if (common->utf)      if (common->utf)
2846        {        {
2847        GETCHARINC(c, cc);        GETCHARINC(c, cc);
# Line 2963  int length; Line 2969  int length;
2969  unsigned int c, oc, bit;  unsigned int c, oc, bit;
2970  compare_context context;  compare_context context;
2971  struct sljit_jump *jump[4];  struct sljit_jump *jump[4];
2972  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
2973  struct sljit_label *label;  struct sljit_label *label;
2974  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
2975  pcre_uchar propdata[5];  pcre_uchar propdata[5];
# Line 3063  switch(type) Line 3069  switch(type)
3069    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));
3070    return cc;    return cc;
3071    
3072  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
3073  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3074    case OP_NOTPROP:    case OP_NOTPROP:
3075    case OP_PROP:    case OP_PROP:
# Line 3279  switch(type) Line 3285  switch(type)
3285      }      }
3286    check_input_end(common, fallbacks);    check_input_end(common, fallbacks);
3287    read_char(common);    read_char(common);
3288  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
3289    if (common->utf)    if (common->utf)
3290      {      {
3291      GETCHAR(c, cc);      GETCHAR(c, cc);
# Line 3296  switch(type) Line 3302  switch(type)
3302    
3303    case OP_NOT:    case OP_NOT:
3304    case OP_NOTI:    case OP_NOTI:
3305      check_input_end(common, fallbacks);
3306      length = 1;
3307  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
3308    if (common->utf)    if (common->utf)
3309      {      {
3310      length = 1;  #ifdef COMPILE_PCRE8
3311      if (HAS_EXTRALEN(*cc)) length += GET_EXTRALEN(*cc);      c = *cc;
3312        if (c < 128)
     check_input_end(common, fallbacks);  
     GETCHAR(c, cc);  
   
     if (c <= 127)  
3313        {        {
3314        OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);        OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
3315        if (type == OP_NOT || !char_has_othercase(common, cc))        if (type == OP_NOT || !char_has_othercase(common, cc))
# Line 3317  switch(type) Line 3321  switch(type)
3321          add_jump(compiler, fallbacks, CMP(SLJIT_C_EQUAL, TMP2, 0, SLJIT_IMM, c | 0x20));          add_jump(compiler, fallbacks, CMP(SLJIT_C_EQUAL, TMP2, 0, SLJIT_IMM, c | 0x20));
3322          }          }
3323        /* Skip the variable-length character. */        /* Skip the variable-length character. */
3324        OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, 1);        OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));
3325        jump[0] = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);        jump[0] = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 0xc0);
3326  #ifdef COMPILE_PCRE8        OP1(MOV_UCHAR, 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);  
 #endif  
3327        OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);        OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
3328        JUMPHERE(jump[0]);        JUMPHERE(jump[0]);
3329        return cc + length;        return cc + 1;
3330        }        }
3331      else      else
3332    #endif /* COMPILE_PCRE8 */
3333          {
3334          GETCHARLEN(c, cc, length);
3335        read_char(common);        read_char(common);
3336          }
3337      }      }
3338    else    else
3339  #endif  #endif /* SUPPORT_UTF */
3340      {      {
3341      OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(1));      read_char(common);
     add_jump(compiler, fallbacks, CMP(SLJIT_C_GREATER, STR_PTR, 0, STR_END, 0));  
     OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));  
3342      c = *cc;      c = *cc;
3343      }      }
3344    
# Line 3363  switch(type) Line 3367  switch(type)
3367    read_char(common);    read_char(common);
3368  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
3369    jump[0] = NULL;    jump[0] = NULL;
3370  #ifdef SUPPORT_UTF8  #ifdef COMPILE_PCRE8
3371    /* This check can only be skipped in pure 8 bit mode. */    /* This check only affects 8 bit mode. In other modes, we
3372      always need to compare the value with 255. */
3373    if (common->utf)    if (common->utf)
3374  #endif  #endif /* COMPILE_PCRE8 */
3375      {      {
3376      jump[0] = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);      jump[0] = CMP(SLJIT_C_GREATER, TMP1, 0, SLJIT_IMM, 255);
3377      if (type == OP_CLASS)      if (type == OP_CLASS)
# Line 3375  switch(type) Line 3380  switch(type)
3380        jump[0] = NULL;        jump[0] = NULL;
3381        }        }
3382      }      }
3383  #endif  #endif /* SUPPORT_UTF || !COMPILE_PCRE8 */
3384    OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);    OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
3385    OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);    OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
3386    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)cc);    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)cc);
# Line 3385  switch(type) Line 3390  switch(type)
3390  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
3391    if (jump[0] != NULL)    if (jump[0] != NULL)
3392      JUMPHERE(jump[0]);      JUMPHERE(jump[0]);
3393  #endif  #endif /* SUPPORT_UTF || !COMPILE_PCRE8 */
3394    return cc + 32 / sizeof(pcre_uchar);    return cc + 32 / sizeof(pcre_uchar);
3395    
3396  #if defined SUPPORT_UTF || defined COMPILE_PCRE16  #if defined SUPPORT_UTF || defined COMPILE_PCRE16
# Line 3399  switch(type) Line 3404  switch(type)
3404    SLJIT_ASSERT(length > 0);    SLJIT_ASSERT(length > 0);
3405    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);    OP1(SLJIT_MOV, TMP1, 0, ARGUMENTS, 0);
3406    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));
3407  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
3408    if (common->utf)    if (common->utf)
3409      {      {
3410      OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, length);      OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, length);
# Line 3411  switch(type) Line 3416  switch(type)
3416      return cc + LINK_SIZE;      return cc + LINK_SIZE;
3417      }      }
3418  #endif  #endif
3419    OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, length);    OP2(SLJIT_SUB, STR_PTR, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(length));
3420    add_jump(compiler, fallbacks, CMP(SLJIT_C_LESS, STR_PTR, 0, TMP1, 0));    add_jump(compiler, fallbacks, CMP(SLJIT_C_LESS, STR_PTR, 0, TMP1, 0));
3421    return cc + LINK_SIZE;    return cc + LINK_SIZE;
3422    }    }
# Line 3548  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT Line 3553  OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT
3553  if (withchecks && !common->jscript_compat)  if (withchecks && !common->jscript_compat)
3554    add_jump(compiler, fallbacks, CMP(SLJIT_C_EQUAL, TMP1, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(1)));    add_jump(compiler, fallbacks, CMP(SLJIT_C_EQUAL, TMP1, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(1)));
3555    
3556  #ifdef SUPPORT_UTF8  #if defined SUPPORT_UTF && defined SUPPORT_UCP
 #ifdef SUPPORT_UCP  
3557  if (common->utf && *cc == OP_REFI)  if (common->utf && *cc == OP_REFI)
3558    {    {
3559    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);
# Line 3567  if (common->utf && *cc == OP_REFI) Line 3571  if (common->utf && *cc == OP_REFI)
3571    OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0);    OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_RETURN_REG, 0);
3572    }    }
3573  else  else
3574  #endif  #endif /* SUPPORT_UTF && SUPPORT_UCP */
 #endif  
3575    {    {
3576    OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(offset + 1), TMP1, 0);    OP2(SLJIT_SUB | SLJIT_SET_E, TMP2, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), OVECTOR(offset + 1), TMP1, 0);
3577    if (withchecks)    if (withchecks)
# Line 6422  common->vspace = NULL; Line 6425  common->vspace = NULL;
6425  common->casefulcmp = NULL;  common->casefulcmp = NULL;
6426  common->caselesscmp = NULL;  common->caselesscmp = NULL;
6427  common->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;  common->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;
6428  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
6429  /* PCRE_UTF16 has the same value as PCRE_UTF8. */  /* PCRE_UTF16 has the same value as PCRE_UTF8. */
6430  common->utf = (re->options & PCRE_UTF8) != 0;  common->utf = (re->options & PCRE_UTF8) != 0;
6431  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
# Line 6432  common->utfreadchar = NULL; Line 6435  common->utfreadchar = NULL;
6435  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
6436  common->utfreadtype8 = NULL;  common->utfreadtype8 = NULL;
6437  #endif  #endif
6438  #endif /* SUPPORT_UTF8 */  #endif /* SUPPORT_UTF */
6439  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
6440  common->getucd = NULL;  common->getucd = NULL;
6441  #endif  #endif

Legend:
Removed from v.785  
changed lines
  Added in v.786

  ViewVC Help
Powered by ViewVC 1.1.5