/[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 1040 by zherczeg, Sun Sep 16 06:52:27 2012 UTC revision 1047 by zherczeg, Fri Sep 28 15:06:38 2012 UTC
# Line 3481  sljit_emit_fast_return(compiler, RETURN_ Line 3481  sljit_emit_fast_return(compiler, RETURN_
3481  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)
3482  {  {
3483  /* This function would be ineffective to do in JIT level. */  /* This function would be ineffective to do in JIT level. */
3484  int c1, c2;  pcre_uint32 c1, c2;
3485  const pcre_uchar *src2 = args->uchar_ptr;  const pcre_uchar *src2 = args->uchar_ptr;
3486  const pcre_uchar *end2 = args->end;  const pcre_uchar *end2 = args->end;
3487    const ucd_record *ur;
3488    const pcre_uint32 *pp;
3489    
3490  while (src1 < end1)  while (src1 < end1)
3491    {    {
# Line 3491  while (src1 < end1) Line 3493  while (src1 < end1)
3493      return (pcre_uchar*)1;      return (pcre_uchar*)1;
3494    GETCHARINC(c1, src1);    GETCHARINC(c1, src1);
3495    GETCHARINC(c2, src2);    GETCHARINC(c2, src2);
3496    if (c1 != c2 && c1 != UCD_OTHERCASE(c2)) return NULL;    ur = GET_UCD(c2);
3497      if (c1 != c2 && c1 != c2 + ur->other_case)
3498        {
3499        pp = PRIV(ucd_caseless_sets) + ur->caseset;
3500        for (;;)
3501          {
3502          if (c1 < *pp) return NULL;
3503          if (c1 == *pp++) break;
3504          }
3505        }
3506    }    }
3507  return src2;  return src2;
3508  }  }
# Line 3683  static void compile_xclass_matchingpath( Line 3694  static void compile_xclass_matchingpath(
3694  DEFINE_COMPILER;  DEFINE_COMPILER;
3695  jump_list *found = NULL;  jump_list *found = NULL;
3696  jump_list **list = (*cc & XCL_NOT) == 0 ? &found : backtracks;  jump_list **list = (*cc & XCL_NOT) == 0 ? &found : backtracks;
3697  unsigned int c;  pcre_int32 c, charoffset;
3698  int compares;  const pcre_uint32 *other_cases;
3699  struct sljit_jump *jump = NULL;  struct sljit_jump *jump = NULL;
3700  pcre_uchar *ccbegin;  pcre_uchar *ccbegin;
3701    int compares, invertcmp, numberofcmps;
3702  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
3703  BOOL needstype = FALSE, needsscript = FALSE, needschar = FALSE;  BOOL needstype = FALSE, needsscript = FALSE, needschar = FALSE;
3704  BOOL charsaved = FALSE;  BOOL charsaved = FALSE;
3705  int typereg = TMP1, scriptreg = TMP1;  int typereg = TMP1, scriptreg = TMP1;
3706  unsigned int typeoffset;  unsigned int typeoffset;
3707  #endif  #endif
 int invertcmp, numberofcmps;  
 unsigned int charoffset;  
3708    
3709  /* Although SUPPORT_UTF must be defined, we are  /* Although SUPPORT_UTF must be defined, we are
3710     not necessary in utf mode even in 8 bit mode. */     not necessary in utf mode even in 8 bit mode. */
# Line 3792  while (*cc != XCL_END) Line 3802  while (*cc != XCL_END)
3802        needschar = TRUE;        needschar = TRUE;
3803        break;        break;
3804    
3805          case PT_CLIST:
3806          needschar = TRUE;
3807          break;
3808    
3809        default:        default:
3810        SLJIT_ASSERT_STOP();        SLJIT_ASSERT_STOP();
3811        break;        break;
# Line 4001  while (*cc != XCL_END) Line 4015  while (*cc != XCL_END)
4015        COND_VALUE(SLJIT_OR | SLJIT_SET_E, TMP2, 0, SLJIT_C_LESS_EQUAL);        COND_VALUE(SLJIT_OR | SLJIT_SET_E, TMP2, 0, SLJIT_C_LESS_EQUAL);
4016        jump = JUMP(SLJIT_C_NOT_ZERO ^ invertcmp);        jump = JUMP(SLJIT_C_NOT_ZERO ^ invertcmp);
4017        break;        break;
4018    
4019          case PT_CLIST:
4020          other_cases = PRIV(ucd_caseless_sets) + cc[1];
4021    
4022          OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, *other_cases++ - charoffset);
4023          COND_VALUE(SLJIT_MOV, TMP2, 0, SLJIT_C_EQUAL);
4024    
4025          while (*other_cases < NOTACHAR)
4026            {
4027            OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_UNUSED, 0, TMP1, 0, SLJIT_IMM, *other_cases++ - charoffset);
4028            COND_VALUE(SLJIT_OR, TMP2, 0, SLJIT_C_EQUAL);
4029            }
4030          jump = JUMP(SLJIT_C_NOT_ZERO ^ invertcmp);
4031          break;
4032        }        }
4033      cc += 2;      cc += 2;
4034      }      }

Legend:
Removed from v.1040  
changed lines
  Added in v.1047

  ViewVC Help
Powered by ViewVC 1.1.5