* src/vm/options.h, src/vm/options.c (getloadingtime): Renamed to
authoredwin <none@none>
Tue, 25 Apr 2006 12:25:43 +0000 (12:25 +0000)
committeredwin <none@none>
Tue, 25 Apr 2006 12:25:43 +0000 (12:25 +0000)
opt_getloadingtime. Only defined for ENABLE_STATISTICS.
(getcompilingtime): Renamed to opt_getcompilingtime.
Only defined for ENABLE_STATISTICS.

* src/vm/loader.c (getloadingtime, getcompilingtime): Renamed.
* src/vm/jit/jit.c: Likewise.
* src/vm/linker.c: Likewise.
* src/native/vm/VMClassLoader.c: Likewise.

* src/vm/vm.c (OPT_TIME): Only defined for ENABLE_STATISTICS.

* configure.ac (--enable-statistics): Now statistics are disabled by
default.

configure.ac
src/native/vm/VMClassLoader.c
src/vm/jit/jit.c
src/vm/linker.c
src/vm/loader.c
src/vm/options.c
src/vm/options.h
src/vm/vm.c

index e985c46911a387e6be545a3ceda40242a0773790..53dde69b4ce34d5bd50ec878f24ac2d45cf200af 100644 (file)
@@ -359,12 +359,12 @@ fi
 dnl check for statistics
 AC_MSG_CHECKING(whether statistics generation should be enabled)
 AC_ARG_ENABLE([statistics],
-              [AS_HELP_STRING(--disable-statistics,disable statistics generation [[default=yes]])],
+              [AS_HELP_STRING(--enable-statistics,enable statistics generation [[default=no]])],
               [case "${enableval}" in
-                   no) ENABLE_STATISTICS=no;;
-                   *) ENABLE_STATISTICS=yes;;
+                   yes) ENABLE_STATISTICS=yes;;
+                   *) ENABLE_STATISTICS=no;;
                esac],
-              [ENABLE_STATISTICS=yes])
+              [ENABLE_STATISTICS=no])
 AC_MSG_RESULT(${ENABLE_STATISTICS})
 AM_CONDITIONAL([ENABLE_STATISTICS], test x"${ENABLE_STATISTICS}" = "xyes")
 
index 8cd204b3bfd953f392f56467dcb06d50c029cfd2..311812165b4c4a0a8129fa6a7e3f1a05136dff2c 100644 (file)
@@ -30,7 +30,7 @@
             Christian Thalinger
             Edwin Steiner
 
-   $Id: VMClassLoader.c 4692 2006-03-28 10:21:40Z twisti $
+   $Id: VMClassLoader.c 4834 2006-04-25 12:25:43Z edwin $
 
 */
 
