ca4e09666c6ab77c0eab2078ee93a508260f1a72
[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 /* Options which must always be available (production options in
175    HotSpot). */
176
177 extern int64_t  opt_MaxDirectMemorySize;
178 extern int      opt_MaxPermSize;
179 extern int      opt_PermSize;
180 extern int      opt_ThreadStackSize;
181
182 /* Debugging options which can be turned off. */
183
184 extern int      opt_DebugExceptions;
185 extern int      opt_DebugFinalizer;
186 extern int      opt_DebugLocalReferences;
187 extern int      opt_DebugLocks;
188 extern int      opt_DebugPatcher;
189 extern int      opt_DebugPackage;
190 extern int      opt_DebugProperties;
191 extern int      opt_DebugStackFrameInfo;
192 extern int      opt_DebugStackTrace;
193 extern int      opt_DebugThreads;
194 #if defined(ENABLE_DISASSEMBLER)
195 extern int      opt_DisassembleStubs;
196 #endif
197 #if defined(ENABLE_GC_CACAO)
198 extern int      opt_GCDebugRootSet;
199 extern int      opt_GCStress;
200 #endif
201 #if defined(ENABLE_INLINING)
202 extern int      opt_Inline;
203 #if defined(ENABLE_INLINING_DEBUG) || !defined(NDEBUG)
204 extern int      opt_InlineAll;
205 extern int      opt_InlineCount;
206 extern int      opt_InlineMaxSize;
207 extern int      opt_InlineMinSize;
208 #endif
209 #endif
210 extern int      opt_PrintConfig;
211 extern int      opt_ProfileGCMemoryUsage;
212 extern int      opt_ProfileMemoryUsage;
213 extern FILE    *opt_ProfileMemoryUsageGNUPlot;
214 #if defined(ENABLE_REPLACEMENT)
215 extern int      opt_TestReplacement;
216 #endif
217 extern int      opt_TraceCompilerCalls;
218 extern int      opt_TraceExceptions;
219 extern int      opt_TraceHPI;
220 #if defined(ENABLE_INLINING) && !defined(NDEBUG)
221 extern int      opt_TraceInlining;
222 #endif
223 extern int      opt_TraceJavaCalls;
224 extern int      opt_TraceJNICalls;
225 extern int      opt_TraceJVMCalls;
226 extern int      opt_TraceJVMCallsVerbose;
227 extern int      opt_TraceLinkClass;
228 #if defined(ENABLE_REPLACEMENT)
229 extern int      opt_TraceReplacement;
230 #endif
231 extern int      opt_TraceSubsystemInitialization;
232 extern int      opt_TraceTraps;
233
234
235 /* function prototypes ********************************************************/
236
237 int  options_get(opt_struct *opts, JavaVMInitArgs *vm_args);
238 void options_xx(JavaVMInitArgs *vm_args);
239
240
241 /* debug **********************************************************************/
242
243 #if !defined(NDEBUG)
244 # define TRACESUBSYSTEMINITIALIZATION(text)                                             \
245     do {                                                                                                                \
246         if (opt_TraceSubsystemInitialization) {                                 \
247             log_println("[Initializing subsystem: %s]", text);  \
248         }                                                                                                               \
249     } while (0)
250 #else
251 # define TRACESUBSYSTEMINITIALIZATION(text)
252 #endif
253
254 #endif /* _OPTIONS_H */
255
256
257 /*
258  * These are local overrides for various environment variables in Emacs.
259  * Please do not remove this and leave it at the end of the file, where
260  * Emacs will automagically detect them.
261  * ---------------------------------------------------------------------
262  * Local variables:
263  * mode: c
264  * indent-tabs-mode: t
265  * c-basic-offset: 4
266  * tab-width: 4
267  * End:
268  */