1 /* src/vm/options.c - contains global options
3 Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Christian Thalinger
31 $Id: options.c 3976 2005-12-21 16:17:37Z anton $
41 #include "vm/options.h"
44 /* command line option ********************************************************/
46 s4 opt_ind = 1; /* index of processed arguments */
47 char *opt_arg; /* this one exports the option argument */
49 #if defined(ENABLE_JIT)
50 bool opt_jit = true; /* JIT mode execution (default) */
51 bool opt_intrp = false; /* interpreter mode execution */
53 bool opt_jit = false; /* JIT mode execution */
54 bool opt_intrp = true; /* interpreter mode execution (default) */
57 s4 opt_stacksize = 0; /* thread stack size */
59 bool opt_verbose = false;
60 bool compileall = false;
61 bool runverbose = false; /* trace all method invocation */
62 bool opt_verboseexception = false;
64 bool loadverbose = false;
65 bool linkverbose = false;
66 bool initverbose = false;
68 bool opt_verboseclass = false;
69 bool opt_verbosegc = false;
70 bool opt_verbosejni = false;
72 bool opt_rt = false; /* true if RTA parse should be used RT-CO */
73 bool opt_xta = false; /* true if XTA parse should be used XTA-CO */
74 bool opt_vta = false; /* true if VTA parse should be used VTA-CO */
76 bool opt_liberalutf = false; /* Don't check overlong UTF-8 sequences */
78 bool showmethods = false;
79 bool showconstantpool = false;
82 bool compileverbose = false; /* trace compiler actions */
83 bool showstack = false;
84 bool opt_showdisassemble = false; /* generate disassembler listing */
85 bool opt_showddatasegment = false; /* generate data segment listing */
86 bool opt_showintermediate = false; /* generate intermediate code listing */
87 bool opt_showexceptionstubs = false;
88 bool opt_shownativestub = false;
90 bool useinliningm = false; /* use method inlining */
91 bool useinlining = false; /* use method inlining */
92 bool inlinevirtuals = false; /* inline unique virtual methods */
93 bool inlineexceptions = false; /* inline methods, that contain excptions */
94 bool inlineparamopt = false; /* optimize parameter passing to inlined methods */
95 bool inlineoutsiders = false; /* inline methods, that are not member of the invoker's class */
97 bool checkbounds = true; /* check array bounds */
98 bool checknull = true; /* check null pointers */
99 bool opt_noieee = false; /* don't implement ieee compliant floats */
100 bool checksync = true; /* do synchronization */
101 bool opt_loops = false; /* optimize array accesses in loops */
103 bool makeinitializations = true;
105 bool getloadingtime = false; /* to measure the runtime */
106 bool getcompilingtime = false; /* compute compile time */
108 int has_ext_instr_set = 0; /* has instruction set extensions */
110 bool opt_stat = false;
111 bool opt_verify = true; /* true if classfiles should be verified */
112 bool opt_eager = false;
114 #if defined(ENABLE_LSRA)
115 bool opt_lsra = false;
119 /* interpreter options ********************************************************/
121 #if defined(ENABLE_INTRP)
122 bool opt_no_dynamic = false; /* suppress dynamic superinstructions */
123 bool opt_no_replication = false; /* don't use replication in intrp */
124 bool opt_no_quicksuper = false; /* instructions for quickening cannot be
125 part of dynamic superinstructions */
127 s4 opt_static_supers = 0x7fffffff;
128 bool vm_debug = false; /* XXX this should be called `opt_trace' */
132 /* get_opt *********************************************************************
136 *******************************************************************************/
138 int get_opt(int argc, char **argv, opt_struct *opts)
151 for (i = 0; opts[i].name; i++) {
153 /* boolean option found */
155 if (strcmp(a + 1, opts[i].name) == 0) {
157 return opts[i].value;
161 /* parameter option found */
163 /* with a space between */
165 if (strcmp(a + 1, opts[i].name) == 0) {
168 if (opt_ind < argc) {
169 opt_arg = argv[opt_ind];
171 return opts[i].value;
177 /* parameter and option have no space between */
179 size_t l = strlen(opts[i].name);
180 if (strlen(a + 1) > l) {
181 if (memcmp(a + 1, opts[i].name, l) == 0) {
184 return opts[i].value;
196 * These are local overrides for various environment variables in Emacs.
197 * Please do not remove this and leave it at the end of the file, where
198 * Emacs will automagically detect them.
199 * ---------------------------------------------------------------------
202 * indent-tabs-mode: t