1 /* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */
2 /* vi: set ts=4 sw=4 expandtab: (add to ~/.vimrc: set modeline modelines=5) */
3 /* ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is [Open Source Virtual Machine.].
18 * The Initial Developer of the Original Code is
19 * Adobe System Incorporated.
20 * Portions created by the Initial Developer are Copyright (C) 1993-2006
21 * the Initial Developer. All Rights Reserved.
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #ifndef __avmshell_features__
41 #define __avmshell_features__
43 // Include the refactored, standard, system determination. It defines
44 // all the AVMSYSTEM_ names for tier-one platforms. It may be used by
45 // other feature definition files than this one.
47 #include "system-selection.h"
49 // vm features for shell builds
51 // In general these can and will be set by our external build script, and
52 // any external definition should override the ones here. So every definition
53 // here is a default and should be protected by an #ifdef
55 #ifndef AVMFEATURE_DEBUGGER
56 // DEBUGGER is typically defined by the project file and gets preferenatial
57 // treatment here, but we should get rid of DEBUGGER by and by and switch
58 // to AVMFEATURE_DEBUGGER as the only external control
60 #define AVMFEATURE_DEBUGGER 1
62 #define AVMFEATURE_DEBUGGER 0
66 #ifndef AVMFEATURE_DEBUGGER_STUB
67 #define AVMFEATURE_DEBUGGER_STUB 0
70 #ifndef AVMFEATURE_ALLOCATION_SAMPLER
71 // This is compatible with existing behavior: debugging support enables
73 #if AVMFEATURE_DEBUGGER
74 #define AVMFEATURE_ALLOCATION_SAMPLER 1
76 #define AVMFEATURE_ALLOCATION_SAMPLER 0
80 #ifndef AVMFEATURE_VTUNE
81 #define AVMFEATURE_VTUNE 0
84 #ifndef AVMFEATURE_JIT
85 #define AVMFEATURE_JIT 1
88 #ifndef AVMFEATURE_AOT
89 #define AVMFEATURE_AOT 0
92 #ifndef AVMFEATURE_ABC_INTERP
93 #define AVMFEATURE_ABC_INTERP 1
96 #ifndef AVMFEATURE_WORDCODE_INTERP
97 #define AVMFEATURE_WORDCODE_INTERP 0
100 #if AVMFEATURE_WORDCODE_INTERP
101 #ifndef AVMFEATURE_THREADED_INTERP
103 #define AVMFEATURE_THREADED_INTERP 1
105 #define AVMFEATURE_THREADED_INTERP 0
109 #define AVMFEATURE_THREADED_INTERP 0
112 #ifndef AVMFEATURE_SELFTEST
113 #define AVMFEATURE_SELFTEST 1
116 // https://bugzilla.mozilla.org/show_bug.cgi?id=491866
117 // eval is causing insteresting compilation errors that appear
118 // to be caused by a compiler bug.
120 #ifndef AVMFEATURE_EVAL
121 #define AVMFEATURE_EVAL 1
124 #define AVMFEATURE_EVAL 0
127 #ifndef AVMFEATURE_PROTECT_JITMEM
128 #define AVMFEATURE_PROTECT_JITMEM 1
131 #ifndef AVMFEATURE_SHARED_GCHEAP
132 #define AVMFEATURE_SHARED_GCHEAP 1
135 #ifndef AVMFEATURE_USE_SYSTEM_MALLOC
136 #define AVMFEATURE_USE_SYSTEM_MALLOC 0
139 #ifndef AVMFEATURE_CPP_EXCEPTIONS
140 #define AVMFEATURE_CPP_EXCEPTIONS 0
143 #ifndef AVMFEATURE_INTERIOR_POINTERS
144 #define AVMFEATURE_INTERIOR_POINTERS 0
147 #ifndef AVMFEATURE_JNI
148 #define AVMFEATURE_JNI 0
151 #ifndef AVMFEATURE_HEAP_ALLOCA
152 #if AVMSYSTEM_SYMBIAN
153 // symbian doesn't support alloca
154 #define AVMFEATURE_HEAP_ALLOCA 1
155 #elif AVMSYSTEM_WIN32 && defined(__MSVC_RUNTIME_CHECKS)
156 // MSVC's runtime stack checking isn't smart about longjmp/setjmp,
157 // and will get all crashy if used in the wrong way. RTC is typically
158 // only in Debug builds though, so just fall back to heap-always for those.
159 #define AVMFEATURE_HEAP_ALLOCA 1
161 #define AVMFEATURE_HEAP_ALLOCA 0
165 #ifndef AVMFEATURE_OVERRIDE_GLOBAL_NEW
166 #define AVMFEATURE_OVERRIDE_GLOBAL_NEW 0
169 #ifndef AVMFEATURE_MEMORY_PROFILER
170 #if AVMFEATURE_DEBUGGER
171 #if AVMSYSTEM_MAC && !(AVMSYSTEM_PPC && AVMSYSTEM_64BIT)
172 #define AVMFEATURE_MEMORY_PROFILER 1
173 #elif AVMSYSTEM_WIN32 && !AVMSYSTEM_ARM // note, does not require DEBUG
174 #define AVMFEATURE_MEMORY_PROFILER 1
176 #define AVMFEATURE_MEMORY_PROFILER 0
179 #define AVMFEATURE_MEMORY_PROFILER 0
183 #ifndef AVMFEATURE_CACHE_GQCN
184 #define AVMFEATURE_CACHE_GQCN 1
187 #if AVMSYSTEM_SYMBIAN
188 #undef AVMFEATURE_SELFTEST
189 #define AVMFEATURE_SELFTEST 0
190 //#define NJ_NO_VARIADIC_MACROS
191 #undef AVMFEATURE_JIT
193 #define AVMFEATURE_JIT 1
195 #define AVMFEATURE_JIT 0
196 #endif // AVMSYSTEM_ARM
197 #undef AVMFEATURE_HEAP_ALLOCA
198 #define AVMFEATURE_HEAP_ALLOCA 1
199 #undef AVMFEATURE_OVERRIDE_GLOBAL_NEW
200 #define AVMFEATURE_OVERRIDE_GLOBAL_NEW 0
201 #undef AVMFEATURE_EVAL // Don't compile in this feature yet.
202 #define AVMFEATURE_EVAL 0
203 #if AVMSYSTEM_SYMBIAN && AVMSYSTEM_IA32
204 #undef AVMFEATURE_CPP_EXCEPTIONS
205 #define AVMFEATURE_CPP_EXCEPTIONS 1 // winscw compiler wants
206 #endif // AVMSYSTEM_SYMBIAN && AVMSYSTEM_IA32
207 #endif // AVMSYSTEM_SYMBIAN
209 #ifndef AVMFEATURE_BUFFER_GUARD
210 #define AVMFEATURE_BUFFER_GUARD 0
213 #ifndef AVMFEATURE_VALGRIND
214 #define AVMFEATURE_VALGRIND 0
217 #ifndef AVMFEATURE_SWF12
218 #define AVMFEATURE_SWF12 1
221 #ifndef AVMFEATURE_SWF13
222 #define AVMFEATURE_SWF13 1
225 #ifndef AVMFEATURE_SWF14
226 #define AVMFEATURE_SWF14 0
229 #ifndef AVMFEATURE_SWF15
230 #define AVMFEATURE_SWF15 0
233 #ifndef AVMFEATURE_SWF16
234 #define AVMFEATURE_SWF16 0
237 #ifndef AVMFEATURE_SWF17
238 #define AVMFEATURE_SWF17 0
241 #ifndef AVMFEATURE_SWF18
242 #define AVMFEATURE_SWF18 0
245 #ifndef AVMFEATURE_SWF19
246 #define AVMFEATURE_SWF19 0
249 #ifndef AVMFEATURE_SWF20
250 #define AVMFEATURE_SWF20 0
253 #endif // __avmshell_features__