* src/vm/class.c: Don't initialize classes to NULL.
authortwisti <none@none>
Mon, 27 Mar 2006 11:37:46 +0000 (11:37 +0000)
committertwisti <none@none>
Mon, 27 Mar 2006 11:37:46 +0000 (11:37 +0000)
* 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.

22 files changed:
configure.ac
src/cacao/Makefile.am
src/cacao/cacao.c
src/lib/Makefile.am
src/vm/builtin.c
src/vm/class.c
src/vm/classcache.c
src/vm/exceptions.c
src/vm/exceptions.h
src/vm/jit/Makefile.am
src/vm/jit/codegen-common.c
src/vm/jit/codegen-common.h
src/vm/jit/jit.c
src/vm/jit/stack.c
src/vm/jit/stack.h
src/vm/jit/x86_64/Makefile.am
src/vm/jit/x86_64/asmpart.S
src/vm/jit/x86_64/codegen.c
src/vm/linker.c
src/vm/loader.c
src/vm/resolve.c
src/vm/vm.c

index 6904aea5f3ca69720d5d9a2ef7a66bb8b87854c6..ec152286fde4261e407dafe6f3f4b422edcb277b 100644 (file)
@@ -116,13 +116,6 @@ AC_PROG_LN_S
 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
@@ -167,15 +160,6 @@ AC_CHECK_SIZEOF(void *)
 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
@@ -316,6 +300,26 @@ AC_ARG_ENABLE([debug],
 
 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
@@ -342,12 +346,9 @@ if test x"${NDEBUG}" = "xno"; then
             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
@@ -466,6 +467,40 @@ if test x"${ENABLE_IFCONV}" = "xyes"; then
 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],
@@ -483,20 +518,20 @@ if test x"${ENABLE_LSRA}" = "xyes"; then
 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
 
 
@@ -547,20 +582,47 @@ AC_SUBST(VM_ZIP_STRING)
 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)
 
@@ -617,11 +679,13 @@ AC_SUBST(WITH_STATIC_CLASSPATH)
 
 
 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])
index 75b5e05a88397b82be01a8315c6b7466cd2c37ff..5737f8559c54509b376379d7deb7ec01640c1809 100644 (file)
@@ -28,7 +28,7 @@
 ##
 ## 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
 
@@ -55,20 +55,27 @@ THREAD_LIB =
 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
index 6da4bd5738290cf876b50ff186df45df976532ce..64b407c0dfd6054e72c43def148c56169d65892c 100644 (file)
@@ -31,7 +31,7 @@
             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 $
 
 */
 
@@ -198,7 +198,6 @@ int main(int argc, char **argv)
        JavaVMInitArgs *vm_args;
        JavaVM         *jvm;                /* denotes a Java VM                  */
 
-
 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)
        stackbottom = &dummy;
 #endif
@@ -349,8 +348,10 @@ int main(int argc, char **argv)
                vm_exit(status);
        }
 
-       /************* If requested, compile all methods ********************/
 
+       /* If requested, compile all methods. *************************************/
+
+#if !defined(NDEBUG)
        if (compileall) {
                classinfo *c;
                methodinfo *m;
@@ -418,10 +419,12 @@ int main(int argc, char **argv)
                        }
                }
        }
+#endif /* !defined(NDEBUG) */
 
 
-       /******** If requested, compile a specific method ***************/
+       /* If requested, compile a specific method. *******************************/
 
+#if !defined(NDEBUG)
        if (opt_method != NULL) {
                methodinfo *m;
 
@@ -463,6 +466,7 @@ int main(int argc, char **argv)
        }
 
        vm_shutdown(0);
+#endif /* !defined(NDEBUG) */
 
        /* keep compiler happy */
 
index d0f29cfef7fa62fe53ea9148aaff59e7b0eb56ed..63d5688682cff75970e29b2ecc39c0e74134dde8 100644 (file)
@@ -28,7 +28,7 @@
 ##
 ## 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
 
