GNU header update.
[cacao.git] / src / vm / exceptions.c
index 65c9a9fbc21a9bad5d0e1d043cc355d51ad6c390..bfc8ce68752c11129d106bcd6c9b453b207893d7 100644 (file)
@@ -1,9 +1,9 @@
-/* exceptions.c - exception related functions
+/* vm/exceptions.c - exception related functions
 
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-   R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
-   M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
-   P. Tomsich, J. Wenninger
+   Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
+   R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
+   C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
+   Institut f. Computersprachen - TU Wien
 
    This file is part of CACAO.
 
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: exceptions.c 1480 2004-11-11 14:37:01Z twisti $
+   $Id: exceptions.c 1735 2004-12-07 14:33:27Z twisti $
 
 */
 
 #include <string.h>
 #include <stdarg.h>
 #include <stdlib.h>
-#include "asmpart.h"
-#include "global.h"
-#include "loader.h"
-#include "native.h"
-#include "tables.h"
-#include "jit/jit.h"
+
+#include "mm/memory.h"
+#include "native/native.h"
+#include "native/include/java_lang_String.h"
+#include "native/include/java_lang_Throwable.h"
 #include "toolbox/logging.h"
-#include "toolbox/memory.h"
-#include "nat/java_lang_String.h"
-#include "nat/java_lang_Throwable.h"
+#include "vm/global.h"
+#include "vm/loader.h"
+#include "vm/tables.h"
+#include "vm/jit/asmpart.h"
+#include "vm/jit/jit.h"
+#include "vm/options.h"
 
 
 /* system exception classes required in cacao */
@@ -297,7 +299,7 @@ void throw_main_exception_exit()
 }
 
 
-void throw_cacao_exception_exit(char *exception, char *message, ...)
+void throw_cacao_exception_exit(const char *exception, const char *message, ...)
 {
        s4 i;
        char *tmp;
@@ -305,9 +307,9 @@ void throw_cacao_exception_exit(char *exception, char *message, ...)
        va_list ap;
 
        len = strlen(exception);
-       tmp = MNEW(char, len+1);
+       tmp = MNEW(char, len + 1);
        strncpy(tmp, exception, len);
-        tmp[len]='\0';
+       tmp[len] = '\0';
 
        /* convert to classname */
 
@@ -323,7 +325,7 @@ void throw_cacao_exception_exit(char *exception, char *message, ...)
                fprintf(stderr, ": ");
 
                va_start(ap, message);
-               fprintf(stderr, message, ap);
+               vfprintf(stderr, message, ap);
                va_end(ap);
        }
 
@@ -458,6 +460,7 @@ java_objectheader *new_verifyerror(methodinfo *m, char *message)
        char *msg;
        s4 len;
 
+       useinlining = false; /* at least until sure inlining works with exceptions*/
        len = 8 + utf_strlen(m->class->name) +
                10 + utf_strlen(m->name) +
                13 + utf_strlen(m->descriptor) +
@@ -525,7 +528,11 @@ java_objectheader *new_arrayindexoutofboundsexception(s4 index)
                return *exceptionptr;
 
        s = (java_lang_String *) asm_calljavafunction(m,
+#if POINTERSIZE == 8
+                                                                                                 (void *) (s8) index,
+#else
                                                                                                  (void *) index,
+#endif
                                                                                                  NULL,
                                                                                                  NULL,
                                                                                                  NULL);