/[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 1242 by zherczeg, Sat Jan 26 17:51:43 2013 UTC revision 1244 by zherczeg, Tue Feb 5 12:03:43 2013 UTC
# Line 2877  if (firstline) Line 2877  if (firstline)
2877    OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);    OP1(SLJIT_MOV, STR_END, 0, TMP3, 0);
2878  }  }
2879    
2880    static BOOL check_class_ranges(compiler_common *common, const pcre_uint8 *bits, BOOL nclass, jump_list **backtracks);
2881    
2882  static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common, sljit_uw start_bits, BOOL firstline)  static SLJIT_INLINE void fast_forward_start_bits(compiler_common *common, sljit_uw start_bits, BOOL firstline)
2883  {  {
2884  DEFINE_COMPILER;  DEFINE_COMPILER;
2885  struct sljit_label *start;  struct sljit_label *start;
2886  struct sljit_jump *quit;  struct sljit_jump *quit;
2887  struct sljit_jump *found;  struct sljit_jump *found = NULL;
2888    jump_list *matches = NULL;
2889    pcre_uint8 inverted_start_bits[32];
2890    int i;
2891  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
2892  struct sljit_jump *jump;  struct sljit_jump *jump;
2893  #endif  #endif
2894    
2895    for (i = 0; i < 32; ++i)
2896      inverted_start_bits[i] = ~(((pcre_uint8*)start_bits)[i]);
2897    
2898  if (firstline)  if (firstline)
2899    {    {
2900    SLJIT_ASSERT(common->first_line_end != 0);    SLJIT_ASSERT(common->first_line_end != 0);
# Line 2901  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_P Line 2909  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_P
2909  if (common->utf)  if (common->utf)
2910    OP1(SLJIT_MOV, TMP3, 0, TMP1, 0);    OP1(SLJIT_MOV, TMP3, 0, TMP1, 0);
2911  #endif  #endif
2912    
2913    if (!check_class_ranges(common, inverted_start_bits, (inverted_start_bits[31] & 0x80) != 0, &matches))
2914      {
2915  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
2916  jump = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 255);    jump = CMP(SLJIT_C_LESS, TMP1, 0, SLJIT_IMM, 255);
2917  OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 255);    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, 255);
2918  JUMPHERE(jump);    JUMPHERE(jump);
2919  #endif  #endif
2920  OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);    OP2(SLJIT_AND, TMP2, 0, TMP1, 0, SLJIT_IMM, 0x7);
2921  OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);    OP2(SLJIT_LSHR, TMP1, 0, TMP1, 0, SLJIT_IMM, 3);
2922  OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), start_bits);    OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), start_bits);
2923  OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);    OP2(SLJIT_SHL, TMP2, 0, SLJIT_IMM, 1, TMP2, 0);
2924  OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);    OP2(SLJIT_AND | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, TMP2, 0);
2925  found = JUMP(SLJIT_C_NOT_ZERO);    found = JUMP(SLJIT_C_NOT_ZERO);
2926      }
2927    
2928  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
2929  if (common->utf)  if (common->utf)
# Line 2939  if (common->utf) Line 2951  if (common->utf)
2951  #endif /* COMPILE_PCRE[8|16] */  #endif /* COMPILE_PCRE[8|16] */
2952  #endif /* SUPPORT_UTF */  #endif /* SUPPORT_UTF */
2953  JUMPTO(SLJIT_JUMP, start);  JUMPTO(SLJIT_JUMP, start);
2954  JUMPHERE(found);  if (found != NULL)
2955      JUMPHERE(found);
2956    if (matches != NULL)
2957      set_jumps(matches, LABEL());
2958  JUMPHERE(quit);  JUMPHERE(quit);
2959    
2960  if (firstline)  if (firstline)

Legend:
Removed from v.1242  
changed lines
  Added in v.1244

  ViewVC Help
Powered by ViewVC 1.1.5