* src/vm/loader.c (loader_load_all_classes): Added NDEBUG.
* src/vm/builtin.c (builtin_new): Likewise.
* src/vm/jit/codegen-common.c (codegen_createnativestub): Likewise.
(codegen_disassemble_nativestub): Likewise.
* src/vm/jit/codegen-common.h (codegen_disassemble_nativestub):
Likewise.
* src/vm/jit/stack.c (stack_print): Likewise.
* src/vm/jit/stack.h (stack_print, show_icmd_method, show_icmd_block)
(show_icmd): Likewise.
* src/vm/exceptions.c (exceptions_handle_exception): Likewise.
* src/vm/linker.c (link_class_intern): Likewise.
* src/cacao/cacao.c (main): Likewise.
* src/vm/jit/x86_64/codegen.c: Likewise.
* src/vm/jit/x86_64/asmpart.S (asm_vm_call_method): Likewise.
* src/vm/jit/x86_64/Makefile.am (DISASS_SOURCES): Added. Put into
ENABLE_DISASSEMBLER.
* src/vm/jit/jit.c (jit_compile_intern): Added ENABLE_LOOP.
* src/vm/vm.c (vm_create): Added ENABLE_PROFILING.
(vm_exit_handler): Likewise.
* configure.ac (AC_ENABLE_SHARED, AC_DISABLE_STATIC): Removed. Set it
manually.
(EXPORT_SYMBOLS_FLAGS): Removed.
(--enable-disassembler): Added.
(--ensable-loop): Likewise.
(--ensable-profiling): Likewise.
(--ensable-libjvm): Likewise.
(--ensable-inlining): Moved.
* src/vm/jit/Makefile.am (LOOP_LIB): Added. Put into ENABLE_LOOP.
(PROFILE_LIB): Put into ENABLE_PROFILING.
* src/cacao/Makefile.am (cacao_LDFLAGS): Use -export-dynamic and let
libtool do the work. Add -all-static for ENABLE_STATICVM.
* src/lib/Makefile.am: Made it -j aware.
* src/vm/resolve.c (config.h, vm/global.h): Added.
* src/vm/classcache.c (config.h): Moved to top.
* src/vm/exceptions.h: Small change.
AC_PROG_MAKE_SET
AM_PROG_MKDIR_P
-AC_ENABLE_SHARED
-AC_DISABLE_STATIC
-
-dnl libtool stuff
-AC_LIBTOOL_DLOPEN
-AC_PROG_LIBTOOL
-
dnl Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_C_BIGENDIAN
-dnl check which ld flags are required to export symbols
-if test x"$with_gnu_ld" = "xyes"; then
- EXPORT_SYMBOLS_FLAGS="-Wl,--export-dynamic"
-else
- EXPORT_SYMBOLS_FLAGS=""
-fi
-AC_SUBST(EXPORT_SYMBOLS_FLAGS)
-
-
dnl define install prefix
if test "x$prefix" = "xNONE"; then
CACAO_PREFIX=$ac_default_prefix
if test x"${NDEBUG}" = "xno"; then
AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
+
+
+dnl check for disassembler support
+AC_MSG_CHECKING(whether disassembler should be enabled)
+AC_ARG_ENABLE([disassembler],
+ [AS_HELP_STRING(--disable-disassembler,disable disassembler [[default=yes]])],
+ [case "${enableval}" in
+ no) ENABLE_DISASSEMBLER=no;;
+ *) ENABLE_DISASSEMBLER=yes;;
+ esac],
+ [ENABLE_DISASSEMBLER=yes])
+AC_MSG_RESULT(${ENABLE_DISASSEMBLER})
+AM_CONDITIONAL([ENABLE_DISASSEMBLER], test x"${ENABLE_DISASSEMBLER}" = "xyes")
+
+if test x"${ENABLE_DISASSEMBLER}" = "xyes"; then
+ AC_DEFINE([ENABLE_DISASSEMBLER], 1, [enable disassembler])
dnl check for binutils headers and libraries on some architectures for the
dnl disassembler
AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
;;
esac
-
else
- AC_MSG_RESULT(no)
AM_CONDITIONAL([WITH_BINUTILS_DISASSEMBLER], [false])
fi
-AM_CONDITIONAL([NDEBUG], test x"${NDEBUG}" = "xyes")
dnl check for statistics
fi
+dnl check for inlining
+AC_MSG_CHECKING(whether method inlining should be supported)
+AC_ARG_ENABLE([inlining],
+ [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])],
+ [case "${enableval}" in
+ no) ENABLE_INLINING=no;;
+ *) ENABLE_INLINING=yes;;
+ esac],
+ [ENABLE_INLINING=yes])
+AC_MSG_RESULT(${ENABLE_INLINING})
+AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
+
+if test x"${ENABLE_INLINING}" = "xyes"; then
+ AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
+fi
+
+
+dnl check for loop optimization
+AC_MSG_CHECKING(whether loop optimization should be supported)
+AC_ARG_ENABLE([loop],
+ [AS_HELP_STRING(--disable-loop,disable loop optimization [[default=yes]])],
+ [case "${enableval}" in
+ no) ENABLE_LOOP=no;;
+ *) ENABLE_LOOP=yes;;
+ esac],
+ [ENABLE_LOOP=yes])
+AC_MSG_RESULT(${ENABLE_LOOP})
+AM_CONDITIONAL([ENABLE_LOOP], test x"${ENABLE_LOOP}" = "xyes")
+
+if test x"${ENABLE_LOOP}" = "xyes"; then
+ AC_DEFINE([ENABLE_LOOP], 1, [use loop optimization])
+fi
+
+
dnl check if linear scan register allocator(lsra) should be used
AC_MSG_CHECKING(whether lsra should be supported)
AC_ARG_ENABLE([lsra],
fi
-dnl check for inlining
-AC_MSG_CHECKING(whether method inlining should be supported)
-AC_ARG_ENABLE([inlining],
- [AS_HELP_STRING(--disable-inlining,disable method inlining [[default=yes]])],
+dnl check if profiling should be supported
+AC_MSG_CHECKING(whether profiling should be supported)
+AC_ARG_ENABLE([profiling],
+ [AS_HELP_STRING(--disable-profiling,disable profiling [[default=yes]])],
[case "${enableval}" in
- no) ENABLE_INLINING=no;;
- *) ENABLE_INLINING=yes;;
+ no) ENABLE_PROFILING=no;;
+ *) ENABLE_PROFILING=yes;;
esac],
- [ENABLE_INLINING=yes])
-AC_MSG_RESULT(${ENABLE_INLINING})
-AM_CONDITIONAL([ENABLE_INLINING], test x"${ENABLE_INLINING}" = "xyes")
-
-if test x"$enable_inlining" = "xno"; then
- AC_DEFINE([ENABLE_INLINING], 1, [use method inlining])
+ [ENABLE_PROFILING=yes])
+AC_MSG_RESULT(${ENABLE_PROFILING})
+AM_CONDITIONAL([ENABLE_PROFILING], test x"${ENABLE_PROFILING}" = "xyes")
+
+if test x"${ENABLE_PROFILING}" = "xyes"; then
+ AC_DEFINE([ENABLE_PROFILING], 1, [enable profiling])
fi
AM_CONDITIONAL([ENABLE_ZLIB], test x"${ENABLE_ZLIB}" = "xyes")
+dnl check if a libjvm.so should be built
+AC_MSG_CHECKING(whether to build a libjvm.so)
+AC_ARG_ENABLE([libjvm],
+ [AS_HELP_STRING(--disable-libjvm,build a libjvm.so [[default=yes]])],
+ [case "${enableval}" in
+ no) ENABLE_LIBJVM=no;;
+ *) ENABLE_LIBJVM=yes;;
+ esac],
+ [ENABLE_LIBJVM=yes])
+AC_MSG_RESULT(${ENABLE_LIBJVM})
+AM_CONDITIONAL([ENABLE_LIBJVM], test x"${ENABLE_LIBJVM}" = "xyes")
+AC_SUBST(ENABLE_LIBJVM)
+
+if test x"${ENABLE_LIBJVM}" = "xyes"; then
+ AC_DEFINE([ENABLE_LIBJVM], 1, [enable libjvm.so])
+
+ dnl set AC_ENABLE_SHARED and AC_DISABLE_STATIC properly
+ enable_shared=yes
+ enable_static=no
+else
+ enable_shared=no
+ enable_static=yes
+fi
+
+dnl libtool stuff
+AC_LIBTOOL_DLOPEN
+AC_PROG_LIBTOOL
+
+
dnl check if CACAO should be linked statically
AC_MSG_CHECKING(whether to link CACAO statically)
AC_ARG_ENABLE([staticvm],
[AS_HELP_STRING(--enable-staticvm,link CACAO statically [[default=no]])],
[case "${enableval}" in
- yes) ENABLE_STATICVM=yes;;
+ yes) ENABLE_STATICVM=yes
+ AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
+ ;;
*) ENABLE_STATICVM=no;;
esac],
[ENABLE_STATICVM=no])
AC_MSG_RESULT(${ENABLE_STATICVM})
-
-if test x"${ENABLE_STATICVM}" = "xyes"; then
- AC_DEFINE([ENABLE_STATICVM], 1, [link CACAO statically])
-fi
AM_CONDITIONAL([ENABLE_STATICVM], test x"${ENABLE_STATICVM}" = "xyes")
AC_SUBST(ENABLE_STATICVM)
dnl Maybe the user has Classpath installed 'flat'.
-AC_ARG_WITH([flat-classpath], [AS_HELP_STRING(--with-flat-classpath, GNU Classpath is not zipped in the install directory)])
+AC_ARG_WITH([flat-classpath],
+ [AS_HELP_STRING(--with-flat-classpath, GNU Classpath is not zipped in the install directory)])
+
if test x"$with_flat_classpath" = "x"; then
- GLIBJ_ZIP_STRING=glibj.zip
+ GLIBJ_ZIP_STRING=glibj.zip
else
- GLIBJ_ZIP_STRING=
+ GLIBJ_ZIP_STRING=
fi
AC_SUBST(GLIBJ_ZIP_STRING)
AC_DEFINE_UNQUOTED(GLIBJ_ZIP_STRING, "$GLIBJ_ZIP_STRING", [define to the string base name of the classpath zip file])
##
## Changes:
##
-## $Id: Makefile.am 4627 2006-03-16 12:53:32Z twisti $
+## $Id: Makefile.am 4690 2006-03-27 11:37:46Z twisti $
## Process this file with automake to produce Makefile.in
endif
if ENABLE_STATICVM
-noinst_LTLIBRARIES = \
- libcacaovm.la
-
cacao_LDFLAGS = \
- $(EXPORT_SYMBOLS_FLAGS)
+ -all-static
else
+cacao_LDFLAGS =
+endif
+
+if ENABLE_LIBJVM
lib_LTLIBRARIES = \
libcacaovm.la
libcacaovm_la_LDFLAGS = \
-release $(PACKAGE_VERSION)
-cacao_LDFLAGS = \
- $(EXPORT_SYMBOLS_FLAGS)
+cacao_LDFLAGS += \
+ -export-dynamic
+else
+noinst_LTLIBRARIES = \
+ libcacaovm.la
+
+cacao_LDFLAGS += \
+ -export-dynamic
endif
if WITH_STATIC_CLASSPATH
Philipp Tomsich
Christian Thalinger
- $Id: cacao.c 4688 2006-03-24 11:50:00Z motse $
+ $Id: cacao.c 4690 2006-03-27 11:37:46Z twisti $
*/
JavaVMInitArgs *vm_args;
JavaVM *jvm; /* denotes a Java VM */
-
#if defined(USE_THREADS) && !defined(NATIVE_THREADS)
stackbottom = &dummy;
#endif
vm_exit(status);
}
- /************* If requested, compile all methods ********************/
+ /* If requested, compile all methods. *************************************/
+
+#if !defined(NDEBUG)
if (compileall) {
classinfo *c;
methodinfo *m;
}
}
}
+#endif /* !defined(NDEBUG) */
- /******** If requested, compile a specific method ***************/
+ /* If requested, compile a specific method. *******************************/
+#if !defined(NDEBUG)
if (opt_method != NULL) {
methodinfo *m;
}
vm_shutdown(0);
+#endif /* !defined(NDEBUG) */
/* keep compiler happy */
##
## Changes:
##
-## $Id: Makefile.am 4505 2006-02-14 00:03:56Z twisti $
+## $Id: Makefile.am 4690 2006-03-27 11:37:46Z twisti $
## Process this file with automake to produce Makefile.in
GLIBJ_ZIP = $(CLASSPATH_PREFIX)/share/classpath/$(GLIBJ_ZIP_STRING)
-$(VM_CLASS_FILES): $(VM_JAVA_FILES)
- $(mkdir_p) classes
- $(JAVAC) -bootclasspath $(GLIBJ_ZIP) -d classes $(VM_JAVA_FILES)
-
if ENABLE_ZLIB
pkgdata_DATA = vm.zip
VM_ZIP = ../vm.zip
-vm.zip: $(VM_CLASS_FILES)
+vm.zip: $(VM_JAVA_FILES)
+ $(mkdir_p) classes
+ $(JAVAC) -bootclasspath $(GLIBJ_ZIP) -d classes $(VM_JAVA_FILES)
@if test "$(JAR)" = "zip"; then \
cd classes && $(JAR) -r -D $(VM_ZIP) .; \
else \
cd classes && $(JAR) cvf $(VM_ZIP) .; \
fi
else
-pkgdata_DATA = $(VM_CLASS_FILES)
+pkgdata_DATA = nozip
+
+nozip: $(VM_JAVA_FILES)
+ $(mkdir_p) classes
+ $(JAVAC) -bootclasspath $(GLIBJ_ZIP) -d classes $(VM_JAVA_FILES)
endif
clean-local:
calls instead of machine instructions, using the C calling
convention.
- $Id: builtin.c 4598 2006-03-14 22:16:47Z edwin $
+ $Id: builtin.c 4690 2006-03-27 11:37:46Z twisti $
*/
return NULL;
if (!(c->state & CLASS_INITIALIZED)) {
+#if !defined(NDEBUG)
if (initverbose)
log_message_class("Initialize class (from builtin_new): ", c);
+#endif
if (!initialize_class(c))
return NULL;
Andreas Krall
Christian Thalinger
- $Id: class.c 4582 2006-03-11 20:30:48Z edwin $
+ $Id: class.c 4690 2006-03-27 11:37:46Z twisti $
*/
/* important system classes */
-classinfo *class_java_lang_Object = NULL;
-classinfo *class_java_lang_Class = NULL;
-classinfo *class_java_lang_ClassLoader = NULL;
-classinfo *class_java_lang_Cloneable = NULL;
-classinfo *class_java_lang_SecurityManager = NULL;
-classinfo *class_java_lang_String = NULL;
-classinfo *class_java_lang_System = NULL;
-classinfo *class_java_lang_Thread = NULL;
-classinfo *class_java_lang_ThreadGroup = NULL;
-classinfo *class_java_lang_VMThread = NULL;
-classinfo *class_java_io_Serializable = NULL;
+classinfo *class_java_lang_Object;
+classinfo *class_java_lang_Class;
+classinfo *class_java_lang_ClassLoader;
+classinfo *class_java_lang_Cloneable;
+classinfo *class_java_lang_SecurityManager;
+classinfo *class_java_lang_String;
+classinfo *class_java_lang_System;
+classinfo *class_java_lang_Thread;
+classinfo *class_java_lang_ThreadGroup;
+classinfo *class_java_lang_VMThread;
+classinfo *class_java_io_Serializable;
/* system exception classes required in cacao */
-classinfo *class_java_lang_Throwable = NULL;
-classinfo *class_java_lang_VMThrowable = NULL;
-classinfo *class_java_lang_Error = NULL;
-classinfo *class_java_lang_NoClassDefFoundError = NULL;
-classinfo *class_java_lang_LinkageError = NULL;
-classinfo *class_java_lang_NoSuchMethodError = NULL;
-classinfo *class_java_lang_OutOfMemoryError = NULL;
-
-classinfo *class_java_lang_Exception = NULL;
-classinfo *class_java_lang_ClassNotFoundException = NULL;
-classinfo *class_java_lang_IllegalArgumentException = NULL;
-classinfo *class_java_lang_IllegalMonitorStateException = NULL;
-
-classinfo *class_java_lang_Void = NULL;
-classinfo *class_java_lang_Boolean = NULL;
-classinfo *class_java_lang_Byte = NULL;
-classinfo *class_java_lang_Character = NULL;
-classinfo *class_java_lang_Short = NULL;
-classinfo *class_java_lang_Integer = NULL;
-classinfo *class_java_lang_Long = NULL;
-classinfo *class_java_lang_Float = NULL;
-classinfo *class_java_lang_Double = NULL;
+classinfo *class_java_lang_Throwable;
+classinfo *class_java_lang_VMThrowable;
+classinfo *class_java_lang_Error;
+classinfo *class_java_lang_NoClassDefFoundError;
+classinfo *class_java_lang_LinkageError;
+classinfo *class_java_lang_NoSuchMethodError;
+classinfo *class_java_lang_OutOfMemoryError;
+
+classinfo *class_java_lang_Exception;
+classinfo *class_java_lang_ClassNotFoundException;
+classinfo *class_java_lang_IllegalArgumentException;
+classinfo *class_java_lang_IllegalMonitorStateException;
+
+classinfo *class_java_lang_Void;
+classinfo *class_java_lang_Boolean;
+classinfo *class_java_lang_Byte;
+classinfo *class_java_lang_Character;
+classinfo *class_java_lang_Short;
+classinfo *class_java_lang_Integer;
+classinfo *class_java_lang_Long;
+classinfo *class_java_lang_Float;
+classinfo *class_java_lang_Double;
/* some runtime exception */
-classinfo *class_java_lang_NullPointerException = NULL;
+classinfo *class_java_lang_NullPointerException;
/* some classes which may be used more often */
-classinfo *class_java_lang_StackTraceElement = NULL;
-classinfo *class_java_lang_reflect_Constructor = NULL;
-classinfo *class_java_lang_reflect_Field = NULL;
-classinfo *class_java_lang_reflect_Method = NULL;
-classinfo *class_java_security_PrivilegedAction = NULL;
-classinfo *class_java_util_Vector = NULL;
+classinfo *class_java_lang_StackTraceElement;
+classinfo *class_java_lang_reflect_Constructor;
+classinfo *class_java_lang_reflect_Field;
+classinfo *class_java_lang_reflect_Method;
+classinfo *class_java_security_PrivilegedAction;
+classinfo *class_java_util_Vector;
-classinfo *arrayclass_java_lang_Object = NULL;
+classinfo *arrayclass_java_lang_Object;
/* pseudo classes for the typechecker */
-classinfo *pseudo_class_Arraystub = NULL;
-classinfo *pseudo_class_Null = NULL;
-classinfo *pseudo_class_New = NULL;
+classinfo *pseudo_class_Arraystub;
+classinfo *pseudo_class_Null;
+classinfo *pseudo_class_New;
/* class_set_packagename *******************************************************
Changes: Christian Thalinger
- $Id: classcache.c 4526 2006-02-20 14:08:26Z twisti $
+ $Id: classcache.c 4690 2006-03-27 11:37:46Z twisti $
*/
+#include "config.h"
+
#include <assert.h>
-#include "config.h"
#include "vm/types.h"
#include "mm/memory.h"
#include "vm/stringlocal.h"
#include "vm/utf8.h"
+
/*************************************************************************
Class Cache
Changes: Edwin Steiner
- $Id: exceptions.c 4566 2006-03-07 10:36:42Z twisti $
+ $Id: exceptions.c 4690 2006-03-27 11:37:46Z twisti $
*/
/* new_verifyerror *************************************************************
- generates a java.lang.VerifyError for the jit compiler
+ Generates a java.lang.VerifyError for the JIT compiler.
*******************************************************************************/
ex = (exceptionentry *) (pv + ExTableStart);
exceptiontablelength = *((s4 *) (pv + ExTableSize));
+#if !defined(NDEBUG)
/* print exception trace */
if (opt_verbose || opt_verbosecall || opt_verboseexception)
builtin_trace_exception(xptr, m, xpc, 1);
+#endif
for (i = 0; i < exceptiontablelength; i++) {
/* ATTENTION: keep this here, as we need to decrement the
Changes: Edwin Steiner
- $Id: exceptions.h 4566 2006-03-07 10:36:42Z twisti $
+ $Id: exceptions.h 4690 2006-03-27 11:37:46Z twisti $
*/
void exceptions_throw_nosuchmethoderror(classinfo *c, utf *name, utf *desc);
java_objectheader *new_internalerror(const char *message, ...);
+
java_objectheader *new_verifyerror(methodinfo *m, const char *message, ...);
+void exceptions_throw_verifyerror_for_stack(methodinfo *m, int type);
+
java_objectheader *new_unsupportedclassversionerror(classinfo *c,
const char *message, ...);
-void exceptions_throw_verifyerror_for_stack(methodinfo *m,int type);
java_objectheader *new_arithmeticexception(void);
##
## Changes: Edwin Steiner
##
-## $Id: Makefile.am 4668 2006-03-21 11:58:50Z twisti $
+## $Id: Makefile.am 4690 2006-03-27 11:37:46Z twisti $
## Process this file with automake to produce Makefile.in
SUBDIRS = \
allocator \
- loop \
tools \
verify
INLINE_LIB = inline/libinline.la
endif
+if ENABLE_LOOP
+SUBDIRS += loop
+LOOP_LIB = loop/libloop.la
+endif
+
+if ENABLE_PROFILING
SUBDIRS += profile
PROFILE_LIB = profile/libprofile.la
+endif
if USE_SCHEDULER
SUBDIRS += schedule
libjit_la_LIBADD = \
allocator/liballocator.la \
- loop/libloop.la \
verify/libverify.la \
$(IFCONV_LIB) \
$(INLINE_LIB) \
+ $(LOOP_LIB) \
$(PROFILE_LIB) \
$(SCHEDULE_LIB) \
$(INTRP_LIB) \
memory. All functions writing values into the data area return the offset
relative the begin of the code area (start of procedure).
- $Id: codegen-common.c 4631 2006-03-16 14:19:52Z twisti $
+ $Id: codegen-common.c 4690 2006-03-27 11:37:46Z twisti $
*/
count_nstub_len += code->mcodelength;
#endif
+#if !defined(NDEBUG)
/* disassemble native stub */
if (opt_shownativestub) {
if (opt_showddatasegment)
dseg_display(m, cd);
}
+#endif /* !defined(NDEBUG) */
/* release memory */
*******************************************************************************/
+#if !defined(NDEBUG)
void codegen_disassemble_nativestub(methodinfo *m, u1 *start, u1 *end)
{
printf("Native stub: ");
DISASSEMBLE(start, end);
}
+#endif
/* codegen_start_native_call ***************************************************
Changes: Christian Ullrich
Edwin Steiner
- $Id: codegen-common.h 4615 2006-03-15 16:36:43Z twisti $
+ $Id: codegen-common.h 4690 2006-03-27 11:37:46Z twisti $
*/
void codegen_finish(methodinfo *m, codegendata *cd, s4 mcodelen);
codeinfo *codegen_createnativestub(functionptr f, methodinfo *m);
+#if !defined(NDEBUG)
void codegen_disassemble_nativestub(methodinfo *m, u1 *start, u1 *end);
+#endif
void codegen_start_native_call(u1 *datasp, u1 *pv, u1 *sp, u1 *ra);
void codegen_finish_native_call(u1 *datasp);
Christian Thalinger
Christian Ullrich
- $Id: jit.c 4604 2006-03-15 01:39:32Z edwin $
+ $Id: jit.c 4690 2006-03-27 11:37:46Z twisti $
*/
#endif
if (r) {
- if (compileverbose)
- log_message_method("Running: ", m);
+ DEBUG_JIT_COMPILEVERBOSE("Running: ");
} else {
/* We had an exception! Finish stuff here if necessary. */
}
#endif
+#if defined(ENABLE_LOOP)
if (opt_loops) {
depthFirst(m, ld);
analyseGraph(m, ld);
optimize_loops(m, cd, ld);
}
+#endif
#if defined(ENABLE_JIT)
# if defined(ENABLE_INTRP)
Christian Thalinger
Christian Ullrich
- $Id: stack.c 4683 2006-03-23 00:30:30Z edwin $
+ $Id: stack.c 4690 2006-03-27 11:37:46Z twisti $
*/
*******************************************************************************/
+#if !defined(NDEBUG)
void stack_print(codegendata *cd, stackptr s)
{
int i, j;
s = s->prev;
}
}
+#endif /* !defined(NDEBUG) */
#if 0
Changes: Christian Ullrich
- $Id: stack.h 4683 2006-03-23 00:30:30Z edwin $
+ $Id: stack.h 4690 2006-03-27 11:37:46Z twisti $
*/
methodinfo *analyse_stack(methodinfo *m, codegendata *cd, registerdata *rd);
+#if !defined(NDEBUG)
void stack_print(codegendata *cd, stackptr s);
void show_icmd_method(methodinfo *m, codegendata *cd, registerdata *rd);
void show_icmd_block(methodinfo *m, codegendata *cd, basicblock *bptr);
void show_icmd(instruction *iptr, bool deadcode);
+#endif
/* machine dependent return value handling function */
void md_return_alloc(methodinfo *m, registerdata *rd, s4 return_type,
##
## Changes:
##
-## $Id: Makefile.am 4563 2006-03-06 13:03:05Z twisti $
+## $Id: Makefile.am 4690 2006-03-27 11:37:46Z twisti $
## Process this file with automake to produce Makefile.in
noinst_LTLIBRARIES = libarch.la
+if ENABLE_DISASSEMBLER
+DISASS_SOURCES = \
+ disass.c
+endif
+
libarch_la_SOURCES = \
asmpart.S \
codegen.c \
codegen.h \
- disass.c \
+ $(DISASS_SOURCES) \
emitfuncs.c \
emitfuncs.h \
patcher.c \
Changes: Edwin Steiner
- $Id: asmpart.S 4643 2006-03-16 18:38:42Z edwin $
+ $Id: asmpart.S 4690 2006-03-27 11:37:46Z twisti $
*/
ret
calljava_xhandler2:
+#if !defined(NDEBUG)
mov xptr,a0 /* pass exception pointer */
call builtin_throw_exception@PLT
+#endif
xor v0,v0 /* return NULL */
jmp L_asm_vm_call_method_return
Changes: Christian Ullrich
Edwin Steiner
- $Id: codegen.c 4644 2006-03-16 18:44:46Z edwin $
+ $Id: codegen.c 4690 2006-03-27 11:37:46Z twisti $
*/
}
#endif
+#if !defined(NDEBUG)
/* Copy argument registers to stack and call trace function with
pointer to arguments on stack. */
M_LADD_IMM((INT_ARG_CNT + FLT_ARG_CNT + INT_TMP_CNT + FLT_TMP_CNT + 1 + 1) * 8, REG_SP);
}
+#endif /* !defined(NDEBUG) */
}
nowperformreturn:
{
s4 i, p;
-
+
p = parentargs_base;
-
- /* call trace function */
+
+#if !defined(NDEBUG)
+ /* generate call trace */
+
if (opt_verbosecall) {
x86_64_alu_imm_reg(cd, X86_64_SUB, 2 * 8, REG_SP);
M_FLTMOVE(REG_FRESULT, rd->argfltregs[0]);
M_FLTMOVE(REG_FRESULT, rd->argfltregs[1]);
- x86_64_mov_imm_reg(cd, (u8) builtin_displaymethodstop, REG_ITMP1);
- x86_64_call_reg(cd, REG_ITMP1);
+ M_MOV_IMM(builtin_displaymethodstop, REG_ITMP1);
+ M_CALL(REG_ITMP1);
x86_64_mov_membase_reg(cd, REG_SP, 0 * 8, REG_RESULT);
x86_64_movq_membase_reg(cd, REG_SP, 1 * 8, REG_FRESULT);
x86_64_alu_imm_reg(cd, X86_64_ADD, 2 * 8, REG_SP);
}
+#endif /* !defined(NDEBUG) */
#if defined(USE_THREADS)
if (checksync && (m->flags & ACC_SYNCHRONIZED)) {
M_ASUB_IMM(stackframesize * 8, REG_SP);
+#if !defined(NDEBUG)
+ /* generate call trace */
+
if (opt_verbosecall) {
/* save integer and float argument registers */
if (IS_FLT_DBL_TYPE(md->paramtypes[i].type))
M_DLD(rd->argfltregs[j++], REG_SP, (1 + INT_ARG_CNT + i) * 8);
}
-
+#endif /* !defined(NDEBUG) */
/* get function address (this must happen before the stackframeinfo) */
M_MOV_IMM(codegen_finish_native_call, REG_ITMP1);
M_CALL(REG_ITMP1);
+#if !defined(NDEBUG)
/* generate call trace */
if (opt_verbosecall) {
M_MOV_IMM(builtin_displaymethodstop, REG_ITMP1);
M_CALL(REG_ITMP1);
}
+#endif /* !defined(NDEBUG) */
/* check for exception */
Edwin Steiner
Christian Thalinger
- $Id: linker.c 4551 2006-03-03 00:00:39Z twisti $
+ $Id: linker.c 4690 2006-03-27 11:37:46Z twisti $
*/
if (c->state & CLASS_LINKED)
return c;
+#if !defined(NDEBUG)
if (linkverbose)
log_message_class("Linking class: ", c);
+#endif
/* the class must be loaded */
c->state = (c->state & ~CLASS_LINKING) | CLASS_LINKED;
+#if !defined(NDEBUG)
if (linkverbose)
log_message_class("Linking done class: ", c);
+#endif
/* just return c to show that we didn't had a problem */
Edwin Steiner
Christian Thalinger
- $Id: loader.c 4598 2006-03-14 22:16:47Z edwin $
+ $Id: loader.c 4690 2006-03-27 11:37:46Z twisti $
*/
utf_fprint_classname(stderr, u);
fprintf(stderr, "\n");
+#if !defined(NDEBUG)
/* print out exception and cause */
exceptions_print_exception(*exceptionptr);
+#endif
}
}
}
Changes: Christan Thalinger
- $Id: resolve.c 4586 2006-03-11 21:34:20Z edwin $
+ $Id: resolve.c 4690 2006-03-27 11:37:46Z twisti $
*/
+#include "config.h"
+
#include <assert.h>
#include "mm/memory.h"
#include "vm/classcache.h"
#include "vm/descriptor.h"
#include "vm/exceptions.h"
+#include "vm/global.h"
#include "vm/linker.h"
#include "vm/loader.h"
#include "vm/stringlocal.h"
if (!jni_init())
throw_main_exception_exit();
+#if defined(ENABLE_PROFILING)
/* initialize profiling */
if (!profile_init())
throw_main_exception_exit();
-
+#endif
+
#if defined(USE_THREADS)
/* finally, start the finalizer thread */
if (showutf)
utf_show();
+# if defined(ENABLE_PROFILING)
if (opt_prof)
profile_printstats();
+# endif
#endif
#if defined(USE_THREADS) && !defined(NATIVE_THREADS)