@@ -55,23 +55,25 @@ VM_CLASS_FILES = \
 
 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:
index f50dc55fa1a6a7b3c819c82b4620397e719f5be0..57918bdcaada8b461545d8ef80213210775ef5d2 100644 (file)
@@ -37,7 +37,7 @@
    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 $
 
 */
 
@@ -748,8 +748,10 @@ java_objectheader *builtin_new(classinfo *c)
                        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;
index bac6cc4f69584f335f1cb23c821898b695c54a85..81171d3dc6dc1bf5e77809a1c8176964f5718e2b 100644 (file)
@@ -30,7 +30,7 @@
             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 $
 
 */
 
@@ -92,67 +92,67 @@ list unlinkedclasses;                   /* this is only used for eager class  */
 
 /* 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 *******************************************************
index ddcfdbe31c80fa77eca0e80f6e1d0244a19e07c4..8c856fdc2fdcb28f58946a151824c10e689eaede 100644 (file)
 
    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"
@@ -45,6 +46,7 @@
 #include "vm/stringlocal.h"
 #include "vm/utf8.h"
 
+
 /*************************************************************************
 
   Class Cache
index bebc1907627616d039e59457407d46e4ef8c068d..a813cc6ced14ad5aac1b5e1527376c536c1aed25 100644 (file)
@@ -28,7 +28,7 @@
 
    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 $
 
 */
 
