* src/vm/options.c: Moved -m, -sig and -all flags to -XX options.
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Thu, 12 Mar 2009 09:11:25 +0000 (10:11 +0100)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Thu, 12 Mar 2009 09:11:25 +0000 (10:11 +0100)
* src/vm/options.h: Likewise.
* src/vm/vm.cpp: Removed obsolete flags and adapted to above changes.

src/vm/options.c
src/vm/options.h
src/vm/vm.cpp

index 3c8ff46a57d4d6c684c6a07cc82899cc456095c5..7ead267c6ef226f565a64d5ebd62b6508efdf35f 100644 (file)
@@ -62,7 +62,6 @@ s4   opt_stacksize     = 0;     /* thread stack size                          */
 
 bool opt_verbose = false;
 bool opt_debugcolor = false;   /* use ANSI terminal sequences                */
-bool compileall = false;
 
 bool loadverbose = false;
 bool initverbose = false;
@@ -76,9 +75,6 @@ bool showmethods = false;
 bool showconstantpool = false;
 bool showutf = false;
 
-char *opt_method = NULL;
-char *opt_signature = NULL;
-
 bool compileverbose =  false;           /* trace compiler actions             */
 bool showstack = false;
 
@@ -161,6 +157,9 @@ int      opt_ThreadStackSize              = 0;
 /* Debugging options which can be turned off. */
 
 bool     opt_AlwaysEmitLongBranches       = false;
+int      opt_CompileAll                   = 0;
+char*    opt_CompileMethod                = NULL;
+char*    opt_CompileSignature             = NULL;
 int      opt_DebugExceptions              = 0;
 int      opt_DebugFinalizer               = 0;
 int      opt_DebugLocalReferences         = 0;
