[Pcre-svn] [136] code/trunk/src: Remove pcre2_jit_stack argu…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [136] code/trunk/src: Remove pcre2_jit_stack argument from jit_match.
Revision: 136
          http://www.exim.org/viewvc/pcre2?view=rev&revision=136
Author:   zherczeg
Date:     2014-11-07 12:12:52 +0000 (Fri, 07 Nov 2014)


Log Message:
-----------
Remove pcre2_jit_stack argument from jit_match.

Modified Paths:
--------------
    code/trunk/src/pcre2.h.in
    code/trunk/src/pcre2_context.c
    code/trunk/src/pcre2_intmodedep.h
    code/trunk/src/pcre2_jit_match.c
    code/trunk/src/pcre2_jit_test.c
    code/trunk/src/pcre2_match.c


Modified: code/trunk/src/pcre2.h.in
===================================================================
--- code/trunk/src/pcre2.h.in    2014-11-06 14:37:09 UTC (rev 135)
+++ code/trunk/src/pcre2.h.in    2014-11-07 12:12:52 UTC (rev 136)
@@ -453,8 +453,7 @@
 PCRE2_EXP_DECL int       pcre2_jit_compile(pcre2_code *, uint32_t); \
 PCRE2_EXP_DECL int       pcre2_jit_match(const pcre2_code *, \
                            PCRE2_SPTR, PCRE2_SIZE, PCRE2_SIZE, uint32_t, \
-                           pcre2_match_data *, pcre2_match_context *, \
-                           pcre2_jit_stack *); \
+                           pcre2_match_data *, pcre2_match_context *); \
 PCRE2_EXP_DECL void      pcre2_jit_free_unused_memory(pcre2_general_context *); \
 PCRE2_EXP_DECL \
   pcre2_jit_stack       *pcre2_jit_stack_create(pcre2_general_context *, \


Modified: code/trunk/src/pcre2_context.c
===================================================================
--- code/trunk/src/pcre2_context.c    2014-11-06 14:37:09 UTC (rev 135)
+++ code/trunk/src/pcre2_context.c    2014-11-07 12:12:52 UTC (rev 136)
@@ -162,8 +162,12 @@
 #ifdef HEAP_MATCH_RECURSE
   { default_malloc, default_free, NULL },
 #endif
+#ifdef SUPPORT_JIT
   NULL,
   NULL,
+#endif
+  NULL,
+  NULL,
   MATCH_LIMIT,
   MATCH_LIMIT_RECURSION };



Modified: code/trunk/src/pcre2_intmodedep.h
===================================================================
--- code/trunk/src/pcre2_intmodedep.h    2014-11-06 14:37:09 UTC (rev 135)
+++ code/trunk/src/pcre2_intmodedep.h    2014-11-07 12:12:52 UTC (rev 136)
@@ -573,14 +573,14 @@
 #ifdef HEAP_MATCH_RECURSE
   pcre2_memctl  stack_memctl;
 #endif
+#ifdef SUPPORT_JIT
+  pcre2_jit_callback jit_callback;
+  void *jit_callback_data;
+#endif
   int       (*callout)(pcre2_callout_block *);
   void      *callout_data;
   uint32_t  match_limit;
   uint32_t  recursion_limit;
-#ifdef SUPPORT_JIT
-  pcre2_jit_callback jit_callback;
-  void *jit_callback_data;
-#endif
 } pcre2_real_match_context;


/* The real compiled code structure */