@@ -796,7 +796,7 @@ java_objectheader *new_unsupportedclassversionerror(classinfo *c, const char *me
 
 /* new_verifyerror *************************************************************
 
-   generates a java.lang.VerifyError for the jit compiler
+   Generates a java.lang.VerifyError for the JIT compiler.
 
 *******************************************************************************/
 
@@ -1218,10 +1218,12 @@ u1 *exceptions_handle_exception(java_objectheader *xptr, u1 *xpc, u1 *pv, u1 *sp
        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
index 0eb38cc11d74f942a2d17e9d6f3b5be147df0992..7c99f4ea19aa712ef7278fd74e930ff3f80f14bc 100644 (file)
@@ -28,7 +28,7 @@
 
    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 $
 
 */
 
@@ -129,10 +129,12 @@ java_objectheader *exceptions_new_nosuchmethoderror(classinfo *c,
 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);
 
index eeda5a6c267d44f10b146196648ec37368f1b652..5bf7d9aa27bb9e77711fddcc436c03cce798cc3d 100644 (file)
@@ -28,7 +28,7 @@
 ##
 ## 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
 
@@ -54,7 +54,6 @@ DIST_SUBDIRS = \
 
 SUBDIRS = \
        allocator \
-       loop \
        tools \
        verify
 
@@ -78,8 +77,15 @@ SUBDIRS += inline
 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
@@ -124,10 +130,10 @@ libjit_la_SOURCES = \
 
 libjit_la_LIBADD = \
        allocator/liballocator.la \
-       loop/libloop.la \
        verify/libverify.la \
        $(IFCONV_LIB) \
        $(INLINE_LIB) \
+       $(LOOP_LIB) \
        $(PROFILE_LIB) \
        $(SCHEDULE_LIB) \
        $(INTRP_LIB) \
index 4438096d0fb8962324913fd4a5a566e30c6e3278..f05cf56c8b08ca3656860496edd8fd6dde542fc2 100644 (file)
@@ -48,7 +48,7 @@
    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 $
 
 */
 
@@ -849,6 +849,7 @@ codeinfo *codegen_createnativestub(functionptr f, methodinfo *m)
                count_nstub_len += code->mcodelength;
 #endif
 
+#if !defined(NDEBUG)
        /* disassemble native stub */
 
        if (opt_shownativestub) {
@@ -861,6 +862,7 @@ codeinfo *codegen_createnativestub(functionptr f, methodinfo *m)
                if (opt_showddatasegment)
                        dseg_display(m, cd);
        }
+#endif /* !defined(NDEBUG) */
 
        /* release memory */
 
@@ -878,6 +880,7 @@ codeinfo *codegen_createnativestub(functionptr f, methodinfo *m)
 
 *******************************************************************************/
 
+#if !defined(NDEBUG)
 void codegen_disassemble_nativestub(methodinfo *m, u1 *start, u1 *end)
 {
        printf("Native stub: ");
@@ -889,6 +892,7 @@ void codegen_disassemble_nativestub(methodinfo *m, u1 *start, u1 *end)
 
        DISASSEMBLE(start, end);
 }
+#endif
 
 
 /* codegen_start_native_call ***************************************************
index 1ed7700d4e4e1afa86da9a6e92d332b07405f0f5..e3971817df870264fa5f033a834eda91968810a2 100644 (file)
@@ -29,7 +29,7 @@
    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 $
 
 */
 
@@ -185,7 +185,9 @@ u1 *codegen_findmethod(u1 *pc);
 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);
index de4cb08e1f2951e1a34d65bf95741b5411e7d79b..05b098bd3f3bbe6337a8027c549853f0f49f2a48 100644 (file)
@@ -31,7 +31,7 @@
             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 $
 
 */
 
@@ -1418,8 +1418,7 @@ u1 *jit_compile(methodinfo *m)
 #endif
 
        if (r) {
-               if (compileverbose)
-                       log_message_method("Running: ", m);
+               DEBUG_JIT_COMPILEVERBOSE("Running: ");
 
        } else {
                /* We had an exception! Finish stuff here if necessary. */
@@ -1557,11 +1556,13 @@ static u1 *jit_compile_intern(methodinfo *m, codegendata *cd, registerdata *rd,
        }
 #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)
index 0c0fdb73797deeef63c4ff3ce882ba24a5a0a7be..4c0f85569ffd090b4a0c2a37e83a7d9e4f586fd7 100644 (file)
@@ -30,7 +30,7 @@
             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 $
 
 */
 
@@ -2420,6 +2420,7 @@ throw_stack_category_error:
 
 *******************************************************************************/
 
+#if !defined(NDEBUG)
 void stack_print(codegendata *cd, stackptr s)
 {
        int i, j;
@@ -2565,6 +2566,7 @@ void stack_print(codegendata *cd, stackptr s)
                s = s->prev;
        }
 }
+#endif /* !defined(NDEBUG) */
 
 
 #if 0
index 4f3db73e4a14f9b79ffef4323a2547aa5951e04c..9a6b1caa225178d042852eb23d9c72ac656372c9 100644 (file)
@@ -28,7 +28,7 @@
 
    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 $
 
 */
 
@@ -463,10 +463,12 @@ bool stack_init(void);
 
 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,
index 89dbd326b6e58064845bc48509480e1d8aa932c5..2ca7a6196e6a3a70815859926e0992cba0ba598b 100644 (file)
@@ -28,7 +28,7 @@
 ##
 ## 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
 
@@ -49,11 +49,16 @@ noinst_HEADERS = \
 
 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 \
index d03cf2e1ed68cad543d2692a838f4938fad8b387..3dae627c9fb2b501f01a932d307209b3194821e4 100644 (file)
@@ -30,7 +30,7 @@
 
    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 $
 
 */
 
@@ -219,8 +219,10 @@ L_asm_vm_call_method_return:
        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
 
index 5b119fee261b6f8adce6cbc25752f8f0a6d014ad..55a761248b15780cd73f89c33b9eebcb0464bbc2 100644 (file)
@@ -30,7 +30,7 @@
    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 $
 
 */
 
@@ -303,6 +303,7 @@ bool codegen(methodinfo *m, codegendata *cd, registerdata *rd)
        }
 #endif
 
+#if !defined(NDEBUG)
        /* Copy argument registers to stack and call trace function with
           pointer to arguments on stack. */
 
