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

トップ ページ
このメッセージを削除
著者: Subversion repository
日付:  
To: pcre-svn
題目: [Pcre-svn] [1512] code/trunk: JIT compiler update.
Revision: 1512
          http://vcs.pcre.org/viewvc?view=rev&revision=1512
Author:   zherczeg
Date:     2014-11-09 07:27:16 +0000 (Sun, 09 Nov 2014)


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

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


Modified: code/trunk/pcre_jit_compile.c
===================================================================
--- code/trunk/pcre_jit_compile.c    2014-11-07 12:18:54 UTC (rev 1511)
+++ code/trunk/pcre_jit_compile.c    2014-11-09 07:27:16 UTC (rev 1512)
@@ -10359,7 +10359,7 @@
 functions->executable_sizes[mode] = executable_size;
 }


-static int jit_machine_stack_exec(jit_arguments *arguments, void *executable_func)
+static SLJIT_NOINLINE int jit_machine_stack_exec(jit_arguments *arguments, void *executable_func)
 {
 union {
    void *executable_func;


Modified: code/trunk/sljit/sljitConfigInternal.h
===================================================================
--- code/trunk/sljit/sljitConfigInternal.h    2014-11-07 12:18:54 UTC (rev 1511)
+++ code/trunk/sljit/sljitConfigInternal.h    2014-11-09 07:27:16 UTC (rev 1512)
@@ -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/sljit/sljitLir.c
===================================================================
--- code/trunk/sljit/sljitLir.c    2014-11-07 12:18:54 UTC (rev 1511)
+++ code/trunk/sljit/sljitLir.c    2014-11-09 07:27:16 UTC (rev 1512)
@@ -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/sljit/sljitUtils.c
===================================================================
--- code/trunk/sljit/sljitUtils.c    2014-11-07 12:18:54 UTC (rev 1511)
+++ code/trunk/sljit/sljitUtils.c    2014-11-09 07:27:16 UTC (rev 1512)
@@ -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