/[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 1009 by zherczeg, Wed Aug 22 12:01:22 2012 UTC revision 1012 by zherczeg, Sat Aug 25 15:34:13 2012 UTC
# Line 900  while (cc < ccend) Line 900  while (cc < ccend)
900  #endif  #endif
901    
902      case OP_RECURSE:      case OP_RECURSE:
     alternative = common->start + GET(cc, 1);  
     if (alternative != common->start)  
       common->optimized_cbracket[GET2(alternative, 1 + LINK_SIZE)] = 0;  
903      /* Set its value only once. */      /* Set its value only once. */
904      if (common->recursive_head == 0)      if (common->recursive_head == 0)
905        {        {
# Line 1304  while (cc < ccend) Line 1301  while (cc < ccend)
1301    
1302      case OP_CBRAPOS:      case OP_CBRAPOS:
1303      case OP_SCBRAPOS:      case OP_SCBRAPOS:
     SLJIT_ASSERT(common->optimized_cbracket[GET2(cc, 1 + LINK_SIZE)] == 0);  
1304      private_data_length += 2;      private_data_length += 2;
1305      cc += 1 + LINK_SIZE + IMM2_SIZE;      cc += 1 + LINK_SIZE + IMM2_SIZE;
1306      break;      break;
# Line 4223  switch(type) Line 4219  switch(type)
4219    detect_partial_match(common, backtracks);    detect_partial_match(common, backtracks);
4220    read_char(common);    read_char(common);
4221    add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL));    add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL));
4222    OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Mc);    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_w)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, gbprop));
4223    add_jump(compiler, backtracks, CMP(SLJIT_C_LESS_EQUAL, TMP1, 0, SLJIT_IMM, ucp_Mn - ucp_Mc));    OP1(SLJIT_MOV_UB, TMP3, 0, SLJIT_MEM2(TMP1, TMP2), 3);
4224    
4225    label = LABEL();    label = LABEL();
4226    jump[0] = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);    jump[0] = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
4227    OP1(SLJIT_MOV, TMP3, 0, STR_PTR, 0);    OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS0, STR_PTR, 0);
4228    read_char(common);    read_char(common);
4229    add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL));    add_jump(compiler, &common->getucd, JUMP(SLJIT_FAST_CALL));
4230    OP2(SLJIT_SUB, TMP1, 0, TMP1, 0, SLJIT_IMM, ucp_Mc);    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, (sljit_w)PRIV(ucd_records) + SLJIT_OFFSETOF(ucd_record, gbprop));
4231    CMPTO(SLJIT_C_LESS_EQUAL, TMP1, 0, SLJIT_IMM, ucp_Mn - ucp_Mc, label);    OP1(SLJIT_MOV_UB, TMP2, 0, SLJIT_MEM2(TMP1, TMP2), 3);
4232    
4233    OP1(SLJIT_MOV, STR_PTR, 0, TMP3, 0);    OP2(SLJIT_MUL, TMP1, 0, TMP3, 0, SLJIT_IMM, ucp_gbCount);
4234      OP1(SLJIT_MOV, TMP3, 0, TMP2, 0);
4235      OP2(SLJIT_ADD, TMP1, 0, TMP1, 0, TMP2, 0);
4236      OP1(SLJIT_MOV_UB, TMP1, 0, SLJIT_MEM1(TMP1), (sljit_w)PRIV(ucp_gbtable));
4237      CMPTO(SLJIT_C_NOT_EQUAL, TMP1, 0, SLJIT_IMM, 0, label);
4238    
4239      OP1(SLJIT_MOV, STR_PTR, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS0);
4240    JUMPHERE(jump[0]);    JUMPHERE(jump[0]);
4241    if (common->mode == JIT_PARTIAL_HARD_COMPILE)    if (common->mode == JIT_PARTIAL_HARD_COMPILE)
4242      {      {
# Line 5937  switch(opcode) Line 5939  switch(opcode)
5939    case OP_CBRAPOS:    case OP_CBRAPOS:
5940    case OP_SCBRAPOS:    case OP_SCBRAPOS:
5941    offset = GET2(cc, 1 + LINK_SIZE);    offset = GET2(cc, 1 + LINK_SIZE);
5942      /* This case cannot be optimized in the same was as
5943      normal capturing brackets. */
5944      SLJIT_ASSERT(common->optimized_cbracket[offset] == 0);
5945    cbraprivptr = OVECTOR_PRIV(offset);    cbraprivptr = OVECTOR_PRIV(offset);
5946    offset <<= 1;    offset <<= 1;
5947    ccbegin = cc + 1 + LINK_SIZE + IMM2_SIZE;    ccbegin = cc + 1 + LINK_SIZE + IMM2_SIZE;

Legend:
Removed from v.1009  
changed lines
  Added in v.1012

  ViewVC Help
Powered by ViewVC 1.1.5