X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fvm%2Fexceptions.h;h=297408c190a2e702cdbc8811503e7d1777d8b061;hb=63e534c82ac7b19cbed2ad99e856a05b1e46f2bb;hp=0955e0fbbb1513b82b51ffbd2092886e7c85b5ee;hpb=0027fc1b8da718158e909cfcadcc3b15d470fb46;p=cacao.git diff --git a/src/vm/exceptions.h b/src/vm/exceptions.h index 0955e0fbb..297408c19 100644 --- a/src/vm/exceptions.h +++ b/src/vm/exceptions.h @@ -1,9 +1,9 @@ /* src/vm/exceptions.h - exception related functions prototypes - 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 + Copyright (C) 1996-2005, 2006 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. @@ -19,16 +19,16 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA - 02111-1307, USA. + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. - Contact: cacao@complang.tuwien.ac.at + Contact: cacao@cacaojvm.org Authors: Christian Thalinger - Changes: + Changes: Edwin Steiner - $Id: exceptions.h 3459 2005-10-20 00:49:47Z edwin $ + $Id: exceptions.h 4921 2006-05-15 14:24:36Z twisti $ */ @@ -36,6 +36,10 @@ #ifndef _EXCEPTIONS_H #define _EXCEPTIONS_H +/* forward typedefs ***********************************************************/ + +typedef struct exceptionentry exceptionentry; + #include "config.h" #include "vm/types.h" @@ -47,24 +51,35 @@ #include "vm/method.h" -#if defined(USE_THREADS) && defined(NATIVE_THREADS) +#if defined(ENABLE_THREADS) #define exceptionptr builtin_get_exceptionptrptr() #else #define exceptionptr &_no_threads_exceptionptr #endif -#if !defined(USE_THREADS) || !defined(NATIVE_THREADS) +#if !defined(ENABLE_THREADS) extern java_objectheader *_no_threads_exceptionptr; #endif -/* global variables ***********************************************************/ +/* exceptionentry ************************************************************** + + Datastructure which represents an exception entry in the exception + table residing in the data segment. + +*******************************************************************************/ + +struct exceptionentry { + classref_or_classinfo catchtype; + u1 *handlerpc; + u1 *endpc; + u1 *startpc; +}; /* function prototypes ********************************************************/ /* load and link exceptions used in the system */ - bool exceptions_init(void); @@ -76,7 +91,10 @@ void throw_exception_exit(void); void throw_main_exception(void); void throw_main_exception_exit(void); -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 */ @@ -101,23 +119,49 @@ java_objectheader *new_exception_int(const char *classname, s4 i); /* functions to generate compiler exceptions */ java_objectheader *new_classformaterror(classinfo *c, const char *message, ...); +void exceptions_throw_classformaterror(classinfo *c, const char *message, ...); + java_objectheader *new_classnotfoundexception(utf *name); java_objectheader *new_noclassdeffounderror(utf *name); +java_objectheader *exceptions_new_linkageerror(const char *message,classinfo *c); +java_objectheader *exceptions_new_nosuchmethoderror(classinfo *c, + utf *name, utf *desc); +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, ...); java_objectheader *new_arithmeticexception(void); + java_objectheader *new_arrayindexoutofboundsexception(s4 index); +void exceptions_throw_arrayindexoutofboundsexception(void); + java_objectheader *new_arraystoreexception(void); java_objectheader *new_classcastexception(void); + java_objectheader *new_illegalargumentexception(void); +void exceptions_throw_illegalargumentexception(void); + +java_objectheader *new_illegalmonitorstateexception(void); + java_objectheader *new_negativearraysizeexception(void); +void exceptions_throw_negativearraysizeexception(void); + java_objectheader *new_nullpointerexception(void); +void exceptions_throw_nullpointerexception(void); + +java_objectheader *exceptions_new_stringindexoutofboundsexception(void); +void exceptions_throw_stringindexoutofboundsexception(void); void classnotfoundexception_to_noclassdeffounderror(void); +void exceptions_print_exception(java_objectheader *xptr); + #endif /* _EXCEPTIONS_H */ @@ -132,4 +176,5 @@ void classnotfoundexception_to_noclassdeffounderror(void); * c-basic-offset: 4 * tab-width: 4 * End: + * vim:noexpandtab:sw=4:ts=4: */