* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / src / vm / exceptions.hpp
1 /* src/vm/exceptions.hpp - exception related functions prototypes
2
3    Copyright (C) 1996-2005, 2006, 2007, 2008
4    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
5
6    This file is part of CACAO.
7
8    This program is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License as
10    published by the Free Software Foundation; either version 2, or (at
11    your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301, USA.
22
23 */
24
25
26 #ifndef _EXCEPTIONS_HPP
27 #define _EXCEPTIONS_HPP
28
29 #include "config.h"
30 #include "vm/types.h"
31
32 #include "vm/global.h"
33 #include "vm/references.h"
34 #include "vm/method.hpp"
35
36
37 /* function prototypes ********************************************************/
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 java_handle_t *exceptions_get_exception(void);
44 void           exceptions_set_exception(java_handle_t *o);
45 void           exceptions_clear_exception(void);
46 java_handle_t *exceptions_get_and_clear_exception(void);
47
48
49 /* functions to generate compiler exceptions */
50
51 java_handle_t *exceptions_new_abstractmethoderror(void);
52 java_object_t *exceptions_asm_new_abstractmethoderror(u1 *sp, u1 *ra);
53 java_handle_t *exceptions_new_arraystoreexception(void);
54
55 void exceptions_throw_abstractmethoderror(void);
56 void exceptions_throw_classcircularityerror(classinfo *c);
57 void exceptions_throw_classformaterror(classinfo *c, const char *message, ...);
58 void exceptions_throw_classnotfoundexception(utf *name);
59 void exceptions_throw_noclassdeffounderror(utf *name);
60 void exceptions_throw_noclassdeffounderror_cause(java_handle_t *cause);
61 void exceptions_throw_noclassdeffounderror_wrong_name(classinfo *c, utf *name);
62 void exceptions_throw_linkageerror(const char *message, classinfo *c);
63 void exceptions_throw_nosuchfielderror(classinfo *c, utf *name);
64 void exceptions_throw_nosuchmethoderror(classinfo *c, utf *name, utf *desc);
65 void exceptions_throw_exceptionininitializererror(java_handle_t *cause);
66 void exceptions_throw_incompatibleclasschangeerror(classinfo *c,
67                                                                                                    const char *message);
68 void exceptions_throw_instantiationerror(classinfo *c);
69 void exceptions_throw_internalerror(const char *message, ...);
70 void exceptions_throw_outofmemoryerror(void);
71 void exceptions_throw_verifyerror(methodinfo *m, const char *message, ...);
72 void exceptions_throw_verifyerror_for_stack(methodinfo *m, int type);
73 void exceptions_throw_unsatisfiedlinkerror(utf *name);
74 void exceptions_throw_unsupportedclassversionerror(classinfo *c, u4 ma, u4 mi);
75
76 java_handle_t *exceptions_new_arithmeticexception(void);
77
78 java_handle_t *exceptions_new_arrayindexoutofboundsexception(s4 index);
79 void exceptions_throw_arrayindexoutofboundsexception(void);
80 void exceptions_throw_arraystoreexception(void);
81
82 java_handle_t *exceptions_new_classcastexception(java_handle_t *o);
83
84 void exceptions_throw_clonenotsupportedexception(void);
85 void exceptions_throw_illegalaccessexception(utf *message);
86 void exceptions_throw_illegalargumentexception(void);
87 void exceptions_throw_illegalmonitorstateexception(void);
88 void exceptions_throw_interruptedexception(void);
89 void exceptions_throw_instantiationexception(classinfo *c);
90 void exceptions_throw_invocationtargetexception(java_handle_t *cause);
91 void exceptions_throw_negativearraysizeexception(void);
92
93 java_handle_t *exceptions_new_nullpointerexception(void);
94 void exceptions_throw_nullpointerexception(void);
95 void exceptions_throw_privilegedactionexception(java_handle_t *cause);
96 void exceptions_throw_stringindexoutofboundsexception(void);
97
98 java_handle_t *exceptions_fillinstacktrace(void);
99
100 void exceptions_print_exception(java_handle_t *xptr);
101 void exceptions_print_current_exception(void);
102 void exceptions_print_stacktrace(void);
103
104 #ifdef __cplusplus
105 }
106 #endif
107
108 #endif // _EXCEPTIONS_HPP
109
110
111 /*
112  * These are local overrides for various environment variables in Emacs.
113  * Please do not remove this and leave it at the end of the file, where
114  * Emacs will automagically detect them.
115  * ---------------------------------------------------------------------
116  * Local variables:
117  * mode: c++
118  * indent-tabs-mode: t
119  * c-basic-offset: 4
120  * tab-width: 4
121  * End:
122  * vim:noexpandtab:sw=4:ts=4:
123  */