# include "threads/native/threads.h"
#endif
-#include "toolbox/util.h"
#include "vm/classcache.h"
#include "vm/exceptions.h"
#include "vm/finalizer.h"
/* define command line options ************************************************/
enum {
+ OPT_FOO,
+
/* Java options */
OPT_JAR,
OPT_LOG,
OPT_CHECK,
OPT_LOAD,
- OPT_METHOD,
- OPT_SIGNATURE,
OPT_SHOW,
+ OPT_DEBUGCOLOR,
+
+#if !defined(NDEBUG)
OPT_ALL,
+ OPT_METHOD,
+ OPT_SIGNATURE,
+#endif
#if defined(ENABLE_VERIFIER)
OPT_NOVERIFY,
OPT_IFCONV,
#endif
-#if defined(ENABLE_LSRA)
+#if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
OPT_LSRA,
#endif
opt_struct opts[] = {
+ { "foo", false, OPT_FOO },
+
/* Java options */
{ "jar", false, OPT_JAR },
{ "c", true, OPT_CHECK },
{ "l", false, OPT_LOAD },
{ "eager", false, OPT_EAGER },
- { "sig", true, OPT_SIGNATURE },
+
+#if !defined(NDEBUG)
{ "all", false, OPT_ALL },
+ { "sig", true, OPT_SIGNATURE },
+#endif
+
#if defined(ENABLE_LOOP)
{ "oloop", false, OPT_OLOOP },
#endif
#if defined(ENABLE_IFCONV)
{ "ifconv", false, OPT_IFCONV },
#endif
-#if defined(ENABLE_LSRA)
+#if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
{ "lsra", false, OPT_LSRA },
#endif
#if defined(ENABLE_INLINING)
{ "i", true, OPT_INLINING },
#endif
+
+#if !defined(NDEBUG)
{ "m", true, OPT_METHOD },
+#endif
+
{ "s", true, OPT_SHOW },
+ { "debug-color", false, OPT_DEBUGCOLOR },
{ NULL, false, 0 }
};
puts(" -v write state-information");
puts(" -verbose[:call|exception|jit]");
puts(" enable specific verbose output");
+ puts(" -debug-color colored output for ANSI terms");
#ifdef TYPECHECK_VERBOSE
puts(" -verbosetc write debug messages while typechecking");
#endif
#endif
puts(" -l don't start the class after loading");
puts(" -eager perform eager class loading and linking");
+#if !defined(NDEBUG)
puts(" -all compile all methods, no execution");
puts(" -m compile only a specific method");
puts(" -sig specify signature for a specific method");
+#endif
+
puts(" -s(how)... show...");
puts(" c(onstants) the constant pool");
puts(" m(ethods) class fields and methods");
#if defined(ENABLE_LSRA)
puts(" -lsra use linear scan register allocation");
#endif
+#if defined(ENABLE_SSA)
+ puts(" -lsra use linear scan register allocation (with SSA)");
+#endif
/* exit with error code */
/* set the VM starttime */
- _Jv_jvm->starttime = util_current_time_millis();
+ _Jv_jvm->starttime = builtin_currenttimemillis();
/* get stuff from the environment *****************************************/
while ((opt = options_get(opts, vm_args)) != OPT_DONE) {
switch (opt) {
+ case OPT_FOO:
+ opt_foo = true;
+ break;
+
case OPT_IGNORE:
break;
else if (strcmp("exception", opt_arg) == 0)
opt_verboseexception = true;
break;
+ case OPT_DEBUGCOLOR:
+ opt_debugcolor = true;
+ break;
#if defined(ENABLE_VERIFIER) && defined(TYPECHECK_VERBOSE)
case OPT_VERBOSETC:
opt_eager = true;
break;
+#if !defined(NDEBUG)
+ case OPT_ALL:
+ compileall = true;
+ opt_run = false;
+ makeinitializations = false;
+ break;
+
case OPT_METHOD:
opt_run = false;
opt_method = opt_arg;
makeinitializations = false;
break;
-
+
case OPT_SIGNATURE:
opt_signature = opt_arg;
break;
-
- case OPT_ALL:
- compileall = true;
- opt_run = false;
- makeinitializations = false;
- break;
-
+#endif
+
case OPT_SHOW: /* Display options */
for (j = 0; j < strlen(opt_arg); j++) {
switch (opt_arg[j]) {
break;
#endif
-#if defined(ENABLE_LSRA)
+#if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
case OPT_LSRA:
opt_lsra = true;
break;