* merged default branch into jitcache-arm-x86 branch
[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 extern bool compileall;
92
93 extern bool loadverbose;         /* Print debug messages during loading */
94 extern bool initverbose;         /* Log class initialization */ 
95
96 extern bool opt_verboseclass;
97 extern bool opt_verbosegc;
98 extern bool opt_verbosejni;
99 extern bool opt_verbosecall;
100
101 extern bool showmethods;
102 extern bool showconstantpool;
103 extern bool showutf;
104
105 extern char *opt_method;
106 extern char *opt_signature;
107
108 extern bool compileverbose;
109 extern bool showstack;
110
111 extern bool opt_showdisassemble;
112 extern bool opt_showddatasegment;
113 extern bool opt_showintermediate;
114
115 extern bool checkbounds;
116 extern bool checksync;
117 #if defined(ENABLE_LOOP)
118 extern bool opt_loops;
119 #endif
120
121 extern bool makeinitializations;
122
123 #if defined(ENABLE_STATISTICS)
124 extern bool opt_stat;
125 extern bool opt_getloadingtime;
126 extern bool opt_getcompilingtime;
127 #endif
128 #if defined(ENABLE_VERIFIER)
129 extern bool opt_verify;
130 #endif
131
132 #if defined(ENABLE_PROFILING)
133 extern bool opt_prof;
134 extern bool opt_prof_bb;
135 #endif
136
137 /* optimization options *******************************************************/
138
139 #if defined(ENABLE_IFCONV)
140 extern bool opt_ifconv;
141 #endif
142
143 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
144 extern bool opt_lsra;
145 #endif
146 #if defined(ENABLE_SSA)
147 extern bool opt_ssa_dce;          /* enable dead code elemination */
148 extern bool opt_ssa_cp;           /* enable copy propagation      */
149 #endif
150
151 /* interpreter options ********************************************************/
152
153 #if defined(ENABLE_INTRP)
154 extern bool opt_no_dynamic;
155 extern bool opt_no_replication;
156 extern bool opt_no_quicksuper;
157
158 extern s4   opt_static_supers;
159 extern bool vm_debug;
160 #endif
161
162 /* debug output filtering options *********************************************/
163
164 #if defined(ENABLE_DEBUG_FILTER)
165 extern const char *opt_filter_verbosecall_include;
166 extern const char *opt_filter_verbosecall_exclude;
167 extern const char *opt_filter_show_method;
168 #endif
169
170
171 /* -XX options ****************************************************************/
172
173 /* NOTE: For better readability keep these alpha-sorted. */
174
175 /* Options which must always be available (production options in
176    HotSpot). */
177
178 extern int64_t  opt_MaxDirectMemorySize;
179 extern int      opt_MaxPermSize;
180 extern int      opt_PermSize;
181 extern int      opt_ThreadStackSize;
182
183 /* Debugging options which can be turned off. */
184
185 extern bool     opt_AlwaysEmitLongBranches;
186 extern int      opt_DebugExceptions;
187 extern int      opt_DebugFinalizer;
188 #if defined(ENABLE_JITCACHE)
189 extern int      opt_DebugJitCache;
190 #endif
191 extern int      opt_DebugLocalReferences;
192 extern int      opt_DebugLocks;
193 extern int      opt_DebugPatcher;
194 extern int      opt_DebugPackage;
195 extern int      opt_DebugProperties;
196 extern int      opt_DebugStackFrameInfo;
197 extern int      opt_DebugStackTrace;
198 extern int      opt_DebugThreads;
199 #if defined(ENABLE_DISASSEMBLER)
200 extern int      opt_DisassembleStubs;
201 #endif
202 #if defined(ENABLE_OPAGENT)
203 extern int      opt_EnableOpagent;
204 #endif
205 #if defined(ENABLE_GC_CACAO)
206 extern int      opt_GCDebugRootSet;
207 extern int      opt_GCStress;
208 #endif
209 #if defined(ENABLE_INLINING)
210 extern int      opt_Inline;
211 #if defined(ENABLE_INLINING_DEBUG) || !defined(NDEBUG)
212 extern int      opt_InlineAll;
213 extern int      opt_InlineCount;
214 extern int      opt_InlineMaxSize;
215 extern int      opt_InlineMinSize;
216 #endif
217 #endif
218 extern int      opt_PrintConfig;
219 extern int      opt_ProfileGCMemoryUsage;
220 extern int      opt_ProfileMemoryUsage;
221 extern FILE    *opt_ProfileMemoryUsageGNUPlot;
222 #if defined(ENABLE_REPLACEMENT)
223 extern int      opt_TestReplacement;
224 #endif
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 int      opt_TraceJNICalls;
233 extern int      opt_TraceJVMCalls;
234 extern int      opt_TraceJVMCallsVerbose;
235 extern int      opt_TraceLinkClass;
236 #if defined(ENABLE_REPLACEMENT)
237 extern int      opt_TraceReplacement;
238 #endif
239 extern int      opt_TraceSubsystemInitialization;
240 extern int      opt_TraceTraps;
241
242
243 /* function prototypes ********************************************************/
244
245 int  options_get(opt_struct *opts, JavaVMInitArgs *vm_args);
246 void options_xx(JavaVMInitArgs *vm_args);
247
248
249 /* debug **********************************************************************/
250
251 #if !defined(NDEBUG)
252 # define TRACESUBSYSTEMINITIALIZATION(text)                                             \
253     do {                                                                                                                \
254         if (opt_TraceSubsystemInitialization) {                                 \
255             log_println("[Initializing subsystem: %s]", text);  \
256         }                                                                                                               \
257     } while (0)
258 #else
259 # define TRACESUBSYSTEMINITIALIZATION(text)
260 #endif
261
262 #ifdef __cplusplus
263 }
264 #endif
265
266 #endif /* _OPTIONS_H */
267
268
269 /*
270  * These are local overrides for various environment variables in Emacs.
271  * Please do not remove this and leave it at the end of the file, where
272  * Emacs will automagically detect them.
273  * ---------------------------------------------------------------------
274  * Local variables:
275  * mode: c
276  * indent-tabs-mode: t
277  * c-basic-offset: 4
278  * tab-width: 4
279  * End:
280  */