• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *    Stack-less Just-In-Time compiler
3  *
4  *    Copyright Zoltan Herczeg (hzmester@freemail.hu). All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without modification, are
7  * permitted provided that the following conditions are met:
8  *
9  *   1. Redistributions of source code must retain the above copyright notice, this list of
10  *      conditions and the following disclaimer.
11  *
12  *   2. Redistributions in binary form must reproduce the above copyright notice, this list
13  *      of conditions and the following disclaimer in the documentation and/or other materials
14  *      provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND CONTRIBUTORS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
19  * SHALL THE COPYRIGHT HOLDER(S) OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21  * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
22  * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25  */
26 
27 #ifndef _SLJIT_CONFIG_H_
28 #define _SLJIT_CONFIG_H_
29 
30 /* --------------------------------------------------------------------- */
31 /*  Custom defines                                                       */
32 /* --------------------------------------------------------------------- */
33 
34 /* Put your custom defines here. This empty section will never change
35    which helps maintaining patches (with diff / patch utilities). */
36 
37 /* --------------------------------------------------------------------- */
38 /*  Architecture                                                         */
39 /* --------------------------------------------------------------------- */
40 
41 /* Architecture selection. */
42 /* #define SLJIT_CONFIG_X86_32 1 */
43 /* #define SLJIT_CONFIG_X86_64 1 */
44 /* #define SLJIT_CONFIG_ARM_V5 1 */
45 /* #define SLJIT_CONFIG_ARM_V7 1 */
46 /* #define SLJIT_CONFIG_ARM_THUMB2 1 */
47 /* #define SLJIT_CONFIG_ARM_64 1 */
48 /* #define SLJIT_CONFIG_PPC_32 1 */
49 /* #define SLJIT_CONFIG_PPC_64 1 */
50 /* #define SLJIT_CONFIG_MIPS_32 1 */
51 /* #define SLJIT_CONFIG_MIPS_64 1 */
52 /* #define SLJIT_CONFIG_SPARC_32 1 */
53 /* #define SLJIT_CONFIG_TILEGX 1 */
54 
55 /* #define SLJIT_CONFIG_AUTO 1 */
56 /* #define SLJIT_CONFIG_UNSUPPORTED 1 */
57 
58 /* --------------------------------------------------------------------- */
59 /*  Utilities                                                            */
60 /* --------------------------------------------------------------------- */
61 
62 /* Useful for thread-safe compiling of global functions. */
63 #ifndef SLJIT_UTIL_GLOBAL_LOCK
64 /* Enabled by default */
65 #define SLJIT_UTIL_GLOBAL_LOCK 1
66 #endif
67 
68 /* Implements a stack like data structure (by using mmap / VirtualAlloc). */
69 #ifndef SLJIT_UTIL_STACK
70 /* Enabled by default */
71 #define SLJIT_UTIL_STACK 1
72 #endif
73 
74 /* Single threaded application. Does not require any locks. */
75 #ifndef SLJIT_SINGLE_THREADED
76 /* Disabled by default. */
77 #define SLJIT_SINGLE_THREADED 0
78 #endif
79 
80 /* --------------------------------------------------------------------- */
81 /*  Configuration                                                        */
82 /* --------------------------------------------------------------------- */
83 
84 /* If SLJIT_STD_MACROS_DEFINED is not defined, the application should
85    define SLJIT_MALLOC, SLJIT_FREE, SLJIT_MEMCPY, and NULL. */
86 #ifndef SLJIT_STD_MACROS_DEFINED
87 /* Disabled by default. */
88 #define SLJIT_STD_MACROS_DEFINED 0
89 #endif
90 
91 /* Executable code allocation:
92    If SLJIT_EXECUTABLE_ALLOCATOR is not defined, the application should
93    define SLJIT_MALLOC_EXEC, SLJIT_FREE_EXEC, and SLJIT_EXEC_OFFSET. */
94 #ifndef SLJIT_EXECUTABLE_ALLOCATOR
95 /* Enabled by default. */
96 #define SLJIT_EXECUTABLE_ALLOCATOR 1
97 
98 /* When SLJIT_PROT_EXECUTABLE_ALLOCATOR is enabled SLJIT uses
99    an allocator which does not set writable and executable
100    permission flags at the same time. The trade-of is increased
101    memory consumption and disabled dynamic code modifications. */
102 #ifndef SLJIT_PROT_EXECUTABLE_ALLOCATOR
103 /* Disabled by default. */
104 #define SLJIT_PROT_EXECUTABLE_ALLOCATOR 0
105 #endif
106 
107 #endif
108 
109 /* Force cdecl calling convention even if a better calling
110    convention (e.g. fastcall) is supported by the C compiler.
111    If this option is disabled (this is the default), functions
112    called from JIT should be defined with SLJIT_FUNC attribute.
113    Standard C functions can still be called by using the
114    SLJIT_CALL_CDECL jump type. */
115 #ifndef SLJIT_USE_CDECL_CALLING_CONVENTION
116 /* Disabled by default */
117 #define SLJIT_USE_CDECL_CALLING_CONVENTION 0
118 #endif
119 
120 /* Return with error when an invalid argument is passed. */
121 #ifndef SLJIT_ARGUMENT_CHECKS
122 /* Disabled by default */
123 #define SLJIT_ARGUMENT_CHECKS 0
124 #endif
125 
126 /* Debug checks (assertions, etc.). */
127 #ifndef SLJIT_DEBUG
128 /* Enabled by default */
129 #define SLJIT_DEBUG 1
130 #endif
131 
132 /* Verbose operations. */
133 #ifndef SLJIT_VERBOSE
134 /* Enabled by default */
135 #define SLJIT_VERBOSE 1
136 #endif
137 
138 /*
139   SLJIT_IS_FPU_AVAILABLE
140     The availability of the FPU can be controlled by SLJIT_IS_FPU_AVAILABLE.
141       zero value - FPU is NOT present.
142       nonzero value - FPU is present.
143 */
144 
145 /* For further configurations, see the beginning of sljitConfigInternal.h */
146 
147 #endif
148