Modified: code/trunk/src/pcre2_jit_match.c
===================================================================
--- code/trunk/src/pcre2_jit_match.c    2014-11-06 14:37:09 UTC (rev 135)
+++ code/trunk/src/pcre2_jit_match.c    2014-11-07 12:12:52 UTC (rev 136)
@@ -87,7 +87,7 @@
 PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
 pcre2_jit_match(const pcre2_code *code, PCRE2_SPTR subject, PCRE2_SIZE length,
   PCRE2_SIZE start_offset, uint32_t options, pcre2_match_data *match_data,
-  pcre2_match_context *mcontext, pcre2_jit_stack *jit_stack)
+  pcre2_match_context *mcontext)
 {
 #ifndef SUPPORT_JIT


@@ -105,6 +105,7 @@

pcre2_real_code *re = (pcre2_real_code *)code;
executable_functions *functions = (executable_functions *)re->executable_jit;
+pcre2_jit_stack *jit_stack;
uint32_t oveccount = match_data->oveccount;
uint32_t max_oveccount;
union {
@@ -158,8 +159,10 @@
oveccount = max_oveccount;
arguments.oveccount = oveccount << 1;

-if (jit_stack == NULL && mcontext->jit_callback != NULL)
+if (mcontext->jit_callback != NULL)
jit_stack = mcontext->jit_callback(mcontext->jit_callback_data);
+else
+ jit_stack = (pcre2_jit_stack *)mcontext->jit_callback_data;

convert_executable_func.executable_func = functions->executable_funcs[index];
if (jit_stack != NULL)

Modified: code/trunk/src/pcre2_jit_test.c
===================================================================
--- code/trunk/src/pcre2_jit_test.c    2014-11-06 14:37:09 UTC (rev 135)
+++ code/trunk/src/pcre2_jit_test.c    2014-11-07 12:12:52 UTC (rev 136)
@@ -1295,8 +1295,9 @@
                 return_value8[0] = pcre2_match_8(re8, (PCRE2_SPTR8)current->input, strlen(current->input),
                     current->start_offset & OFFSET_MASK, current->match_options, mdata8_1, mcontext8);
             } else {
+                pcre2_jit_stack_assign_8(mcontext8, NULL, getstack8());
                 return_value8[0] = pcre2_jit_match_8(re8, (PCRE2_SPTR8)current->input, strlen(current->input),
-                    current->start_offset & OFFSET_MASK, current->match_options, mdata8_1, mcontext8, getstack8());
+                    current->start_offset & OFFSET_MASK, current->match_options, mdata8_1, mcontext8);
             }
         }
 #endif
@@ -1338,8 +1339,9 @@
                 return_value16[0] = pcre2_match_16(re16, regtest_buf16, length16,
                     current->start_offset & OFFSET_MASK, current->match_options, mdata16_1, mcontext16);
             } else {
+                pcre2_jit_stack_assign_16(mcontext16, NULL, getstack16());
                 return_value16[0] = pcre2_jit_match_16(re16, regtest_buf16, length16,
-                    current->start_offset & OFFSET_MASK, current->match_options, mdata16_1, mcontext16, getstack16());
+                    current->start_offset & OFFSET_MASK, current->match_options, mdata16_1, mcontext16);
             }
         }
 #endif
@@ -1381,8 +1383,9 @@
                 return_value32[0] = pcre2_match_32(re32, regtest_buf32, length32,
                     current->start_offset & OFFSET_MASK, current->match_options, mdata32_1, mcontext32);
             } else {
+                pcre2_jit_stack_assign_32(mcontext32, NULL, getstack32());
                 return_value32[0] = pcre2_jit_match_32(re32, regtest_buf32, length32,
-                    current->start_offset & OFFSET_MASK, current->match_options, mdata32_1, mcontext32, getstack32());
+                    current->start_offset & OFFSET_MASK, current->match_options, mdata32_1, mcontext32);
             }
         }
 #endif


Modified: code/trunk/src/pcre2_match.c
===================================================================
--- code/trunk/src/pcre2_match.c    2014-11-06 14:37:09 UTC (rev 135)
+++ code/trunk/src/pcre2_match.c    2014-11-07 12:12:52 UTC (rev 136)
@@ -6492,7 +6492,7 @@
 if (re->executable_jit != NULL && (options & ~PUBLIC_JIT_MATCH_OPTIONS) == 0)
   {
   rc = pcre2_jit_match(code, subject, length, start_offset, options,
-    match_data, mcontext, NULL);
+    match_data, mcontext);
   if (rc != PCRE2_ERROR_JIT_BADOPTION) return rc;
   }
 #endif