* STATISTICS: Renamed to ENABLE_STATISTICS.
authortwisti <none@none>
Thu, 22 Dec 2005 14:04:47 +0000 (14:04 +0000)
committertwisti <none@none>
Thu, 22 Dec 2005 14:04:47 +0000 (14:04 +0000)
* NDEBUG: Added.

src/vm/class.c
src/vm/initialize.c
src/vm/loader.c

index 215d60d0761988257b9534cc71c3ed1bd8cdf66d..b4282b7d0d48a90e5942b4bede3f9c1be300346a 100644 (file)
             Andreas Krall
             Christian Thalinger
 
-   $Id: class.c 3940 2005-12-11 01:06:16Z twisti $
+   $Id: class.c 3999 2005-12-22 14:04:47Z twisti $
 
 */
 
+
+#include "config.h"
+
 #include <assert.h>
 #include <string.h>
 
-#include "config.h"
 #include "vm/types.h"
 
 #include "mm/memory.h"
@@ -202,7 +204,7 @@ classinfo *class_create_classinfo(utf *classname)
 {
        classinfo *c;
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
        if (opt_stat)
                count_class_infos += sizeof(classinfo);
 #endif
@@ -211,8 +213,10 @@ classinfo *class_create_classinfo(utf *classname)
        if (!classname)
                classname = utf_not_named_yet;
 
+#if !defined(NDEBUG)
        if (initverbose)
                log_message_utf("Creating class: ", classname);
+#endif
 
        /* GCNEW_UNCOLLECTABLE clears the allocated memory */
 
index 90c5b5a4c0133cf2095e008001aa50f783863d01..06f52a1c03384ec5260c42e79e3fb9807f758897 100644 (file)
             Andreas Krall
             Christian Thalinger
 
-   $Id: initialize.c 3888 2005-12-05 22:08:45Z twisti $
+   $Id: initialize.c 3999 2005-12-22 14:04:47Z twisti $
 
 */
 
 
+#include "config.h"
+
 #include <string.h>
 
-#include "config.h"
 #include "vm/types.h"
 
 #include "vm/global.h"
@@ -153,7 +154,7 @@ static bool initialize_class_intern(classinfo *c)
                if (!link_class(c))
                        return false;
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
        if (opt_stat)
                count_class_inits++;
 #endif
@@ -162,11 +163,13 @@ static bool initialize_class_intern(classinfo *c)
 
        if (c->super.cls) {
                if (!(c->super.cls->state & CLASS_INITIALIZED)) {
+#if !defined(NDEBUG)
                        if (initverbose)
                                log_message_class_message_class("Initialize super class ",
                                                                                                c->super.cls,
                                                                                                " from ",
                                                                                                c);
+#endif
 
                        if (!initialize_class(c->super.cls))
                                return false;
@@ -178,8 +181,10 @@ static bool initialize_class_intern(classinfo *c)
        m = class_findmethod(c, utf_clinit, utf_void__void);
 
        if (!m) {
+#if !defined(NDEBUG)
                if (initverbose)
                        log_message_class("Class has no static class initializer: ", c);
+#endif
 
                return true;
        }
@@ -188,8 +193,10 @@ static bool initialize_class_intern(classinfo *c)
 /*     if (!(m->flags & ACC_STATIC)) { */
 /*             log_text("Class initializer is not static!"); */
 
+#if !defined(NDEBUG)
        if (initverbose)
                log_message_class("Starting static class initializer for class: ", c);
+#endif
 
 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)
        b = blockInts;
@@ -231,8 +238,10 @@ static bool initialize_class_intern(classinfo *c)
                return false;
        }
 
+#if !defined(NDEBUG)
        if (initverbose)
                log_message_class("Finished static class initializer for class: ", c);
+#endif
 
        return true;
 }
index f0e9195cdf3426f5defcbc295b5e252207548c04..696e3055fa59a3c364a71d02dbb666eb7b7ab139 100644 (file)
             Edwin Steiner
             Christian Thalinger
 
-   $Id: loader.c 3961 2005-12-20 23:26:55Z twisti $
+   $Id: loader.c 3999 2005-12-22 14:04:47Z twisti $
 
 */
 
+
+#include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
 
-#include "config.h"
 #include "vm/types.h"
+
 #include "mm/memory.h"
 #include "native/native.h"
 #include "native/include/java_lang_Throwable.h"
@@ -439,7 +442,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
                return false;
        }
        
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
        if (opt_stat)
                count_const_pool_len += (sizeof(voidptr) + 1) * cpcount;
 #endif
