/[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 792 by ph10, Wed Dec 7 16:44:48 2011 UTC revision 835 by ph10, Wed Dec 28 16:10:09 2011 UTC
# Line 166  typedef struct executable_function { Line 166  typedef struct executable_function {
166    void *executable_func;    void *executable_func;
167    pcre_jit_callback callback;    pcre_jit_callback callback;
168    void *userdata;    void *userdata;
   sljit_uw executable_size;  
169  } executable_function;  } executable_function;
170    
171  typedef struct jump_list {  typedef struct jump_list {
# Line 5698  if (has_alternatives) Line 5697  if (has_alternatives)
5697      {      {
5698      SLJIT_ASSERT(opcode == OP_COND || opcode == OP_SCOND);      SLJIT_ASSERT(opcode == OP_COND || opcode == OP_SCOND);
5699      assert = CURRENT_AS(bracket_fallback)->u.assert;      assert = CURRENT_AS(bracket_fallback)->u.assert;
5700      if ((ccbegin[1 + LINK_SIZE] == OP_ASSERT_NOT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK_NOT) && assert->framesize >= 0)      if (assert->framesize >= 0 && (ccbegin[1 + LINK_SIZE] == OP_ASSERT_NOT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK_NOT))
   
5701        {        {
5702        OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), assert->localptr);        OP1(SLJIT_MOV, STACK_TOP, 0, SLJIT_MEM1(SLJIT_LOCALS_REG), assert->localptr);
5703        add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));        add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
# Line 6101  pcre_study_data *study; Line 6099  pcre_study_data *study;
6099  uschar *ccend;  uschar *ccend;
6100  executable_function *function;  executable_function *function;
6101  void *executable_func;  void *executable_func;
 sljit_uw executable_size;  
6102  struct sljit_label *leave;  struct sljit_label *leave;
6103  struct sljit_label *mainloop = NULL;  struct sljit_label *mainloop = NULL;
6104  struct sljit_label *empty_match_found;  struct sljit_label *empty_match_found;
# Line 6431  if (common->getucd != NULL) Line 6428  if (common->getucd != NULL)
6428    
6429  SLJIT_FREE(common->localptrs);  SLJIT_FREE(common->localptrs);
6430  executable_func = sljit_generate_code(compiler);  executable_func = sljit_generate_code(compiler);
 executable_size = sljit_get_generated_code_size(compiler);  
6431  sljit_free_compiler(compiler);  sljit_free_compiler(compiler);
6432  if (executable_func == NULL)  if (executable_func == NULL)
6433    return;    return;
# Line 6446  if (function == NULL) Line 6442  if (function == NULL)
6442    }    }
6443    
6444  function->executable_func = executable_func;  function->executable_func = executable_func;
 function->executable_size = executable_size;  
6445  function->callback = NULL;  function->callback = NULL;
6446  function->userdata = NULL;  function->userdata = NULL;
6447  extra->executable_jit = function;  extra->executable_jit = function;
# Line 6535  sljit_free_code(function->executable_fun Line 6530  sljit_free_code(function->executable_fun
6530  SLJIT_FREE(function);  SLJIT_FREE(function);
6531  }  }
6532    
 int  
 _pcre_jit_get_size(void *executable_func)  
 {  
 return ((executable_function*)executable_func)->executable_size;  
 }  
   
6533  PCRE_EXP_DECL pcre_jit_stack *  PCRE_EXP_DECL pcre_jit_stack *
6534  pcre_jit_stack_alloc(int startsize, int maxsize)  pcre_jit_stack_alloc(int startsize, int maxsize)
6535  {  {

Legend:
Removed from v.792  
changed lines
  Added in v.835

  ViewVC Help
Powered by ViewVC 1.1.5