[Pcre-svn] [139] code/trunk/src: JIT compiler update.

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [139] code/trunk/src: JIT compiler update.
Revision: 139
          http://www.exim.org/viewvc/pcre2?view=rev&revision=139
Author:   zherczeg
Date:     2014-11-09 07:23:55 +0000 (Sun, 09 Nov 2014)


Log Message:
-----------
JIT compiler update.

Modified Paths:
--------------
    code/trunk/src/pcre2_jit_match.c
    code/trunk/src/sljit/sljitConfigInternal.h
    code/trunk/src/sljit/sljitLir.c
    code/trunk/src/sljit/sljitUtils.c


Modified: code/trunk/src/pcre2_jit_match.c
===================================================================
--- code/trunk/src/pcre2_jit_match.c    2014-11-08 16:09:24 UTC (rev 138)
+++ code/trunk/src/pcre2_jit_match.c    2014-11-09 07:23:55 UTC (rev 139)
@@ -44,7 +44,7 @@


#ifdef SUPPORT_JIT

-static int jit_machine_stack_exec(jit_arguments *arguments, jit_function executable_func)
+static SLJIT_NOINLINE int jit_machine_stack_exec(jit_arguments *arguments, jit_function executable_func)
{
sljit_ub local_space[MACHINE_STACK_SIZE];
struct sljit_stack local_stack;

Modified: code/trunk/src/sljit/sljitConfigInternal.h
===================================================================
--- code/trunk/src/sljit/sljitConfigInternal.h    2014-11-08 16:09:24 UTC (rev 138)
+++ code/trunk/src/sljit/sljitConfigInternal.h    2014-11-09 07:23:55 UTC (rev 139)
@@ -243,6 +243,15 @@
 #endif
 #endif /* !SLJIT_INLINE */


+#ifndef SLJIT_NOINLINE
+/* Not inline functions. */
+#if defined(__GNUC__)
+#define SLJIT_NOINLINE __attribute__ ((noinline))
+#else
+#define SLJIT_NOINLINE
+#endif
+#endif /* !SLJIT_INLINE */
+
#ifndef SLJIT_CONST
/* Const variables. */
#define SLJIT_CONST const

Modified: code/trunk/src/sljit/sljitLir.c
===================================================================
--- code/trunk/src/sljit/sljitLir.c    2014-11-08 16:09:24 UTC (rev 138)
+++ code/trunk/src/sljit/sljitLir.c    2014-11-09 07:23:55 UTC (rev 139)
@@ -1325,6 +1325,7 @@
     CHECK_ARGUMENT(!(type & ~(0xff | SLJIT_REWRITABLE_JUMP | SLJIT_INT_OP)));
     CHECK_ARGUMENT((type & 0xff) >= SLJIT_EQUAL && (type & 0xff) <= SLJIT_CALL3);
     CHECK_ARGUMENT((type & 0xff) < SLJIT_JUMP || !(type & SLJIT_INT_OP));
+    CHECK_ARGUMENT((type & 0xff) <= SLJIT_CALL0 || ((type & 0xff) - SLJIT_CALL0) <= compiler->scratches);
 #endif
 #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)
     if (SLJIT_UNLIKELY(!!compiler->verbose))
@@ -1390,6 +1391,7 @@


 #if (defined SLJIT_ARGUMENT_CHECKS && SLJIT_ARGUMENT_CHECKS)
     CHECK_ARGUMENT(type >= SLJIT_JUMP && type <= SLJIT_CALL3);
+    CHECK_ARGUMENT(type <= SLJIT_CALL0 || (type - SLJIT_CALL0) <= compiler->scratches);
     FUNCTION_CHECK_SRC(src, srcw);
 #endif
 #if (defined SLJIT_VERBOSE && SLJIT_VERBOSE)


Modified: code/trunk/src/sljit/sljitUtils.c
===================================================================
--- code/trunk/src/sljit/sljitUtils.c    2014-11-08 16:09:24 UTC (rev 138)
+++ code/trunk/src/sljit/sljitUtils.c    2014-11-09 07:23:55 UTC (rev 139)
@@ -211,6 +211,7 @@
     SYSTEM_INFO si;
 #endif


+    SLJIT_UNUSED_ARG(allocator_data);
     if (limit > max_limit || limit < 1)
         return NULL;


@@ -239,14 +240,14 @@
 #ifdef _WIN32
     base.ptr = VirtualAlloc(NULL, max_limit, MEM_RESERVE, PAGE_READWRITE);
     if (!base.ptr) {
-        SLJIT_FREE(stack);
+        SLJIT_FREE(stack, allocator_data);
         return NULL;
     }
     stack->base = base.uw;
     stack->limit = stack->base;
     stack->max_limit = stack->base + max_limit;
     if (sljit_stack_resize(stack, stack->base + limit)) {
-        sljit_free_stack(stack);
+        sljit_free_stack(stack, allocator_data);
         return NULL;
     }
 #else
@@ -255,7 +256,7 @@
 #else
     if (dev_zero < 0) {
         if (open_dev_zero()) {
-            SLJIT_FREE(stack);
+            SLJIT_FREE(stack, allocator_data);
             return NULL;
         }
     }
@@ -277,6 +278,7 @@


 SLJIT_API_FUNC_ATTRIBUTE void SLJIT_CALL sljit_free_stack(struct sljit_stack* stack, void *allocator_data)
 {
+    SLJIT_UNUSED_ARG(allocator_data);
 #ifdef _WIN32
     VirtualFree((void*)stack->base, 0, MEM_RELEASE);
 #else