@@ -232,6 +231,9 @@ enum {
        /* Debugging options which can be turned off. */
 
        OPT_AlwaysEmitLongBranches,
+       OPT_CompileAll,
+       OPT_CompileMethod,
+       OPT_CompileSignature,
        OPT_DebugExceptions,
        OPT_DebugFinalizer,
        OPT_DebugLocalReferences,
@@ -286,6 +288,9 @@ option_t options_XX[] = {
        /* Debugging options which can be turned off. */
 
        { "AlwaysEmitLongBranches",       OPT_AlwaysEmitLongBranches,       OPT_TYPE_BOOLEAN, "Always emit long-branches." },
+       { "CompileAll",                   OPT_CompileAll,                   OPT_TYPE_BOOLEAN, "compile all methods, no execution" },
+       { "CompileMethod",                OPT_CompileMethod,                OPT_TYPE_VALUE,   "compile only a specific method" },
+       { "CompileSignature",             OPT_CompileSignature,             OPT_TYPE_VALUE,   "specify signature for a specific method" },
        { "DebugExceptions",              OPT_DebugExceptions,              OPT_TYPE_BOOLEAN, "debug exceptions" },
        { "DebugFinalizer",               OPT_DebugFinalizer,               OPT_TYPE_BOOLEAN, "debug finalizer thread" },
        { "DebugLocalReferences",         OPT_DebugLocalReferences,         OPT_TYPE_BOOLEAN, "print debug information for local reference tables" },
@@ -622,6 +627,22 @@ void options_xx(JavaVMInitArgs *vm_args)
                        opt_AlwaysEmitLongBranches = enable;
                        break;
 
+               case OPT_CompileAll:
+                       opt_CompileAll = enable;
+                       opt_run = false;
+                       makeinitializations = false;
+                       break;
+
+               case OPT_CompileMethod:
+                       opt_CompileMethod = value;
+                       opt_run = false;
+                       makeinitializations = false;
+                       break;
+
+               case OPT_CompileSignature:
+                       opt_CompileSignature = value;
+                       break;
+
                case OPT_DebugExceptions:
                        opt_DebugExceptions = enable;
                        break;
index 1758add5c3a757ba8858a35ad51f1177f1d29667..18c1c0013ebe8e04af82c0b06544a5f953b11d5c 100644 (file)
@@ -88,7 +88,6 @@ extern s4   opt_stacksize;
 
 extern bool opt_verbose;
 extern bool opt_debugcolor;
-extern bool compileall;
 
 extern bool loadverbose;         /* Print debug messages during loading */
 extern bool initverbose;         /* Log class initialization */ 
@@ -102,9 +101,6 @@ extern bool showmethods;
 extern bool showconstantpool;
 extern bool showutf;
 
-extern char *opt_method;
-extern char *opt_signature;
-
 extern bool compileverbose;
 extern bool showstack;
 
@@ -183,6 +179,9 @@ extern int      opt_ThreadStackSize;
 /* Debugging options which can be turned off. */
 
 extern bool     opt_AlwaysEmitLongBranches;
+extern int      opt_CompileAll;
+extern char*    opt_CompileMethod;
+extern char*    opt_CompileSignature;
 extern int      opt_DebugExceptions;
 extern int      opt_DebugFinalizer;
 extern int      opt_DebugLocalReferences;
index c4ab5f40cf756795a98fad0d1ed4d8c5b372cdc7..8cbc0ed5cfb59e63e9f2c6fe8b7bffaa8a76e8d7 100644 (file)
@@ -206,12 +206,6 @@ enum {
        OPT_SHOW,
        OPT_DEBUGCOLOR,
 
-#if !defined(NDEBUG)
-       OPT_ALL,
-       OPT_METHOD,
-       OPT_SIGNATURE,
-#endif
-
 #if defined(ENABLE_VERIFIER)
        OPT_NOVERIFY,
        OPT_XVERIFY_ALL,
@@ -325,11 +319,6 @@ opt_struct opts[] = {
        { "c",                 true,  OPT_CHECK },
        { "l",                 false, OPT_LOAD },
 
-#if !defined(NDEBUG)
-       { "all",               false, OPT_ALL },
-       { "sig",               true,  OPT_SIGNATURE },
-#endif
-
 #if defined(ENABLE_LOOP)
        { "oloop",             false, OPT_OLOOP },
 #endif
@@ -390,10 +379,6 @@ opt_struct opts[] = {
 
        /* keep these at the end of the list */
 
-#if !defined(NDEBUG)
-       { "m",                 true,  OPT_METHOD },
-#endif
-
        { "s",                 true,  OPT_SHOW },
        { "debug-color",      false,  OPT_DEBUGCOLOR },
 
@@ -525,11 +510,6 @@ static void XXusage(void)
        puts("    -oloop                   optimize array accesses in loops");
 #endif
        puts("    -l                       don't start the class after loading");
-#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...                    show...");
        puts("      (c)onstants            the constant pool");
@@ -1084,24 +1064,6 @@ VM::VM(JavaVMInitArgs* vm_args)
                        makeinitializations = false;
                        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;
-#endif
-
                case OPT_SHOW:       /* Display options */
                        for (unsigned int i = 0; i < strlen(opt_arg); i++) {            
                                switch (opt_arg[i]) {
@@ -1632,7 +1594,7 @@ void vm_run(JavaVM *vm, JavaVMInitArgs *vm_args)
        oa = NULL;
 
 #if !defined(NDEBUG)
-       if (compileall) {
+       if (opt_CompileAll) {
                vm_compile_all();
                return;
        }
@@ -1691,7 +1653,7 @@ void vm_run(JavaVM *vm, JavaVMInitArgs *vm_args)
                usage();
 
 #if !defined(NDEBUG)
-       if (opt_method != NULL) {
+       if (opt_CompileMethod != NULL) {
                vm_compile_method(mainname);
                return;
        }
@@ -2265,16 +2227,16 @@ static void vm_compile_method(char* mainname)
        if (!link_class(mainclass))
                exceptions_print_stacktrace();
 
-       if (opt_signature != NULL) {
+       if (opt_CompileSignature != NULL) {
                m = class_resolveclassmethod(mainclass,
-                                                                        utf_new_char(opt_method),
-                                                                        utf_new_char(opt_signature),
+                                                                        utf_new_char(opt_CompileMethod),
+                                                                        utf_new_char(opt_CompileSignature),
                                                                         mainclass,
                                                                         false);
        }
        else {
                m = class_resolveclassmethod(mainclass,
-                                                                        utf_new_char(opt_method),
+                                                                        utf_new_char(opt_CompileMethod),
                                                                         NULL,
                                                                         mainclass,
                                                                         false);
@@ -2282,7 +2244,7 @@ static void vm_compile_method(char* mainname)
 
        if (m == NULL)
                os::abort("vm_compile_method: java.lang.NoSuchMethodException: %s.%s",
-                                opt_method, opt_signature ? opt_signature : "");
+                                opt_CompileMethod, opt_CompileSignature ? opt_CompileSignature : "");
                
        jit_compile(m);
 }