Authors: Christian Thalinger
- Changes:
+ Changes: Edwin Steiner
- $Id: exceptions.h 2276 2005-04-12 19:47:33Z twisti $
+ $Id: exceptions.h 3653 2005-11-11 11:16:42Z twisti $
*/
#ifndef _EXCEPTIONS_H
#define _EXCEPTIONS_H
+#include "config.h"
+#include "vm/types.h"
+
#include "vm/global.h"
#include "native/include/java_lang_String.h"
#include "native/include/java_lang_Throwable.h"
#if defined(USE_THREADS) && defined(NATIVE_THREADS)
-
-#define exceptionptr builtin_get_exceptionptrptr()
-#define threadrootmethod builtin_get_threadrootmethod()
-
-#else /* defined(USE_THREADS) && defined(NATIVE_THREADS) */
-
-#define exceptionptr (&_exceptionptr)
-#define threadrootmethod (&_threadrootmethod)
-
-#endif /* defined(USE_THREADS) && defined(NATIVE_THREADS) */
+#define exceptionptr builtin_get_exceptionptrptr()
+#else
+#define exceptionptr &_no_threads_exceptionptr
+#endif
#if !defined(USE_THREADS) || !defined(NATIVE_THREADS)
-extern java_objectheader *_exceptionptr;
-extern methodinfo* _threadrootmethod;
-#endif /* !defined(USE_THREADS) || !defined(NATIVE_THREADS) */
+extern java_objectheader *_no_threads_exceptionptr;
+#endif
/* global variables ***********************************************************/
-/* exception/error super class */
-
-extern const char *string_java_lang_Throwable;
-extern const char *string_java_lang_VMThrowable;
-
-
-/* specify some exception strings for code generation */
-
-extern const char *string_java_lang_ArithmeticException;
-extern const char *string_java_lang_ArithmeticException_message;
-extern const char *string_java_lang_ArrayIndexOutOfBoundsException;
-extern const char *string_java_lang_ArrayStoreException;
-extern const char *string_java_lang_ClassCastException;
-extern const char *string_java_lang_ClassNotFoundException;
-extern const char *string_java_lang_CloneNotSupportedException;
-extern const char *string_java_lang_Exception;
-extern const char *string_java_lang_IllegalAccessException;
-extern const char *string_java_lang_IllegalArgumentException;
-extern const char *string_java_lang_IllegalMonitorStateException;
-extern const char *string_java_lang_IndexOutOfBoundsException;
-extern const char *string_java_lang_InstantiationException;
-extern const char *string_java_lang_InterruptedException;
-extern const char *string_java_lang_NegativeArraySizeException;
-extern const char *string_java_lang_NoSuchFieldException;
-extern const char *string_java_lang_NoSuchMethodException;
-extern const char *string_java_lang_NullPointerException;
-
-
-/* specify some error strings for code generation */
-
-extern const char *string_java_lang_AbstractMethodError;
-extern const char *string_java_lang_ClassCircularityError;
-extern const char *string_java_lang_ClassFormatError;
-extern const char *string_java_lang_Error;
-extern const char *string_java_lang_ExceptionInInitializerError;
-extern const char *string_java_lang_IncompatibleClassChangeError;
-extern const char *string_java_lang_InternalError;
-extern const char *string_java_lang_LinkageError;
-extern const char *string_java_lang_NoClassDefFoundError;
-extern const char *string_java_lang_NoSuchFieldError;
-extern const char *string_java_lang_NoSuchMethodError;
-extern const char *string_java_lang_OutOfMemoryError;
-extern const char *string_java_lang_UnsupportedClassVersionError;
-extern const char *string_java_lang_VerifyError;
-extern const char *string_java_lang_VirtualMachineError;
-
/* function prototypes ********************************************************/
/* exception throwing functions */
-void throw_exception();
-void throw_exception_exit();
+void throw_exception(void);
+void throw_exception_exit(void);
+
+void throw_main_exception(void);
+void throw_main_exception_exit(void);
-void throw_main_exception();
-void throw_main_exception_exit();
+void throw_cacao_exception_exit(const char *exception,
+ const char *message, ...);
-void throw_cacao_exception_exit(const char *exception, const char *message, ...);
+void exceptions_throw_outofmemory_exit(void);
/* initialize new exceptions */
/* functions to generate compiler exceptions */
java_objectheader *new_classformaterror(classinfo *c, const char *message, ...);
+java_objectheader *new_classnotfoundexception(utf *name);
+java_objectheader *new_noclassdeffounderror(utf *name);
+java_objectheader *exceptions_new_nosuchmethoderror(classinfo *c,
+ utf *name, utf *desc);
java_objectheader *new_internalerror(const char *message, ...);
-java_objectheader *new_verifyerror(methodinfo *m, const char *message);
+java_objectheader *new_verifyerror(methodinfo *m, const char *message, ...);
java_objectheader *new_unsupportedclassversionerror(classinfo *c,
const char *message, ...);
-java_objectheader *new_arithmeticexception();
+java_objectheader *new_arithmeticexception(void);
java_objectheader *new_arrayindexoutofboundsexception(s4 index);
-java_objectheader *new_arraystoreexception();
-java_objectheader *new_classcastexception();
-java_objectheader *new_negativearraysizeexception();
-java_objectheader *new_nullpointerexception();
+java_objectheader *new_arraystoreexception(void);
+java_objectheader *new_classcastexception(void);
+java_objectheader *new_illegalargumentexception(void);
+java_objectheader *new_illegalmonitorstateexception(void);
+java_objectheader *new_negativearraysizeexception(void);
+java_objectheader *new_nullpointerexception(void);
+
+void classnotfoundexception_to_noclassdeffounderror(void);
+
+void exceptions_print_exception(java_objectheader *xptr);
#endif /* _EXCEPTIONS_H */