/[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 1452 by zherczeg, Tue Jan 28 16:07:52 2014 UTC revision 1475 by zherczeg, Fri Apr 25 11:59:19 2014 UTC
# Line 200  typedef struct stub_list { Line 200  typedef struct stub_list {
200    
201  typedef struct label_addr_list {  typedef struct label_addr_list {
202    struct sljit_label *label;    struct sljit_label *label;
203    sljit_uw *addr;    sljit_uw *update_addr;
204    struct label_addr_list *next;    struct label_addr_list *next;
205  } label_addr_list;  } label_addr_list;
206    
# Line 2070  while (list_item) Line 2070  while (list_item)
2070  common->stubs = NULL;  common->stubs = NULL;
2071  }  }
2072    
2073  static void add_label_addr(compiler_common *common)  static void add_label_addr(compiler_common *common, sljit_uw *update_addr)
2074  {  {
2075  DEFINE_COMPILER;  DEFINE_COMPILER;
2076  label_addr_list *label_addr;  label_addr_list *label_addr;
# Line 2079  label_addr = sljit_alloc_memory(compiler Line 2079  label_addr = sljit_alloc_memory(compiler
2079  if (label_addr == NULL)  if (label_addr == NULL)
2080    return;    return;
2081  label_addr->label = LABEL();  label_addr->label = LABEL();
2082  label_addr->addr = common->read_only_data_ptr;  label_addr->update_addr = update_addr;
2083  label_addr->next = common->label_addrs;  label_addr->next = common->label_addrs;
2084  common->label_addrs = label_addr;  common->label_addrs = label_addr;
 common->read_only_data_ptr++;  
2085  }  }
2086    
2087  static SLJIT_INLINE void count_match(compiler_common *common)  static SLJIT_INLINE void count_match(compiler_common *common)
# Line 3559  for (i = 0; i < max; i++) Line 3558  for (i = 0; i < max; i++)
3558    }    }
3559    
3560  in_range = FALSE;  in_range = FALSE;
3561    from = 0;   /* Prevent compiler "uninitialized" warning */
3562  for (i = 0; i <= max; i++)  for (i = 0; i <= max; i++)
3563    {    {
3564    if (in_range && (i - from) > range_len && (bytes[(i - 1) * MAX_N_BYTES] <= 4))    if (in_range && (i - from) > range_len && (bytes[(i - 1) * MAX_N_BYTES] <= 4))
# Line 7415  if (ket == OP_KETRMAX) Line 7415  if (ket == OP_KETRMAX)
7415    
7416  if (repeat_type == OP_EXACT)  if (repeat_type == OP_EXACT)
7417    {    {
7418      count_match(common);
7419    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_MEM1(SLJIT_LOCALS_REG), repeat_ptr, SLJIT_MEM1(SLJIT_LOCALS_REG), repeat_ptr, SLJIT_IMM, 1);    OP2(SLJIT_SUB | SLJIT_SET_E, SLJIT_MEM1(SLJIT_LOCALS_REG), repeat_ptr, SLJIT_MEM1(SLJIT_LOCALS_REG), repeat_ptr, SLJIT_IMM, 1);
7420    JUMPTO(SLJIT_C_NOT_ZERO, rmax_label);    JUMPTO(SLJIT_C_NOT_ZERO, rmax_label);
7421    }    }
# Line 8811  pcre_uchar *ccprev; Line 8812  pcre_uchar *ccprev;
8812  pcre_uchar bra = OP_BRA;  pcre_uchar bra = OP_BRA;
8813  pcre_uchar ket;  pcre_uchar ket;
8814  assert_backtrack *assert;  assert_backtrack *assert;
8815    sljit_uw *next_update_addr;
8816  BOOL has_alternatives;  BOOL has_alternatives;
8817  BOOL needs_control_head = FALSE;  BOOL needs_control_head = FALSE;
8818  struct sljit_jump *brazero = NULL;  struct sljit_jump *brazero = NULL;
# Line 8980  else if (has_alternatives) Line 8982  else if (has_alternatives)
8982    if (alt_max > 4)    if (alt_max > 4)
8983      {      {
8984      /* Table jump if alt_max is greater than 4. */      /* Table jump if alt_max is greater than 4. */
8985      sljit_emit_ijump(compiler, SLJIT_JUMP, SLJIT_MEM1(TMP1), (sljit_sw)common->read_only_data_ptr);      next_update_addr = common->read_only_data_ptr;
8986      add_label_addr(common);      common->read_only_data_ptr += alt_max;
8987        sljit_emit_ijump(compiler, SLJIT_JUMP, SLJIT_MEM1(TMP1), (sljit_sw)next_update_addr);
8988        add_label_addr(common, next_update_addr++);
8989      }      }
8990    else    else
8991      {      {
# Line 9113  if (has_alternatives) Line 9117  if (has_alternatives)
9117      if (opcode != OP_ONCE)      if (opcode != OP_ONCE)
9118        {        {
9119        if (alt_max > 4)        if (alt_max > 4)
9120          add_label_addr(common);          add_label_addr(common, next_update_addr++);
9121        else        else
9122          {          {
9123          if (alt_count != 2 * sizeof(sljit_uw))          if (alt_count != 2 * sizeof(sljit_uw))
# Line 10308  executable_size = sljit_get_generated_co Line 10312  executable_size = sljit_get_generated_co
10312  label_addr = common->label_addrs;  label_addr = common->label_addrs;
10313  while (label_addr != NULL)  while (label_addr != NULL)
10314    {    {
10315    *label_addr->addr = sljit_get_label_addr(label_addr->label);    *label_addr->update_addr = sljit_get_label_addr(label_addr->label);
10316    label_addr = label_addr->next;    label_addr = label_addr->next;
10317    }    }
10318  sljit_free_compiler(compiler);  sljit_free_compiler(compiler);

Legend:
Removed from v.1452  
changed lines
  Added in v.1475

  ViewVC Help
Powered by ViewVC 1.1.5