@@ -117,7 +117,7 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_defineClass(JNIE
 #if defined(ENABLE_STATISTICS)
        /* measure time */
 
-       if (getloadingtime)
+       if (opt_getloadingtime)
                loadingtime_start();
 #endif
 
@@ -144,7 +144,7 @@ JNIEXPORT java_lang_Class* JNICALL Java_java_lang_VMClassLoader_defineClass(JNIE
 #if defined(ENABLE_STATISTICS)
        /* measure time */
 
-       if (getloadingtime)
+       if (opt_getloadingtime)
                loadingtime_stop();
 #endif
 
index 2ffb102694173f4a172378b3391ec287346c79a3..a2428759fdfc7e037137b576e0114ebee69cc676 100644 (file)
@@ -31,7 +31,7 @@
             Christian Thalinger
             Christian Ullrich
 
-   $Id: jit.c 4805 2006-04-21 10:54:24Z twisti $
+   $Id: jit.c 4834 2006-04-25 12:25:43Z edwin $
 
 */
 
@@ -1375,7 +1375,7 @@ u1 *jit_compile(methodinfo *m)
 #if defined(ENABLE_STATISTICS)
        /* measure time */
 
-       if (getcompilingtime)
+       if (opt_getcompilingtime)
                compilingtime_start();
 #endif
 
@@ -1435,7 +1435,7 @@ u1 *jit_compile(methodinfo *m)
 #if defined(ENABLE_STATISTICS)
        /* measure time */
 
-       if (getcompilingtime)
+       if (opt_getcompilingtime)
                compilingtime_stop();
 #endif
 
index 9c09210c9ed85c9ce8458f007924e2c33c708586..041d627bcb3f84a2f5b9d14fd5e1626d866864e3 100644 (file)
@@ -32,7 +32,7 @@
             Edwin Steiner
             Christian Thalinger
 
-   $Id: linker.c 4829 2006-04-24 17:16:45Z edwin $
+   $Id: linker.c 4834 2006-04-25 12:25:43Z edwin $
 
 */
 
@@ -388,10 +388,10 @@ classinfo *link_class(classinfo *c)
 #if defined(ENABLE_STATISTICS)
        /* measure time */
 
-       if (getcompilingtime)
+       if (opt_getcompilingtime)
                compilingtime_stop();
 
-       if (getloadingtime)
+       if (opt_getloadingtime)
                loadingtime_start();
 #endif
 
@@ -407,10 +407,10 @@ classinfo *link_class(classinfo *c)
 #if defined(ENABLE_STATISTICS)
        /* measure time */
 
-       if (getloadingtime)
+       if (opt_getloadingtime)
                loadingtime_stop();
 
-       if (getcompilingtime)
+       if (opt_getcompilingtime)
                compilingtime_start();
 #endif
 
index 343ec264d76a8843f8b8b74c31ef0df9f6760f96..f5e557987c2210d36237fa7312e229209af5b294 100644 (file)
@@ -32,7 +32,7 @@
             Edwin Steiner
             Christian Thalinger
 
-   $Id: loader.c 4829 2006-04-24 17:16:45Z edwin $
+   $Id: loader.c 4834 2006-04-25 12:25:43Z edwin $
 
 */
 
@@ -1696,10 +1696,10 @@ classinfo *load_class_bootstrap(utf *name)
 #if defined(ENABLE_STATISTICS)
        /* measure time */
 
-       if (getcompilingtime)
+       if (opt_getcompilingtime)
                compilingtime_stop();
 
-       if (getloadingtime)
+       if (opt_getloadingtime)
                loadingtime_start();
 #endif
 
@@ -1762,10 +1762,10 @@ classinfo *load_class_bootstrap(utf *name)
 #if defined(ENABLE_STATISTICS)
        /* measure time */
 
-       if (getloadingtime)
+       if (opt_getloadingtime)
                loadingtime_stop();
 
-       if (getcompilingtime)
+       if (opt_getcompilingtime)
                compilingtime_start();
 #endif
 
index 273b736e95d1368a2b5e03c957cad7b61990c6a3..c0bc33dcbd4d0feb1d8a0f5c78f78d0793926418 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: options.c 4833 2006-04-25 12:00:58Z edwin $
+   $Id: options.c 4834 2006-04-25 12:25:43Z edwin $
 
 */
 
@@ -107,10 +107,11 @@ bool opt_loops = false;        /* optimize array accesses in loops           */
 
 bool makeinitializations = true;
 
-bool getloadingtime = false;   /* to measure the runtime                     */
-bool getcompilingtime = false; /* compute compile time                       */
-
+#if defined(ENABLE_STATISTICS)
 bool opt_stat    = false;
+bool opt_getloadingtime = false;   /* to measure the runtime                 */
+bool opt_getcompilingtime = false; /* compute compile time                   */
+#endif
 #if defined(ENABLE_VERIFIER)
 bool opt_verify  = true;       /* true if classfiles should be verified      */
 #endif
index f9782403cf3eb8ea52a4b1cc2e61598c2b8c1065..b9504d344376e57953d4a845919f64aa845dfeec 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: options.h 4833 2006-04-25 12:00:58Z edwin $
+   $Id: options.h 4834 2006-04-25 12:25:43Z edwin $
 
 */
 
@@ -118,10 +118,11 @@ extern bool opt_loops;
 
 extern bool makeinitializations;
 
-extern bool getloadingtime;
-extern bool getcompilingtime;
-
+#if defined(ENABLE_STATISTICS)
 extern bool opt_stat;
+extern bool opt_getloadingtime;
+extern bool opt_getcompilingtime;
+#endif
 #if defined(ENABLE_VERIFIER)
 extern bool opt_verify;
 #endif
index 34c0ffac26091b670451bda79063071459c6eb01..771f2076c3f4a8c41b52e722f9f9459309b02034 100644 (file)
@@ -151,9 +151,9 @@ enum {
        OPT_VERBOSE1,
        OPT_NOIEEE,
        OPT_SOFTNULL,
-       OPT_TIME,
 
 #if defined(ENABLE_STATISTICS)
+       OPT_TIME,
        OPT_STAT,
 #endif
 
@@ -248,8 +248,8 @@ opt_struct opts[] = {
        { "noieee",            false, OPT_NOIEEE },
 #endif
        { "softnull",          false, OPT_SOFTNULL },
-       { "time",              false, OPT_TIME },
 #if defined(ENABLE_STATISTICS)
+       { "time",              false, OPT_TIME },
        { "stat",              false, OPT_STAT },
 #endif
        { "log",               true,  OPT_LOG },
@@ -365,8 +365,8 @@ void usage(void)
        puts("    -noverify                don't verify classfiles");
 #endif
        puts("    -softnull                use software nullpointer check");
-       puts("    -time                    measure the runtime");
 #if defined(ENABLE_STATISTICS)
+       puts("    -time                    measure the runtime");
        puts("    -stat                    detailed compiler statistics");
 #endif
        puts("    -log logfile             specify a name for the logfile");
@@ -804,12 +804,12 @@ bool vm_create(JavaVMInitArgs *vm_args)
                        checknull = true;
                        break;
 
+#if defined(ENABLE_STATISTICS)
                case OPT_TIME:
-                       getcompilingtime = true;
-                       getloadingtime = true;
+                       opt_getcompilingtime = true;
+                       opt_getloadingtime = true;
                        break;
                                        
-#if defined(ENABLE_STATISTICS)
                case OPT_STAT:
                        opt_stat = true;
                        break;
@@ -1310,7 +1310,12 @@ void vm_shutdown(s4 status)
                ipcrm();
        }
 #endif
-       if (opt_verbose || getcompilingtime || opt_stat) {
+       if (opt_verbose 
+#if defined(ENABLE_STATISTICS)
+               || opt_getcompilingtime || opt_stat
+#endif
+          ) 
+       {
                log_text("CACAO terminated by shutdown");
                dolog("Exit status: %d\n", (s4) status);
        }
@@ -1351,7 +1356,7 @@ void vm_exit_handler(void)
        if (opt_prof)
                profile_printstats();
 # endif
-#endif
+#endif /* !defined(NDEBUG) */
 
 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)
        clear_thread_flags();           /* restores standard file descriptor
@@ -1367,7 +1372,12 @@ void vm_exit_handler(void)
        stacktrace_print_cycles_stats(stderr);
 #endif
 
-       if (opt_verbose || getcompilingtime || opt_stat) {
+       if (opt_verbose 
+#if defined(ENABLE_STATISTICS)
+               || opt_getcompilingtime || opt_stat
+#endif
+          ) 
+       {
                log_text("CACAO terminated");
 
 #if defined(ENABLE_STATISTICS)
@@ -1380,9 +1390,9 @@ void vm_exit_handler(void)
 
                mem_usagelog(1);
 
-               if (getcompilingtime)
+               if (opt_getcompilingtime)
                        print_times();
-#endif
+#endif /* defined(ENABLE_STATISTICS) */
        }
        /* vm_print_profile(stderr);*/
 }