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

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [981] code/trunk/src: JIT compiler update.
Revision: 981
          http://www.exim.org/viewvc/pcre2?view=rev&revision=981
Author:   zherczeg
Date:     2018-08-13 10:21:18 +0100 (Mon, 13 Aug 2018)
Log Message:
-----------
JIT compiler update.


Modified Paths:
--------------
    code/trunk/src/config.h.in
    code/trunk/src/sljit/sljitConfigInternal.h
    code/trunk/src/sljit/sljitExecAllocator.c
    code/trunk/src/sljit/sljitLir.h


Modified: code/trunk/src/config.h.in
===================================================================
--- code/trunk/src/config.h.in    2018-08-10 16:27:44 UTC (rev 980)
+++ code/trunk/src/config.h.in    2018-08-13 09:21:18 UTC (rev 981)
@@ -144,7 +144,8 @@
    instead. This allows for longer patterns in extreme cases. */
 #undef LINK_SIZE


-/* Define to the sub-directory where libtool stores uninstalled libraries. */
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
#undef LT_OBJDIR

/* The value of MATCH_LIMIT determines the default number of times the

Modified: code/trunk/src/sljit/sljitConfigInternal.h
===================================================================
--- code/trunk/src/sljit/sljitConfigInternal.h    2018-08-10 16:27:44 UTC (rev 980)
+++ code/trunk/src/sljit/sljitConfigInternal.h    2018-08-13 09:21:18 UTC (rev 981)
@@ -66,7 +66,7 @@
      SLJIT_RETURN_ADDRESS_OFFSET : a return instruction always adds this offset to the return address


    Other macros:
-     SLJIT_FUNC : calling convention attribute for both calling JIT form C and C calling back from JIT
+     SLJIT_FUNC : calling convention attribute for both calling JIT from C and C calling back from JIT
      SLJIT_W(number) : defining 64 bit constants on 64 bit architectures (compiler independent helper)
 */



Modified: code/trunk/src/sljit/sljitExecAllocator.c
===================================================================
--- code/trunk/src/sljit/sljitExecAllocator.c    2018-08-10 16:27:44 UTC (rev 980)
+++ code/trunk/src/sljit/sljitExecAllocator.c    2018-08-13 09:21:18 UTC (rev 981)
@@ -99,7 +99,14 @@
     void *retval;


 #ifdef MAP_ANON
-    retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0);
+
+    int flags = MAP_PRIVATE | MAP_ANON;
+
+#ifdef MAP_JIT
+    flags |= MAP_JIT;
+#endif
+
+    retval = mmap(NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC, flags, -1, 0);
 #else
     if (dev_zero < 0) {
         if (open_dev_zero())


Modified: code/trunk/src/sljit/sljitLir.h
===================================================================
--- code/trunk/src/sljit/sljitLir.h    2018-08-10 16:27:44 UTC (rev 980)
+++ code/trunk/src/sljit/sljitLir.h    2018-08-13 09:21:18 UTC (rev 981)
@@ -138,7 +138,7 @@
   be specified as scratch registers and the fifth one as saved register
   on the CPU above and any user code which requires four scratch
   registers can run unmodified. The SLJIT compiler automatically saves
-  the content of the two extra scrath register on the stack. Scratch
+  the content of the two extra scratch register on the stack. Scratch
   registers can also be preserved by saving their value on the stack
   but this needs to be done manually.


@@ -746,7 +746,7 @@
    be mixed. The only exception is SLJIT_MOV32 and SLJIT_MOVU32 whose source
    register can hold any 32 or 64 bit value, and it is converted to a 32 bit
    compatible format first. This conversion is free (no instructions are
-   emitted) on most CPUs. A 32 bit value can also be coverted to a 64 bit
+   emitted) on most CPUs. A 32 bit value can also be converted to a 64 bit
    value by SLJIT_MOV_S32 (sign extension) or SLJIT_MOV_U32 (zero extension).


    Note: memory addressing always uses 64 bit values on 64 bit systems so
@@ -773,8 +773,8 @@
  */
 #define SLJIT_F32_OP        SLJIT_I32_OP


-/* Many CPUs (x86, ARM, PPC) has status flags which can be set according
-   to the result of an operation. Other CPUs (MIPS) does not have status
+/* Many CPUs (x86, ARM, PPC) have status flags which can be set according
+   to the result of an operation. Other CPUs (MIPS) do not have status
    flags, and results must be stored in registers. To cover both architecture
    types efficiently only two flags are defined by SLJIT:


@@ -810,7 +810,7 @@

    Using these flags can reduce the number of emitted instructions. E.g. a
    fast loop can be implemented by decreasing a counter register and set the
-   zero flag to jump back if the counter register is not reached zero.
+   zero flag to jump back if the counter register has not reached zero.


    Motivation: although CPUs can set a large number of flags, usually their
    values are ignored or only one of them is used. Emulating a large number
@@ -817,7 +817,7 @@
    of flags on systems without flag register is complicated so SLJIT
    instructions must specify the flag they want to use and only that flag
    will be emulated. The last arithmetic instruction can be repeated if
-   multiple flags needs to be checked.
+   multiple flags need to be checked.
 */


 /* Set Zero status flag. */
@@ -884,7 +884,7 @@
 /* Starting index of opcodes for sljit_emit_op1. */
 #define SLJIT_OP1_BASE            32


-/* The MOV instruction transfer data from source to destination.
+/* The MOV instruction transfers data from source to destination.

    MOV instruction suffixes:


@@ -1156,7 +1156,7 @@
 #define SLJIT_FAST_CALL            25
     /* Called function must be declared with the SLJIT_FUNC attribute. */
 #define SLJIT_CALL            26
-    /* Called function must be decalred with cdecl attribute.
+    /* Called function must be declared with cdecl attribute.
        This is the default attribute for C functions. */
 #define SLJIT_CALL_CDECL        27


@@ -1210,7 +1210,7 @@
/* Set the destination address of the jump to this label. */
SLJIT_API_FUNC_ATTRIBUTE void sljit_set_target(struct sljit_jump *jump, sljit_uw target);

-/* Emit an indirect jump or fast call. Both direct and indirect form
+/* Emit an indirect jump or fast call.
    Direct form: set src to SLJIT_IMM() and srcw to the address
    Indirect form: any other valid addressing mode
     type must be between SLJIT_JUMP and SLJIT_FAST_CALL
@@ -1274,7 +1274,7 @@
 #define SLJIT_MEM_POST        0x1000


 /* Emit a single memory load or store with update instruction. When the
-   requested instruction from is not supported by the CPU, it returns
+   requested instruction form is not supported by the CPU, it returns
    with SLJIT_ERR_UNSUPPORTED instead of emulating the instruction. This
    allows specializing tight loops based on the supported instruction
    forms (see SLJIT_MEM_SUPP flag).