merged volatile memory barriers
[cacao.git] / src / vm / options.h
1 /* src/vm/options.h - define global options extern
2
3    Copyright (C) 1996-2005, 2006, 2007, 2008
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2, or (at
11    your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _OPTIONS_H
27 #define _OPTIONS_H
28
29 #include "config.h"
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 #include <stdint.h>
36
37 #include "vm/types.h"
38
39 #include "native/jni.hpp"
40
41 #include "vm/global.h"
42
43
44 /* reserved option numbers ****************************************************/
45
46 /* define these negative since the other options are an enum */
47
48 #define OPT_DONE       -1
49 #define OPT_ERROR      -2
50 #define OPT_IGNORE     -3
51
52
53 typedef struct opt_struct opt_struct;
54
55 struct opt_struct {
56         const char *name;
57         bool        arg;
58         int         value;
59 };
60
61
62 typedef struct option_t option_t;
63
64 struct option_t {
65         const char *name;
66         int         value;
67         int         type;
68         const char *doc;
69 };
70
71
72 /* global variables ***********************************************************/
73
74 extern s4    opt_index;
75 extern char *opt_arg;
76
77 extern bool opt_foo;
78
79 extern bool opt_jit;
80 extern bool opt_intrp;
81
82 extern bool opt_jar;
83 extern bool opt_run;
84
85 extern s4   opt_heapmaxsize;
86 extern s4   opt_heapstartsize;
87 extern s4   opt_stacksize;
88
89 extern bool opt_verbose;
90 extern bool opt_debugcolor;
91
92 extern bool loadverbose;         /* Print debug messages during loading */
93 extern bool initverbose;         /* Log class initialization */ 
94
95 extern bool opt_verboseclass;
96 extern bool opt_verbosegc;
97 extern bool opt_verbosejni;
98 extern bool opt_verbosecall;
99
100 extern bool showmethods;
101 extern bool showconstantpool;
102 extern bool showutf;
103
104 extern bool compileverbose;
105 extern bool showstack;
106
107 extern bool opt_showdisassemble;
108 extern bool opt_showddatasegment;
109 extern bool opt_showintermediate;
110
111 extern bool checkbounds;
112 extern bool checksync;
113 #if defined(ENABLE_LOOP)
114 extern bool opt_loops;
115 #endif
116
117 extern bool makeinitializations;
118
119 #if defined(ENABLE_STATISTICS)
120 extern bool opt_stat;
121 extern bool opt_getloadingtime;
122 extern bool opt_getcompilingtime;
123 #endif
124 #if defined(ENABLE_VERIFIER)
125 extern bool opt_verify;
126 #endif
127
128 #if defined(ENABLE_PROFILING)
129 extern bool opt_prof;
130 extern bool opt_prof_bb;
131 #endif
132
133 /* optimization options *******************************************************/
134
135 #if defined(ENABLE_IFCONV)
136 extern bool opt_ifconv;
137 #endif
138
139 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
140 extern bool opt_lsra;
141 #endif
142 #if defined(ENABLE_SSA)
143 extern bool opt_ssa_dce;          /* enable dead code elemination */
144 extern bool opt_ssa_cp;           /* enable copy propagation      */
145 #endif
146
147 /* interpreter options ********************************************************/
148
149 #if defined(ENABLE_INTRP)
150 extern bool opt_no_dynamic;
151 extern bool opt_no_replication;
152 extern bool opt_no_quicksuper;
153
154 extern s4   opt_static_supers;
155 extern bool vm_debug;
156 #endif
157
158 /* debug output filtering options *********************************************/
159
160 #if defined(ENABLE_DEBUG_FILTER)
161 extern const char *opt_filter_verbosecall_include;
162 extern const char *opt_filter_verbosecall_exclude;
163 extern const char *opt_filter_show_method;
164 #endif
165
166
167 /* -XX options ****************************************************************/
168
169 /* NOTE: For better readability keep these alpha-sorted. */
170
171 /* Options which must always be available (production options in
172    HotSpot). */
173
174 extern int64_t  opt_MaxDirectMemorySize;
175 extern int      opt_MaxPermSize;
176 extern int      opt_PermSize;
177 extern int      opt_ThreadStackSize;
178
179 /* Debugging options which can be turned off. */
180
181 extern bool     opt_AlwaysEmitLongBranches;
182 extern bool     opt_AlwaysMmapFirstPage;
183 extern int      opt_CompileAll;
184 extern char*    opt_CompileMethod;
185 extern char*    opt_CompileSignature;
186 extern int      opt_DebugExceptions;
187 extern int      opt_DebugFinalizer;
188 extern int      opt_DebugLocalReferences;
189 extern int      opt_DebugLocks;
190 extern int      opt_DebugPatcher;
191 extern int      opt_DebugPackage;
192 extern int      opt_DebugProperties;
193 extern int      opt_DebugStackFrameInfo;
194 extern int      opt_DebugStackTrace;
195 extern int      opt_DebugThreads;
196 #if defined(ENABLE_DISASSEMBLER)
197 extern int      opt_DisassembleStubs;
198 #endif
199 #if defined(ENABLE_OPAGENT)
200 extern int      opt_EnableOpagent;
201 #endif
202 #if defined(ENABLE_GC_CACAO)
203 extern int      opt_GCDebugRootSet;
204 extern int      opt_GCStress;
205 #endif
206 #if defined(ENABLE_INLINING)
207 extern int      opt_Inline;
208 #if defined(ENABLE_INLINING_DEBUG) || !defined(NDEBUG)
209 extern int      opt_InlineAll;
210 extern int      opt_InlineCount;
211 extern int      opt_InlineMaxSize;
212 extern int      opt_InlineMinSize;
213 #endif
214 #endif
215 extern int      opt_PrintConfig;
216 extern int      opt_PrintWarnings;
217 extern int      opt_ProfileGCMemoryUsage;
218 extern int      opt_ProfileMemoryUsage;
219 extern FILE    *opt_ProfileMemoryUsageGNUPlot;
220 extern int      opt_RegallocSpillAll;
221 #if defined(ENABLE_REPLACEMENT)
222 extern int      opt_TestReplacement;
223 #endif
224 extern int      opt_TraceBuiltinCalls;
225 extern int      opt_TraceCompilerCalls;
226 extern int      opt_TraceExceptions;
227 extern int      opt_TraceHPI;
228 #if defined(ENABLE_INLINING) && !defined(NDEBUG)
229 extern int      opt_TraceInlining;
230 #endif
231 extern int      opt_TraceJavaCalls;
232 extern bool     opt_TraceJMMCalls;
233 extern int      opt_TraceJNICalls;
234 extern int      opt_TraceJVMCalls;
235 extern int      opt_TraceJVMCallsVerbose;
236 #if defined(ENABLE_JVMTI)
237 extern int      opt_TraceJVMTICalls;
238 #endif
239 extern int      opt_TraceLinkClass;
240 #if defined(ENABLE_REPLACEMENT)
241 extern int      opt_TraceReplacement;
242 #endif
243 extern int      opt_TraceSubsystemInitialization;
244 extern int      opt_TraceTraps;
245
246
247 /* function prototypes ********************************************************/
248
249 int  options_get(opt_struct *opts, JavaVMInitArgs *vm_args);
250 void options_xx(JavaVMInitArgs *vm_args);
251
252
253 /* debug **********************************************************************/
254
255 #if !defined(NDEBUG)
256 # define TRACESUBSYSTEMINITIALIZATION(text)                                             \
257     do {                                                                                                                \
258         if (opt_TraceSubsystemInitialization) {                                 \
259             log_println("[Initializing subsystem: %s]", text);  \
260         }                                                                                                               \
261     } while (0)
262 #else
263 # define TRACESUBSYSTEMINITIALIZATION(text)
264 #endif
265
266 #ifdef __cplusplus
267 }
268 #endif
269
270 #endif /* _OPTIONS_H */
271
272
273 /*
274  * These are local overrides for various environment variables in Emacs.
275  * Please do not remove this and leave it at the end of the file, where
276  * Emacs will automagically detect them.
277  * ---------------------------------------------------------------------
278  * Local variables:
279  * mode: c
280  * indent-tabs-mode: t
281  * c-basic-offset: 4
282  * tab-width: 4
283  * End:
284  */