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"
if (!link_class(c))
return false;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_class_inits++;
#endif
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;
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;
}
/* 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;
return false;
}
+#if !defined(NDEBUG)
if (initverbose)
log_message_class("Finished static class initializer for class: ", c);
+#endif
return true;
}
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"
return false;
}
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_const_pool_len += (sizeof(voidptr) + 1) * cpcount;
#endif
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
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
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
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
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
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
initObjectLock(&m->header);
#endif
-#ifdef STATISTICS
+#if defined(ENABLE_STATISTICS)
if (opt_stat)
count_all_methods++;
#endif
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 +=
return c;
}
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
/* measure time */
if (getcompilingtime)
suck_stop(cb);
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
/* measure time */
if (getloadingtime)
u4 ma, mi;
s4 dumpsize;
descriptor_pool *descpool;
-#if defined(STATISTICS)
+#if defined(ENABLE_STATISTICS)
u4 classrefsize;
u4 descsize;
#endif
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 */
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;
}
#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
c->state = (c->state & ~CLASS_LOADING) | CLASS_LOADED;
+#if !defined(NDEBUG)
if (loadverbose)
log_message_class("Loading done class: ", c);
+#endif
return c;