@@ -548,7 +551,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
                case CONSTANT_Integer: {
                        constant_integer *ci = NEW(constant_integer);
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
                        if (opt_stat)
                                count_const_pool_len += sizeof(constant_integer);
 #endif
@@ -567,7 +570,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
                case CONSTANT_Float: {
                        constant_float *cf = NEW(constant_float);
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
                        if (opt_stat)
                                count_const_pool_len += sizeof(constant_float);
 #endif
@@ -586,7 +589,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
                case CONSTANT_Long: {
                        constant_long *cl = NEW(constant_long);
                                        
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
                        if (opt_stat)
                                count_const_pool_len += sizeof(constant_long);
 #endif
@@ -609,7 +612,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
                case CONSTANT_Double: {
                        constant_double *cd = NEW(constant_double);
                                
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
                        if (opt_stat)
                                count_const_pool_len += sizeof(constant_double);
 #endif
@@ -726,7 +729,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
        while (forward_nameandtypes) {
                constant_nameandtype *cn = NEW(constant_nameandtype);   
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
                if (opt_stat)
                        count_const_pool_len += sizeof(constant_nameandtype);
 #endif
@@ -776,7 +779,7 @@ static bool load_constantpool(classbuffer *cb, descriptor_pool *descpool)
                constant_nameandtype *nat;
                constant_FMIref *fmi = NEW(constant_FMIref);
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
                if (opt_stat)
                        count_const_pool_len += sizeof(constant_FMIref);
 #endif
@@ -1037,7 +1040,7 @@ static bool load_method(classbuffer *cb, methodinfo *m, descriptor_pool *descpoo
        initObjectLock(&m->header);
 #endif
 
-#ifdef STATISTICS
+#if defined(ENABLE_STATISTICS)
        if (opt_stat)
                count_all_methods++;
 #endif
@@ -1235,7 +1238,7 @@ static bool load_method(classbuffer *cb, methodinfo *m, descriptor_pool *descpoo
 
                        m->exceptiontable = MNEW(exceptiontable, m->exceptiontablelength);
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
                        if (opt_stat) {
                                count_vmcode_len += m->jcodelength + 18;
                                count_extable_len +=
@@ -1695,7 +1698,7 @@ classinfo *load_class_bootstrap(utf *name)
                return c;
        }
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
        /* measure time */
 
        if (getcompilingtime)
@@ -1755,7 +1758,7 @@ classinfo *load_class_bootstrap(utf *name)
 
        suck_stop(cb);
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
        /* measure time */
 
        if (getloadingtime)
@@ -1794,7 +1797,7 @@ classinfo *load_class_from_classbuffer(classbuffer *cb)
        u4 ma, mi;
        s4 dumpsize;
        descriptor_pool *descpool;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
        u4 classrefsize;
        u4 descsize;
 #endif
@@ -1808,15 +1811,17 @@ classinfo *load_class_from_classbuffer(classbuffer *cb)
        if (c->state & CLASS_LOADED)
                return c;
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
        if (opt_stat)
                count_class_loads++;
 #endif
 
+#if !defined(NDEBUG)
        /* output for debugging purposes */
 
        if (loadverbose)
                log_message_class("Loading class: ", c);
+#endif
        
        /* mark start of dump memory area */
 
@@ -2028,7 +2033,7 @@ classinfo *load_class_from_classbuffer(classbuffer *cb)
        c->parseddescs =
                descriptor_pool_get_parsed_descriptors(descpool, &(c->parseddescsize));
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
        if (opt_stat) {
                descriptor_pool_get_sizes(descpool, &classrefsize, &descsize);
                count_classref_len += classrefsize;
@@ -2238,10 +2243,10 @@ classinfo *load_class_from_classbuffer(classbuffer *cb)
        }
 #endif /* ENABLE_VERIFIER */
 
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
        if (opt_stat) {
                count_class_infos += sizeof(classinfo*) * c->interfacescount;
-               count_class_infos += sizeof(fieldinfo) * c->fieldscount;
+               count_class_infos += sizeof(fieldinfo)  * c->fieldscount;
                count_class_infos += sizeof(methodinfo) * c->methodscount;
        }
 #endif
@@ -2279,8 +2284,10 @@ classinfo *load_class_from_classbuffer(classbuffer *cb)
 
        c->state = (c->state & ~CLASS_LOADING) | CLASS_LOADED;
 
+#if !defined(NDEBUG)
        if (loadverbose)
                log_message_class("Loading done class: ", c);
+#endif
 
        return c;