@@ -372,6 +373,7 @@ bool codegen(methodinfo *m, codegendata *cd, registerdata *rd)
 
                M_LADD_IMM((INT_ARG_CNT + FLT_ARG_CNT + INT_TMP_CNT + FLT_TMP_CNT + 1 + 1) * 8, REG_SP);
        }
+#endif /* !defined(NDEBUG) */
 
        }
 
@@ -2976,10 +2978,12 @@ bool codegen(methodinfo *m, codegendata *cd, registerdata *rd)
 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);
 
@@ -2991,14 +2995,15 @@ nowperformreturn:
                                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)) {
@@ -4129,6 +4134,9 @@ u1 *createnativestub(functionptr f, methodinfo *m, codegendata *cd,
 
        M_ASUB_IMM(stackframesize * 8, REG_SP);
 
+#if !defined(NDEBUG)
+       /* generate call trace */
+
        if (opt_verbosecall) {
                /* save integer and float argument registers */
 
@@ -4170,7 +4178,7 @@ u1 *createnativestub(functionptr f, methodinfo *m, codegendata *cd,
                        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) */
 
@@ -4287,6 +4295,7 @@ u1 *createnativestub(functionptr f, methodinfo *m, codegendata *cd,
        M_MOV_IMM(codegen_finish_native_call, REG_ITMP1);
        M_CALL(REG_ITMP1);
 
+#if !defined(NDEBUG)
        /* generate call trace */
 
        if (opt_verbosecall) {
@@ -4307,6 +4316,7 @@ u1 *createnativestub(functionptr f, methodinfo *m, codegendata *cd,
                M_MOV_IMM(builtin_displaymethodstop, REG_ITMP1);
                M_CALL(REG_ITMP1);
        }
+#endif /* !defined(NDEBUG) */
 
        /* check for exception */
 
index bb2a8e13963383db1c0fd9ca036474a019f79c5c..ca67efbf9c9d4679634716c393176c36482154d2 100644 (file)
@@ -32,7 +32,7 @@
             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 $
 
 */
 
@@ -442,8 +442,10 @@ static classinfo *link_class_intern(classinfo *c)
        if (c->state & CLASS_LINKED)
                return c;
 
+#if !defined(NDEBUG)
        if (linkverbose)
                log_message_class("Linking class: ", c);
+#endif
 
        /* the class must be loaded */
 
@@ -841,8 +843,10 @@ static classinfo *link_class_intern(classinfo *c)
 
        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 */
 
index 413fc569777738431dd53de444e18b4db052cdda..c63a990456038f2e3b842af5ad95c72e95a10540 100644 (file)
@@ -32,7 +32,7 @@
             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 $
 
 */
 
@@ -276,9 +276,11 @@ void loader_load_all_classes(void)
                                                utf_fprint_classname(stderr, u);
                                                fprintf(stderr, "\n");
 
+#if !defined(NDEBUG)
                                                /* print out exception and cause */
 
                                                exceptions_print_exception(*exceptionptr);
+#endif
                                        }
                                }
                        }
index 467e3425740c6c454bb6755024865db60db420a1..7b69d5f773528fa9533697344d867c32c704813b 100644 (file)
 
    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"
@@ -41,6 +43,7 @@
 #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"
index a4c334dedc6abc65cf2a703eceebdb7b8abc8f05..6a5ba1b9fd66552dd10a63c0a50bf0e062504676 100644 (file)
@@ -1169,11 +1169,13 @@ bool vm_create(JavaVMInitArgs *vm_args)
        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 */
 
@@ -1327,8 +1329,10 @@ void vm_exit_handler(void)
        if (showutf)
                utf_show();
 
+# if defined(ENABLE_PROFILING)
        if (opt_prof)
                profile_printstats();
+# endif
 #endif
 
 #if defined(USE_THREADS) && !defined(NATIVE_THREADS)