/[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 1290 by zherczeg, Sat Mar 16 18:45:51 2013 UTC revision 1291 by zherczeg, Sun Mar 17 05:27:48 2013 UTC
# Line 2118  while (current != NULL) Line 2118  while (current != NULL)
2118  return -1;  return -1;
2119  }  }
2120    
 static sljit_sw SLJIT_CALL do_search_then_trap(sljit_sw *current, sljit_sw start)  
 {  
 do  
   {  
   SLJIT_ASSERT(current != NULL);  
   switch (current[-2])  
     {  
     case type_then_trap:  
     if (current[-3] == start)  
       return (sljit_sw)current;  
     break;  
   
     case type_mark:  
     break;  
   
     default:  
     SLJIT_ASSERT_STOP();  
     break;  
     }  
   current = (sljit_sw*)current[-1];  
   }  
 while (TRUE);  
 }  
   
2121  static SLJIT_INLINE void copy_ovector(compiler_common *common, int topbracket)  static SLJIT_INLINE void copy_ovector(compiler_common *common, int topbracket)
2122  {  {
2123  DEFINE_COMPILER;  DEFINE_COMPILER;
# Line 8347  static SLJIT_INLINE void compile_control Line 8323  static SLJIT_INLINE void compile_control
8323  {  {
8324  DEFINE_COMPILER;  DEFINE_COMPILER;
8325  pcre_uchar opcode = *current->cc;  pcre_uchar opcode = *current->cc;
8326    struct sljit_label *loop;
8327    struct sljit_jump *jump;
8328    
8329  if ((opcode == OP_THEN || opcode == OP_THEN_ARG) && common->then_trap != NULL)  if ((opcode == OP_THEN || opcode == OP_THEN_ARG) && common->then_trap != NULL)
8330    {    {
8331    SLJIT_ASSERT(common->control_head_ptr != 0);    SLJIT_ASSERT(common->control_head_ptr != 0);
   OP1(SLJIT_MOV, TMP1, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), common->control_head_ptr);  
   OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS0, STACK_TOP, 0);  
   OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_IMM, common->then_trap->start);  
   sljit_emit_ijump(compiler, SLJIT_CALL2, SLJIT_IMM, SLJIT_FUNC_OFFSET(do_search_then_trap));  
   OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), LOCALS0);  
8332    
8333    OP1(SLJIT_MOV, TMP2, 0, TMP1, 0);    OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), common->control_head_ptr);
8334    OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_NOMATCH);    OP1(SLJIT_MOV, TMP1, 0, SLJIT_IMM, type_then_trap);
8335    if (common->quit_label == NULL)    OP1(SLJIT_MOV, TMP2, 0, SLJIT_IMM, common->then_trap->start);
8336      add_jump(compiler, &common->quit, CMP(SLJIT_C_EQUAL, TMP2, 0, SLJIT_IMM, 0));    jump = JUMP(SLJIT_JUMP);
   else  
     CMPTO(SLJIT_C_EQUAL, TMP2, 0, SLJIT_IMM, 0, common->quit_label);  
8337    
8338    OP1(SLJIT_MOV, STACK_TOP, 0, TMP2, 0);    loop = LABEL();
8339      OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(STACK_TOP), -(int)sizeof(sljit_sw));
8340      JUMPHERE(jump);
8341      CMPTO(SLJIT_C_NOT_EQUAL, SLJIT_MEM1(STACK_TOP), -(int)(2 * sizeof(sljit_sw)), TMP1, 0, loop);
8342      CMPTO(SLJIT_C_NOT_EQUAL, SLJIT_MEM1(STACK_TOP), -(int)(3 * sizeof(sljit_sw)), TMP2, 0, loop);
8343    add_jump(compiler, &common->then_trap->quit, JUMP(SLJIT_JUMP));    add_jump(compiler, &common->then_trap->quit, JUMP(SLJIT_JUMP));
8344    return;    return;
8345    }    }

Legend:
Removed from v.1290  
changed lines
  Added in v.1291

  ViewVC Help
Powered by ViewVC 1.1.5