* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / src / vm / statistics.c
index 8ab2f6fd509fee91404cca97fe80ad1577e98f24..9c07ef78b47af9ea09433e58e58bb31a1d9a0b6e 100644 (file)
 
 #include "mm/gc.hpp"
 
-#include "toolbox/logging.h"
-
-#include "threads/thread.hpp"
+#include "toolbox/logging.hpp"
 
 #include "vm/class.hpp"
 #include "vm/field.hpp"
 #include "vm/global.h"
-#include "vm/method.h"
+#include "vm/method.hpp"
 #include "vm/options.h"
 #include "vm/statistics.h"
 
@@ -108,8 +106,6 @@ int32_t size_linenumbertable  = 0;
 
 s4 size_patchref         = 0;
 
-s4 size_cachedref           = 0;
-
 u8 count_calls_java_to_native = 0;
 u8 count_calls_native_to_java = 0;
 
@@ -306,25 +302,12 @@ s8 getcputime(void)
 
 *******************************************************************************/
 
-Mutex *loadingtime_lock = Mutex_new();
-
 void loadingtime_start(void)
 {
-       Mutex_lock(loadingtime_lock);
-
        loadingtime_recursion++;
 
        if (loadingtime_recursion == 1)
                loadingstarttime = getcputime();
-       else {
-               int end = getcputime();
-               loadingtime += (end - loadingstarttime);
-
-               loadingstarttime = loadingstoptime = end;
-       }
-       
-
-       Mutex_unlock(loadingtime_lock);
 }
 
 
@@ -336,18 +319,12 @@ void loadingtime_start(void)
 
 void loadingtime_stop(void)
 {
-       Mutex_lock(loadingtime_lock);
-
-       loadingstoptime = getcputime();
-       loadingtime += (loadingstoptime - loadingstarttime);
-
-       if (loadingtime_recursion > 1) {
-               loadingstarttime = loadingstoptime;
+       if (loadingtime_recursion == 1) {
+               loadingstoptime = getcputime();
+               loadingtime += (loadingstoptime - loadingstarttime);
        }
 
        loadingtime_recursion--;
-
-       Mutex_unlock(loadingtime_lock);
 }
 
 
@@ -715,14 +692,12 @@ void statistics_print_memory_usage(void)
        log_println("linenumber tables (%5d): %10d", count_linenumbertable, size_linenumbertable);
        log_println("exception tables:          %10d", count_extable_len);
        log_println("patcher references:        %10d", size_patchref);
-       log_println("cached references:         %10d", size_cachedref);
        log_println("                            ----------");
 
        sum =
                size_linenumbertable +
                count_extable_len +
-               size_patchref +
-               size_cachedref;
+               size_patchref;
 
        log_println("                           %10d", sum);