/[pcre]/code/branches/pcre16/pcre_jit_compile.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_jit_compile.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 800 by zherczeg, Sat Dec 10 02:20:06 2011 UTC revision 801 by ph10, Mon Dec 12 16:23:37 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;
169      sljit_uw executable_size;
170  } executable_function;  } executable_function;
171    
172  typedef struct jump_list {  typedef struct jump_list {
# Line 5947  if (has_alternatives) Line 5948  if (has_alternatives)
5948      {      {
5949      SLJIT_ASSERT(opcode == OP_COND || opcode == OP_SCOND);      SLJIT_ASSERT(opcode == OP_COND || opcode == OP_SCOND);
5950      assert = CURRENT_AS(bracket_fallback)->u.assert;      assert = CURRENT_AS(bracket_fallback)->u.assert;
5951      if (assert->framesize >= 0 && (ccbegin[1 + LINK_SIZE] == OP_ASSERT_NOT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK_NOT))      if ((ccbegin[1 + LINK_SIZE] == OP_ASSERT_NOT || ccbegin[1 + LINK_SIZE] == OP_ASSERTBACK_NOT) && assert->framesize >= 0)
5952    
5953        {        {
5954        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);
5955        add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));        add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
# Line 6351  pcre_study_data *study; Line 6353  pcre_study_data *study;
6353  pcre_uchar *ccend;  pcre_uchar *ccend;
6354  executable_function *function;  executable_function *function;
6355  void *executable_func;  void *executable_func;
6356    sljit_uw executable_size;
6357  struct sljit_label *leave;  struct sljit_label *leave;
6358  struct sljit_label *mainloop = NULL;  struct sljit_label *mainloop = NULL;
6359  struct sljit_label *empty_match_found;  struct sljit_label *empty_match_found;
# Line 6685  if (common->getucd != NULL) Line 6688  if (common->getucd != NULL)
6688    
6689  SLJIT_FREE(common->localptrs);  SLJIT_FREE(common->localptrs);
6690  executable_func = sljit_generate_code(compiler);  executable_func = sljit_generate_code(compiler);
6691    executable_size = sljit_get_generated_code_size(compiler);
6692  sljit_free_compiler(compiler);  sljit_free_compiler(compiler);
6693  if (executable_func == NULL)  if (executable_func == NULL)
6694    return;    return;
# Line 6699  if (function == NULL) Line 6703  if (function == NULL)
6703    }    }
6704    
6705  function->executable_func = executable_func;  function->executable_func = executable_func;
6706    function->executable_size = executable_size;
6707  function->callback = NULL;  function->callback = NULL;
6708  function->userdata = NULL;  function->userdata = NULL;
6709  extra->executable_jit = function;  extra->executable_jit = function;
# Line 6787  sljit_free_code(function->executable_fun Line 6792  sljit_free_code(function->executable_fun
6792  SLJIT_FREE(function);  SLJIT_FREE(function);
6793  }  }
6794    
6795    int
6796    PRIV(jit_get_size)(void *executable_func)
6797    {
6798    return ((executable_function*)executable_func)->executable_size;
6799    }
6800    
6801  #ifdef COMPILE_PCRE8  #ifdef COMPILE_PCRE8
6802  PCRE_EXP_DECL pcre_jit_stack *  PCRE_EXP_DECL pcre_jit_stack *
6803  pcre_jit_stack_alloc(int startsize, int maxsize)  pcre_jit_stack_alloc(int startsize, int maxsize)

Legend:
Removed from v.800  
changed lines
  Added in v.801

  ViewVC Help
Powered by ViewVC 1.1.5