* src/vm/jit/stack.c (new_stack_analyse): Add a third move at the
[cacao.git] / src / vm / vm.c
index 39de283129b8bc4a704dc91a7e409a11c66bc1f9..3b98ce35386a81e5c41da48ff28b1dfc9034458f 100644 (file)
@@ -49,7 +49,6 @@
 # include "threads/native/threads.h"
 #endif
 
-#include "toolbox/util.h"
 #include "vm/classcache.h"
 #include "vm/exceptions.h"
 #include "vm/finalizer.h"
@@ -110,6 +109,8 @@ bool startit = true;
 /* define command line options ************************************************/
 
 enum {
+       OPT_FOO,
+
        /* Java options */
 
        OPT_JAR,
@@ -163,10 +164,14 @@ enum {
        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,
@@ -186,7 +191,7 @@ enum {
        OPT_IFCONV,
 #endif
 
-#if defined(ENABLE_LSRA)
+#if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
        OPT_LSRA,
 #endif
 
@@ -219,6 +224,8 @@ enum {
 
 
 opt_struct opts[] = {
+       { "foo",               false, OPT_FOO },
+
        /* Java options */
 
        { "jar",               false, OPT_JAR },
@@ -267,15 +274,19 @@ opt_struct opts[] = {
        { "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
 
@@ -324,8 +335,13 @@ opt_struct opts[] = {
 #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 }
 };
@@ -377,6 +393,7 @@ void usage(void)
        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
@@ -399,9 +416,12 @@ void usage(void)
 #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");
@@ -426,6 +446,9 @@ void usage(void)
 #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 */
 
@@ -581,7 +604,7 @@ bool vm_create(JavaVMInitArgs *vm_args)
 
        /* set the VM starttime */
 
-       _Jv_jvm->starttime = util_current_time_millis();
+       _Jv_jvm->starttime = builtin_currenttimemillis();
 
        /* get stuff from the environment *****************************************/
 
@@ -656,6 +679,10 @@ bool vm_create(JavaVMInitArgs *vm_args)
 
        while ((opt = options_get(opts, vm_args)) != OPT_DONE) {
                switch (opt) {
+               case OPT_FOO:
+                       opt_foo = true;
+                       break;
+
                case OPT_IGNORE:
                        break;
                        
@@ -848,6 +875,9 @@ bool vm_create(JavaVMInitArgs *vm_args)
                        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:
@@ -921,22 +951,24 @@ bool vm_create(JavaVMInitArgs *vm_args)
                        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]) {
@@ -1022,7 +1054,7 @@ bool vm_create(JavaVMInitArgs *vm_args)
                        break;
 #endif
 
-#if defined(ENABLE_LSRA)
+#if defined(ENABLE_LSRA) || defined(ENABLE_SSA)
                case OPT_LSRA:
                        opt_lsra = true;
                        break;