/[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 990 by zherczeg, Sun Jul 8 16:32:22 2012 UTC revision 991 by zherczeg, Sun Jul 8 16:44:39 2012 UTC
# Line 181  typedef struct stub_list { Line 181  typedef struct stub_list {
181    enum stub_types type;    enum stub_types type;
182    int data;    int data;
183    struct sljit_jump *start;    struct sljit_jump *start;
184    struct sljit_label *leave;    struct sljit_label *quit;
185    struct stub_list *next;    struct stub_list *next;
186  } stub_list;  } stub_list;
187    
# Line 314  typedef struct compiler_common { Line 314  typedef struct compiler_common {
314    
315    /* Labels and jump lists. */    /* Labels and jump lists. */
316    struct sljit_label *partialmatchlabel;    struct sljit_label *partialmatchlabel;
317    struct sljit_label *leavelabel;    struct sljit_label *quitlabel;
318    struct sljit_label *acceptlabel;    struct sljit_label *acceptlabel;
319    stub_list *stubs;    stub_list *stubs;
320    recurse_entry *entries;    recurse_entry *entries;
321    recurse_entry *currententry;    recurse_entry *currententry;
322    jump_list *partialmatch;    jump_list *partialmatch;
323    jump_list *leave;    jump_list *quit;
324    jump_list *accept;    jump_list *accept;
325    jump_list *calllimit;    jump_list *calllimit;
326    jump_list *stackalloc;    jump_list *stackalloc;
# Line 1680  if (list_item) Line 1680  if (list_item)
1680    list_item->type = type;    list_item->type = type;
1681    list_item->data = data;    list_item->data = data;
1682    list_item->start = start;    list_item->start = start;
1683    list_item->leave = LABEL();    list_item->quit = LABEL();
1684    list_item->next = common->stubs;    list_item->next = common->stubs;
1685    common->stubs = list_item;    common->stubs = list_item;
1686    }    }
# Line 1700  while (list_item) Line 1700  while (list_item)
1700      add_jump(compiler, &common->stackalloc, JUMP(SLJIT_FAST_CALL));      add_jump(compiler, &common->stackalloc, JUMP(SLJIT_FAST_CALL));
1701      break;      break;
1702      }      }
1703    JUMPTO(SLJIT_JUMP, list_item->leave);    JUMPTO(SLJIT_JUMP, list_item->quit);
1704    list_item = list_item->next;    list_item = list_item->next;
1705    }    }
1706  common->stubs = NULL;  common->stubs = NULL;
# Line 1810  else Line 1810  else
1810    OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, 1);    OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, 1);
1811  }  }
1812    
1813  static SLJIT_INLINE void return_with_partial_match(compiler_common *common, struct sljit_label *leave)  static SLJIT_INLINE void return_with_partial_match(compiler_common *common, struct sljit_label *quit)
1814  {  {
1815  DEFINE_COMPILER;  DEFINE_COMPILER;
1816    
# Line 1820  SLJIT_ASSERT(common->start_used_ptr != 0 Line 1820  SLJIT_ASSERT(common->start_used_ptr != 0
1820  OP1(SLJIT_MOV, SLJIT_TEMPORARY_REG2, 0, ARGUMENTS, 0);  OP1(SLJIT_MOV, SLJIT_TEMPORARY_REG2, 0, ARGUMENTS, 0);
1821  OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_PARTIAL);  OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_PARTIAL);
1822  OP1(SLJIT_MOV_SI, SLJIT_TEMPORARY_REG3, 0, SLJIT_MEM1(SLJIT_TEMPORARY_REG2), SLJIT_OFFSETOF(jit_arguments, offsetcount));  OP1(SLJIT_MOV_SI, SLJIT_TEMPORARY_REG3, 0, SLJIT_MEM1(SLJIT_TEMPORARY_REG2), SLJIT_OFFSETOF(jit_arguments, offsetcount));
1823  CMPTO(SLJIT_C_LESS, SLJIT_TEMPORARY_REG3, 0, SLJIT_IMM, 2, leave);  CMPTO(SLJIT_C_LESS, SLJIT_TEMPORARY_REG3, 0, SLJIT_IMM, 2, quit);
1824    
1825  /* Store match begin and end. */  /* Store match begin and end. */
1826  OP1(SLJIT_MOV, SLJIT_SAVED_REG1, 0, SLJIT_MEM1(SLJIT_TEMPORARY_REG2), SLJIT_OFFSETOF(jit_arguments, begin));  OP1(SLJIT_MOV, SLJIT_SAVED_REG1, 0, SLJIT_MEM1(SLJIT_TEMPORARY_REG2), SLJIT_OFFSETOF(jit_arguments, begin));
# Line 1838  OP2(SLJIT_ASHR, SLJIT_TEMPORARY_REG3, 0, Line 1838  OP2(SLJIT_ASHR, SLJIT_TEMPORARY_REG3, 0,
1838  #endif  #endif
1839  OP1(SLJIT_MOV_SI, SLJIT_MEM1(SLJIT_TEMPORARY_REG2), 0, SLJIT_TEMPORARY_REG3, 0);  OP1(SLJIT_MOV_SI, SLJIT_MEM1(SLJIT_TEMPORARY_REG2), 0, SLJIT_TEMPORARY_REG3, 0);
1840    
1841  JUMPTO(SLJIT_JUMP, leave);  JUMPTO(SLJIT_JUMP, quit);
1842  }  }
1843    
1844  static SLJIT_INLINE void check_start_used_ptr(compiler_common *common)  static SLJIT_INLINE void check_start_used_ptr(compiler_common *common)
# Line 2518  static SLJIT_INLINE BOOL fast_forward_fi Line 2518  static SLJIT_INLINE BOOL fast_forward_fi
2518  {  {
2519  DEFINE_COMPILER;  DEFINE_COMPILER;
2520  struct sljit_label *start;  struct sljit_label *start;
2521  struct sljit_jump *leave;  struct sljit_jump *quit;
2522  struct sljit_jump *found;  struct sljit_jump *found;
2523  pcre_int32 chars[4];  pcre_int32 chars[4];
2524  pcre_uchar *cc = common->start + 1 + IMM2_SIZE;  pcre_uchar *cc = common->start + 1 + IMM2_SIZE;
# Line 2654  else Line 2654  else
2654    OP2(SLJIT_SUB, STR_END, 0, STR_END, 0, SLJIT_IMM, 1);    OP2(SLJIT_SUB, STR_END, 0, STR_END, 0, SLJIT_IMM, 1);
2655    
2656  start = LABEL();  start = LABEL();
2657  leave = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);  quit = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
2658  #if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED  #if defined SLJIT_UNALIGNED && SLJIT_UNALIGNED
2659  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
2660  OP1(SLJIT_MOV_UH, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);  OP1(SLJIT_MOV_UH, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
# Line 2695  found = CMP(SLJIT_C_EQUAL, TMP1, 0, SLJI Line 2695  found = CMP(SLJIT_C_EQUAL, TMP1, 0, SLJI
2695  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));
2696  JUMPTO(SLJIT_JUMP, start);  JUMPTO(SLJIT_JUMP, start);
2697  JUMPHERE(found);  JUMPHERE(found);
2698  JUMPHERE(leave);  JUMPHERE(quit);
2699    
2700  if (firstline)  if (firstline)
2701    OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE0);    OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE0);
# Line 2707  static SLJIT_INLINE void fast_forward_fi Line 2707  static SLJIT_INLINE void fast_forward_fi
2707  {  {
2708  DEFINE_COMPILER;  DEFINE_COMPILER;
2709  struct sljit_label *start;  struct sljit_label *start;
2710  struct sljit_jump *leave;  struct sljit_jump *quit;
2711  struct sljit_jump *found;  struct sljit_jump *found;
2712  pcre_uchar oc, bit;  pcre_uchar oc, bit;
2713    
# Line 2718  if (firstline) Line 2718  if (firstline)
2718    }    }
2719    
2720  start = LABEL();  start = LABEL();
2721  leave = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);  quit = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
2722  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
2723    
2724  oc = first_char;  oc = first_char;
# Line 2753  else Line 2753  else
2753  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));
2754  JUMPTO(SLJIT_JUMP, start);  JUMPTO(SLJIT_JUMP, start);
2755  JUMPHERE(found);  JUMPHERE(found);
2756  JUMPHERE(leave);  JUMPHERE(quit);
2757    
2758  if (firstline)  if (firstline)
2759    OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE0);    OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE0);
# Line 2765  DEFINE_COMPILER; Line 2765  DEFINE_COMPILER;
2765  struct sljit_label *loop;  struct sljit_label *loop;
2766  struct sljit_jump *lastchar;  struct sljit_jump *lastchar;
2767  struct sljit_jump *firstchar;  struct sljit_jump *firstchar;
2768  struct sljit_jump *leave;  struct sljit_jump *quit;
2769  struct sljit_jump *foundcr = NULL;  struct sljit_jump *foundcr = NULL;
2770  struct sljit_jump *notfoundnl;  struct sljit_jump *notfoundnl;
2771  jump_list *newline = NULL;  jump_list *newline = NULL;
# Line 2794  if (common->nltype == NLTYPE_FIXED && co Line 2794  if (common->nltype == NLTYPE_FIXED && co
2794    
2795    loop = LABEL();    loop = LABEL();
2796    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));
2797    leave = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);    quit = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
2798    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-2));
2799    OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));    OP1(MOV_UCHAR, TMP2, 0, SLJIT_MEM1(STR_PTR), IN_UCHARS(-1));
2800    CMPTO(SLJIT_C_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, loop);    CMPTO(SLJIT_C_NOT_EQUAL, TMP1, 0, SLJIT_IMM, (common->newline >> 8) & 0xff, loop);
2801    CMPTO(SLJIT_C_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, loop);    CMPTO(SLJIT_C_NOT_EQUAL, TMP2, 0, SLJIT_IMM, common->newline & 0xff, loop);
2802    
2803    JUMPHERE(leave);    JUMPHERE(quit);
2804    JUMPHERE(firstchar);    JUMPHERE(firstchar);
2805    JUMPHERE(lastchar);    JUMPHERE(lastchar);
2806    
# Line 2824  set_jumps(newline, loop); Line 2824  set_jumps(newline, loop);
2824    
2825  if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF)  if (common->nltype == NLTYPE_ANY || common->nltype == NLTYPE_ANYCRLF)
2826    {    {
2827    leave = JUMP(SLJIT_JUMP);    quit = JUMP(SLJIT_JUMP);
2828    JUMPHERE(foundcr);    JUMPHERE(foundcr);
2829    notfoundnl = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);    notfoundnl = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
2830    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);    OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
# Line 2835  if (common->nltype == NLTYPE_ANY || comm Line 2835  if (common->nltype == NLTYPE_ANY || comm
2835  #endif  #endif
2836    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);    OP2(SLJIT_ADD, STR_PTR, 0, STR_PTR, 0, TMP1, 0);
2837    JUMPHERE(notfoundnl);    JUMPHERE(notfoundnl);
2838    JUMPHERE(leave);    JUMPHERE(quit);
2839    }    }
2840  JUMPHERE(lastchar);  JUMPHERE(lastchar);
2841  JUMPHERE(firstchar);  JUMPHERE(firstchar);
# Line 2848  static SLJIT_INLINE void fast_forward_st Line 2848  static SLJIT_INLINE void fast_forward_st
2848  {  {
2849  DEFINE_COMPILER;  DEFINE_COMPILER;
2850  struct sljit_label *start;  struct sljit_label *start;
2851  struct sljit_jump *leave;  struct sljit_jump *quit;
2852  struct sljit_jump *found;  struct sljit_jump *found;
2853  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
2854  struct sljit_jump *jump;  struct sljit_jump *jump;
# Line 2861  if (firstline) Line 2861  if (firstline)
2861    }    }
2862    
2863  start = LABEL();  start = LABEL();
2864  leave = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);  quit = CMP(SLJIT_C_GREATER_EQUAL, STR_PTR, 0, STR_END, 0);
2865  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);  OP1(MOV_UCHAR, TMP1, 0, SLJIT_MEM1(STR_PTR), 0);
2866  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
2867  if (common->utf)  if (common->utf)
# Line 2905  if (common->utf) Line 2905  if (common->utf)
2905  #endif  #endif
2906  JUMPTO(SLJIT_JUMP, start);  JUMPTO(SLJIT_JUMP, start);
2907  JUMPHERE(found);  JUMPHERE(found);
2908  JUMPHERE(leave);  JUMPHERE(quit);
2909    
2910  if (firstline)  if (firstline)
2911    OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE0);    OP1(SLJIT_MOV, STR_END, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), POSSESSIVE0);
# Line 4940  jump_list *tmp = NULL; Line 4940  jump_list *tmp = NULL;
4940  jump_list **target = (conditional) ? &backtrack->condfailed : &backtrack->common.topbacktracks;  jump_list **target = (conditional) ? &backtrack->condfailed : &backtrack->common.topbacktracks;
4941  jump_list **found;  jump_list **found;
4942  /* Saving previous accept variables. */  /* Saving previous accept variables. */
4943  struct sljit_label *save_leavelabel = common->leavelabel;  struct sljit_label *save_quitlabel = common->quitlabel;
4944  struct sljit_label *save_acceptlabel = common->acceptlabel;  struct sljit_label *save_acceptlabel = common->acceptlabel;
4945  jump_list *save_leave = common->leave;  jump_list *save_quit = common->quit;
4946  jump_list *save_accept = common->accept;  jump_list *save_accept = common->accept;
4947  struct sljit_jump *jump;  struct sljit_jump *jump;
4948  struct sljit_jump *brajump = NULL;  struct sljit_jump *brajump = NULL;
# Line 4990  else Line 4990  else
4990    }    }
4991    
4992  memset(&altbacktrack, 0, sizeof(backtrack_common));  memset(&altbacktrack, 0, sizeof(backtrack_common));
4993  common->leavelabel = NULL;  common->quitlabel = NULL;
4994  common->leave = NULL;  common->quit = NULL;
4995  while (1)  while (1)
4996    {    {
4997    common->acceptlabel = NULL;    common->acceptlabel = NULL;
# Line 5006  while (1) Line 5006  while (1)
5006    compile_trypath(common, ccbegin + 1 + LINK_SIZE, cc, &altbacktrack);    compile_trypath(common, ccbegin + 1 + LINK_SIZE, cc, &altbacktrack);
5007    if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))    if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
5008      {      {
5009      common->leavelabel = save_leavelabel;      common->quitlabel = save_quitlabel;
5010      common->acceptlabel = save_acceptlabel;      common->acceptlabel = save_acceptlabel;
5011      common->leave = save_leave;      common->quit = save_quit;
5012      common->accept = save_accept;      common->accept = save_accept;
5013      return NULL;      return NULL;
5014      }      }
# Line 5061  while (1) Line 5061  while (1)
5061    compile_backtrackpath(common, altbacktrack.top);    compile_backtrackpath(common, altbacktrack.top);
5062    if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))    if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
5063      {      {
5064      common->leavelabel = save_leavelabel;      common->quitlabel = save_quitlabel;
5065      common->acceptlabel = save_acceptlabel;      common->acceptlabel = save_acceptlabel;
5066      common->leave = save_leave;      common->quit = save_quit;
5067      common->accept = save_accept;      common->accept = save_accept;
5068      return NULL;      return NULL;
5069      }      }
# Line 5076  while (1) Line 5076  while (1)
5076    cc += GET(cc, 1);    cc += GET(cc, 1);
5077    }    }
5078  /* None of them matched. */  /* None of them matched. */
5079  if (common->leave != NULL)  if (common->quit != NULL)
5080    set_jumps(common->leave, LABEL());    set_jumps(common->quit, LABEL());
5081    
5082  if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK)  if (opcode == OP_ASSERT || opcode == OP_ASSERTBACK)
5083    {    {
# Line 5202  else Line 5202  else
5202      }      }
5203    }    }
5204    
5205  common->leavelabel = save_leavelabel;  common->quitlabel = save_quitlabel;
5206  common->acceptlabel = save_acceptlabel;  common->acceptlabel = save_acceptlabel;
5207  common->leave = save_leave;  common->quit = save_quit;
5208  common->accept = save_accept;  common->accept = save_accept;
5209  return cc + 1 + LINK_SIZE;  return cc + 1 + LINK_SIZE;
5210  }  }
# Line 7502  while (current) Line 7502  while (current)
7502    
7503      case OP_COMMIT:      case OP_COMMIT:
7504      OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_NOMATCH);      OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_NOMATCH);
7505      if (common->leavelabel == NULL)      if (common->quitlabel == NULL)
7506        add_jump(compiler, &common->leave, JUMP(SLJIT_JUMP));        add_jump(compiler, &common->quit, JUMP(SLJIT_JUMP));
7507      else      else
7508        JUMPTO(SLJIT_JUMP, common->leavelabel);        JUMPTO(SLJIT_JUMP, common->quitlabel);
7509      break;      break;
7510    
7511      case OP_FAIL:      case OP_FAIL:
# Line 7533  int framesize = get_framesize(common, cc Line 7533  int framesize = get_framesize(common, cc
7533  int alternativesize;  int alternativesize;
7534  BOOL needsframe;  BOOL needsframe;
7535  backtrack_common altbacktrack;  backtrack_common altbacktrack;
7536  struct sljit_label *save_leavelabel = common->leavelabel;  struct sljit_label *save_quitlabel = common->quitlabel;
7537  jump_list *save_leave = common->leave;  jump_list *save_quit = common->quit;
7538  struct sljit_jump *jump;  struct sljit_jump *jump;
7539    
7540  SLJIT_ASSERT(*cc == OP_BRA || *cc == OP_CBRA || *cc == OP_CBRAPOS || *cc == OP_SCBRA || *cc == OP_SCBRAPOS);  SLJIT_ASSERT(*cc == OP_BRA || *cc == OP_CBRA || *cc == OP_CBRAPOS || *cc == OP_SCBRA || *cc == OP_SCBRAPOS);
# Line 7559  if (alternativesize > 0) Line 7559  if (alternativesize > 0)
7559    OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0);    OP1(SLJIT_MOV, SLJIT_MEM1(STACK_TOP), STACK(0), STR_PTR, 0);
7560    
7561  memset(&altbacktrack, 0, sizeof(backtrack_common));  memset(&altbacktrack, 0, sizeof(backtrack_common));
7562  common->leavelabel = NULL;  common->quitlabel = NULL;
7563  common->acceptlabel = NULL;  common->acceptlabel = NULL;
7564  common->leave = NULL;  common->quit = NULL;
7565  common->accept = NULL;  common->accept = NULL;
7566  altbacktrack.cc = ccbegin;  altbacktrack.cc = ccbegin;
7567  cc += GET(cc, 1);  cc += GET(cc, 1);
# Line 7576  while (1) Line 7576  while (1)
7576    compile_trypath(common, altbacktrack.cc, cc, &altbacktrack);    compile_trypath(common, altbacktrack.cc, cc, &altbacktrack);
7577    if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))    if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
7578      {      {
7579      common->leavelabel = save_leavelabel;      common->quitlabel = save_quitlabel;
7580      common->leave = save_leave;      common->quit = save_quit;
7581      return;      return;
7582      }      }
7583    
# Line 7586  while (1) Line 7586  while (1)
7586    compile_backtrackpath(common, altbacktrack.top);    compile_backtrackpath(common, altbacktrack.top);
7587    if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))    if (SLJIT_UNLIKELY(sljit_get_compiler_error(compiler)))
7588      {      {
7589      common->leavelabel = save_leavelabel;      common->quitlabel = save_quitlabel;
7590      common->leave = save_leave;      common->quit = save_quit;
7591      return;      return;
7592      }      }
7593    set_jumps(altbacktrack.topbacktracks, LABEL());    set_jumps(altbacktrack.topbacktracks, LABEL());
# Line 7599  while (1) Line 7599  while (1)
7599    cc += GET(cc, 1);    cc += GET(cc, 1);
7600    }    }
7601  /* None of them matched. */  /* None of them matched. */
7602  if (common->leave != NULL)  if (common->quit != NULL)
7603    set_jumps(common->leave, LABEL());    set_jumps(common->quit, LABEL());
7604    
7605  OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 0);  OP1(SLJIT_MOV, TMP3, 0, SLJIT_IMM, 0);
7606  jump = JUMP(SLJIT_JUMP);  jump = JUMP(SLJIT_JUMP);
# Line 7623  OP1(SLJIT_MOV, TMP1, 0, TMP3, 0); Line 7623  OP1(SLJIT_MOV, TMP1, 0, TMP3, 0);
7623  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), common->recursive_head, TMP2, 0);  OP1(SLJIT_MOV, SLJIT_MEM1(SLJIT_LOCALS_REG), common->recursive_head, TMP2, 0);
7624  sljit_emit_fast_return(compiler, SLJIT_MEM1(STACK_TOP), 0);  sljit_emit_fast_return(compiler, SLJIT_MEM1(STACK_TOP), 0);
7625    
7626  common->leavelabel = save_leavelabel;  common->quitlabel = save_quitlabel;
7627  common->leave = save_leave;  common->quit = save_quit;
7628  }  }
7629    
7630  #undef COMPILE_BACKTRACKPATH  #undef COMPILE_BACKTRACKPATH
# Line 7840  if (common->accept != NULL) Line 7840  if (common->accept != NULL)
7840    
7841  /* This means we have a match. Update the ovector. */  /* This means we have a match. Update the ovector. */
7842  copy_ovector(common, re->top_bracket + 1);  copy_ovector(common, re->top_bracket + 1);
7843  common->leavelabel = LABEL();  common->quitlabel = LABEL();
7844  if (common->leave != NULL)  if (common->quit != NULL)
7845    set_jumps(common->leave, common->leavelabel);    set_jumps(common->quit, common->quitlabel);
7846  sljit_emit_return(compiler, SLJIT_MOV, SLJIT_RETURN_REG, 0);  sljit_emit_return(compiler, SLJIT_MOV, SLJIT_RETURN_REG, 0);
7847    
7848  if (mode != JIT_COMPILE)  if (mode != JIT_COMPILE)
7849    {    {
7850    common->partialmatchlabel = LABEL();    common->partialmatchlabel = LABEL();
7851    set_jumps(common->partialmatch, common->partialmatchlabel);    set_jumps(common->partialmatch, common->partialmatchlabel);
7852    return_with_partial_match(common, common->leavelabel);    return_with_partial_match(common, common->quitlabel);
7853    }    }
7854    
7855  empty_match_backtrack = LABEL();  empty_match_backtrack = LABEL();
# Line 7913  if (mode == JIT_PARTIAL_SOFT_COMPILE) Line 7913  if (mode == JIT_PARTIAL_SOFT_COMPILE)
7913    CMPTO(SLJIT_C_NOT_EQUAL, SLJIT_MEM1(SLJIT_LOCALS_REG), common->hit_start, SLJIT_IMM, 0, common->partialmatchlabel);    CMPTO(SLJIT_C_NOT_EQUAL, SLJIT_MEM1(SLJIT_LOCALS_REG), common->hit_start, SLJIT_IMM, 0, common->partialmatchlabel);
7914    
7915  OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_NOMATCH);  OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_NOMATCH);
7916  JUMPTO(SLJIT_JUMP, common->leavelabel);  JUMPTO(SLJIT_JUMP, common->quitlabel);
7917    
7918  flush_stubs(common);  flush_stubs(common);
7919    
# Line 7966  sljit_emit_fast_return(compiler, SLJIT_M Line 7966  sljit_emit_fast_return(compiler, SLJIT_M
7966  JUMPHERE(jump);  JUMPHERE(jump);
7967  /* We break the return address cache here, but this is a really rare case. */  /* We break the return address cache here, but this is a really rare case. */
7968  OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_JIT_STACKLIMIT);  OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_JIT_STACKLIMIT);
7969  JUMPTO(SLJIT_JUMP, common->leavelabel);  JUMPTO(SLJIT_JUMP, common->quitlabel);
7970    
7971  /* Call limit reached. */  /* Call limit reached. */
7972  set_jumps(common->calllimit, LABEL());  set_jumps(common->calllimit, LABEL());
7973  OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_MATCHLIMIT);  OP1(SLJIT_MOV, SLJIT_RETURN_REG, 0, SLJIT_IMM, PCRE_ERROR_MATCHLIMIT);
7974  JUMPTO(SLJIT_JUMP, common->leavelabel);  JUMPTO(SLJIT_JUMP, common->quitlabel);
7975    
7976  if (common->revertframes != NULL)  if (common->revertframes != NULL)
7977    {    {

Legend:
Removed from v.990  
changed lines
  Added in v.991

  ViewVC Help
Powered by ViewVC 1.1.5