-/* 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.
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 */
}
-void throw_cacao_exception_exit(char *exception, char *message, ...)
+void throw_cacao_exception_exit(const char *exception, const char *message, ...)
{
s4 i;
char *tmp;
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 */
fprintf(stderr, ": ");
va_start(ap, message);
- fprintf(stderr, message, ap);
+ vfprintf(stderr, message, ap);
va_end(ap);
}
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) +
return *exceptionptr;
s = (java_lang_String *) asm_calljavafunction(m,
+#if POINTERSIZE == 8
+ (void *) (s8) index,
+#else
(void *) index,
+#endif
NULL,
NULL,
NULL);