/[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 1474 by zherczeg, Thu Apr 24 06:43:50 2014 UTC revision 1476 by zherczeg, Mon Apr 28 06:49:36 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 8813  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 = NULL;
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 8982  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 9115  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 10310  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.1474  
changed lines
  Added in v.1476

  ViewVC Help
Powered by ViewVC 1.1.5