Merge -> trunk
[cacao.git] / src / vmcore / options.h
1 /* src/vmcore/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
30 #include "config.h"
31
32 #include <stdint.h>
33
34 #include "vm/types.h"
35
36 #include "native/jni.h"
37
38 #include "vm/global.h"
39
40
41 /* reserved option numbers ****************************************************/
42
43 /* define these negative since the other options are an enum */
44
45 #define OPT_DONE       -1
46 #define OPT_ERROR      -2
47 #define OPT_IGNORE     -3
48
49
50 typedef struct opt_struct opt_struct;
51
52 struct opt_struct {
53         char *name;
54         bool  arg;
55         int   value;
56 };
57
58
59 typedef struct option_t option_t;
60
61 struct option_t {
62         char *name;
63         int   value;
64         int   type;
65         char *doc;
66 };
67
68
69 /* global variables ***********************************************************/
70
71 extern s4    opt_index;
72 extern char *opt_arg;
73
74 extern bool opt_foo;
75
76 extern bool opt_jit;
77 extern bool opt_intrp;
78
79 extern bool opt_jar;
80 extern bool opt_run;
81
82 extern s4   opt_heapmaxsize;
83 extern s4   opt_heapstartsize;
84 extern s4   opt_stacksize;
85
86 extern bool opt_verbose;
87 extern bool opt_debugcolor;
88 extern bool compileall;
89
90 extern bool loadverbose;         /* Print debug messages during loading */
91 extern bool initverbose;         /* Log class initialization */ 
92
93 extern bool opt_verboseclass;
94 extern bool opt_verbosegc;
95 extern bool opt_verbosejni;
96 extern bool opt_verbosecall;
97
98 extern bool showmethods;
99 extern bool showconstantpool;
100 extern bool showutf;
101
102 extern char *opt_method;
103 extern char *opt_signature;
104
105 extern bool compileverbose;
106 extern bool showstack;
107
108 extern bool opt_showdisassemble;
109 extern bool opt_shownops;
110 extern bool opt_showddatasegment;
111 extern bool opt_showintermediate;
112
113 extern bool checkbounds;
114 extern bool opt_noieee;
115 extern bool checksync;
116 #if defined(ENABLE_LOOP)
117 extern bool opt_loops;
118 #endif
119
120 extern bool makeinitializations;
121
122 #if defined(ENABLE_STATISTICS)
123 extern bool opt_stat;
124 extern bool opt_getloadingtime;
125 extern bool opt_getcompilingtime;
126 #endif
127 #if defined(ENABLE_VERIFIER)
128 extern bool opt_verify;
129 #endif
130
131 #if defined(ENABLE_PROFILING)
132 extern bool opt_prof;
133 extern bool opt_prof_bb;
134 #endif
135
136 /* optimization options *******************************************************/
137
138 #if defined(ENABLE_IFCONV)
139 extern bool opt_ifconv;
140 #endif
141
142 #if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
143 extern bool opt_lsra;
144 #endif
145 #if defined(ENABLE_SSA)
146 extern bool opt_ssa_dce;          /* enable dead code elemination */
147 extern bool opt_ssa_cp;           /* enable copy propagation      */
148 #endif
149
150 /* interpreter options ********************************************************/
151
152 #if defined(ENABLE_INTRP)
153 extern bool opt_no_dynamic;
154 extern bool opt_no_replication;
155 extern bool opt_no_quicksuper;
156
157 extern s4   opt_static_supers;
158 extern bool vm_debug;
159 #endif
160
161 /* debug output filtering options *********************************************/
162
163 #if defined(ENABLE_DEBUG_FILTER)
164 extern const char *opt_filter_verbosecall_include;
165 extern const char *opt_filter_verbosecall_exclude;
166 extern const char *opt_filter_show_method;
167 #endif
168
169
170 /* -XX options ****************************************************************/
171
172 /* NOTE: For better readability keep these alpha-sorted. */
173
174 extern int   opt_DebugExceptions;
175 extern int   opt_DebugFinalizer;
176 extern int   opt_DebugLocalReferences;
177 extern int   opt_DebugLocks;
178 extern int   opt_DebugPatcher;
179 extern int   opt_DebugPackage;
180 extern int   opt_DebugProperties;
181 extern int   opt_DebugStackFrameInfo;
182 extern int   opt_DebugStackTrace;
183 extern int   opt_DebugThreads;
184 #if defined(ENABLE_DISASSEMBLER)
185 extern int   opt_DisassembleStubs;
186 #endif
187 #if defined(ENABLE_GC_CACAO)
188 extern int   opt_GCDebugRootSet;
189 extern int   opt_GCStress;
190 #endif
191 #if defined(ENABLE_INLINING)
192 extern int   opt_Inline;
193 #if defined(ENABLE_INLINING_DEBUG) || !defined(NDEBUG)
194 extern int   opt_InlineAll;
195 extern int   opt_InlineCount;
196 extern int   opt_InlineMaxSize;
197 extern int   opt_InlineMinSize;
198 #endif
199 #endif
200 extern int   opt_MaxPermSize;
201 extern int   opt_PermSize;
202 extern int   opt_PrintConfig;
203 extern int   opt_ProfileGCMemoryUsage;
204 extern int   opt_ProfileMemoryUsage;
205 extern FILE *opt_ProfileMemoryUsageGNUPlot;
206 #if defined(ENABLE_REPLACEMENT)
207 extern int   opt_TestReplacement;
208 #endif
209 extern int   opt_ThreadStackSize;
210 extern int   opt_TraceCompilerCalls;
211 extern int   opt_TraceExceptions;
212 #if defined(ENABLE_INLINING) && !defined(NDEBUG)
213 extern int   opt_TraceInlining;
214 #endif
215 extern int   opt_TraceJavaCalls;
216 extern int   opt_TraceJNICalls;
217 extern int   opt_TraceJVMCalls;
218 extern int   opt_TraceJVMCallsVerbose;
219 extern int   opt_TraceLinkClass;
220 #if defined(ENABLE_REPLACEMENT)
221 extern int   opt_TraceReplacement;
222 #endif
223 extern int   opt_TraceSubsystemInitialization;
224 extern int   opt_TraceTraps;
225
226
227 /* function prototypes ********************************************************/
228
229 s4   options_get(opt_struct *opts, JavaVMInitArgs *vm_args);
230 void options_xx(JavaVMInitArgs *vm_args);
231
232
233 /* debug **********************************************************************/
234
235 #if !defined(NDEBUG)
236 # define TRACESUBSYSTEMINITIALIZATION(text)                                             \
237     do {                                                                                                                \
238         if (opt_TraceSubsystemInitialization) {                                 \
239             log_println("[Initializing subsystem: %s]", text);  \
240         }                                                                                                               \
241     } while (0)
242 #else
243 # define TRACESUBSYSTEMINITIALIZATION(text)
244 #endif
245
246 #endif /* _OPTIONS_H */
247
248
249 /*
250  * These are local overrides for various environment variables in Emacs.
251  * Please do not remove this and leave it at the end of the file, where
252  * Emacs will automagically detect them.
253  * ---------------------------------------------------------------------
254  * Local variables:
255  * mode: c
256  * indent-tabs-mode: t
257  * c-basic-offset: 4
258  * tab-width: 4
259  * End:
260  */