/[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 741 by zherczeg, Mon Oct 31 09:31:46 2011 UTC revision 792 by ph10, Wed Dec 7 16:44:48 2011 UTC
# Line 52  POSSIBILITY OF SUCH DAMAGE. Line 52  POSSIBILITY OF SUCH DAMAGE.
52  we just include it. This way we don't need to touch the build  we just include it. This way we don't need to touch the build
53  system files. */  system files. */
54    
55    #define SLJIT_MALLOC(size) (pcre_malloc)(size)
56    #define SLJIT_FREE(ptr) (pcre_free)(ptr)
57  #define SLJIT_CONFIG_AUTO 1  #define SLJIT_CONFIG_AUTO 1
58  #define SLJIT_CONFIG_STATIC 1  #define SLJIT_CONFIG_STATIC 1
59  #define SLJIT_VERBOSE 0  #define SLJIT_VERBOSE 0
# Line 164  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 5695  if (has_alternatives) Line 5698  if (has_alternatives)
5698      {      {
5699      SLJIT_ASSERT(opcode == OP_COND || opcode == OP_SCOND);      SLJIT_ASSERT(opcode == OP_COND || opcode == OP_SCOND);
5700      assert = CURRENT_AS(bracket_fallback)->u.assert;      assert = CURRENT_AS(bracket_fallback)->u.assert;
5701      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)
5702    
5703        {        {
5704        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);
5705        add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));        add_jump(compiler, &common->revertframes, JUMP(SLJIT_FAST_CALL));
# Line 6097  pcre_study_data *study; Line 6101  pcre_study_data *study;
6101  uschar *ccend;  uschar *ccend;
6102  executable_function *function;  executable_function *function;
6103  void *executable_func;  void *executable_func;
6104    sljit_uw executable_size;
6105  struct sljit_label *leave;  struct sljit_label *leave;
6106  struct sljit_label *mainloop = NULL;  struct sljit_label *mainloop = NULL;
6107  struct sljit_label *empty_match_found;  struct sljit_label *empty_match_found;
# Line 6426  if (common->getucd != NULL) Line 6431  if (common->getucd != NULL)
6431    
6432  SLJIT_FREE(common->localptrs);  SLJIT_FREE(common->localptrs);
6433  executable_func = sljit_generate_code(compiler);  executable_func = sljit_generate_code(compiler);
6434    executable_size = sljit_get_generated_code_size(compiler);
6435  sljit_free_compiler(compiler);  sljit_free_compiler(compiler);
6436  if (executable_func == NULL)  if (executable_func == NULL)
6437    return;    return;
# Line 6440  if (function == NULL) Line 6446  if (function == NULL)
6446    }    }
6447    
6448  function->executable_func = executable_func;  function->executable_func = executable_func;
6449    function->executable_size = executable_size;
6450  function->callback = NULL;  function->callback = NULL;
6451  function->userdata = NULL;  function->userdata = NULL;
6452  extra->executable_jit = function;  extra->executable_jit = function;
# Line 6528  sljit_free_code(function->executable_fun Line 6535  sljit_free_code(function->executable_fun
6535  SLJIT_FREE(function);  SLJIT_FREE(function);
6536  }  }
6537    
6538    int
6539    _pcre_jit_get_size(void *executable_func)
6540    {
6541    return ((executable_function*)executable_func)->executable_size;
6542    }
6543    
6544  PCRE_EXP_DECL pcre_jit_stack *  PCRE_EXP_DECL pcre_jit_stack *
6545  pcre_jit_stack_alloc(int startsize, int maxsize)  pcre_jit_stack_alloc(int startsize, int maxsize)
6546  {  {

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

  ViewVC Help
Powered by ViewVC 1.1.5