X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fexceptions.h;h=cc9ff6bef110cfa22b2a7585c9049623edb02c5d;hb=da49fa899f1ba447e4ee376a87729e43fde8754c;hp=df6d65f4f718321aece9002aaaab2d0f033dcdac;hpb=ff9c3b1377183d2e74fe45dac0439f4c9725637d;p=cacao.git diff --git a/src/vm/exceptions.h b/src/vm/exceptions.h index df6d65f4f..cc9ff6bef 100644 --- a/src/vm/exceptions.h +++ b/src/vm/exceptions.h @@ -26,9 +26,9 @@ 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 $ */ @@ -36,6 +36,9 @@ #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" @@ -45,71 +48,18 @@ #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 ********************************************************/ @@ -120,13 +70,16 @@ bool exceptions_init(void); /* 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 */ @@ -151,17 +104,27 @@ java_objectheader *new_exception_int(const char *classname, s4 i); /* 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 */