* src/vmcore/globals.cpp: New file.
[cacao.git] / src / vmcore / globals.hpp
1 /* src/vmcore/globals.hpp - global variables
2
3    Copyright (C) 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 _GLOBALS_HPP
27 #define _GLOBALS_HPP
28
29 #include "config.h"
30
31 #include <stdint.h>
32
33 #include "vmcore/class.h"
34
35
36 // FIXME For now we export them a C symbols.
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 // Classes.
42
43 /* Important system classes. */
44
45 extern classinfo *class_java_lang_Object;
46 extern classinfo *class_java_lang_Class;
47 extern classinfo *class_java_lang_ClassLoader;
48 extern classinfo *class_java_lang_Cloneable;
49 extern classinfo *class_java_lang_SecurityManager;
50 extern classinfo *class_java_lang_String;
51 extern classinfo *class_java_lang_System;
52 extern classinfo *class_java_lang_Thread;
53 extern classinfo *class_java_lang_ThreadGroup;
54 extern classinfo *class_java_lang_Throwable;
55 extern classinfo *class_java_io_Serializable;
56
57 /* Important system exceptions. */
58
59 extern classinfo *class_java_lang_Exception;
60 extern classinfo *class_java_lang_ClassNotFoundException;
61 extern classinfo *class_java_lang_RuntimeException;
62
63 #if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
64 extern classinfo *class_java_lang_VMSystem;
65 extern classinfo *class_java_lang_VMThread;
66 extern classinfo *class_java_lang_VMThrowable;
67 #endif
68
69 #if defined(WITH_JAVA_RUNTIME_LIBRARY_OPENJDK)
70 extern classinfo *class_sun_reflect_MagicAccessorImpl;
71 #endif
72
73 #if defined(ENABLE_JAVASE)
74 extern classinfo *class_java_lang_Void;
75 #endif
76
77 extern classinfo *class_java_lang_Boolean;
78 extern classinfo *class_java_lang_Byte;
79 extern classinfo *class_java_lang_Character;
80 extern classinfo *class_java_lang_Short;
81 extern classinfo *class_java_lang_Integer;
82 extern classinfo *class_java_lang_Long;
83 extern classinfo *class_java_lang_Float;
84 extern classinfo *class_java_lang_Double;
85
86 /* some classes which may be used more often */
87
88 #if defined(ENABLE_JAVASE)
89 extern classinfo *class_java_lang_StackTraceElement;
90 extern classinfo *class_java_lang_reflect_Constructor;
91 extern classinfo *class_java_lang_reflect_Field;
92 extern classinfo *class_java_lang_reflect_Method;
93 extern classinfo *class_java_security_PrivilegedAction;
94 extern classinfo *class_java_util_Vector;
95 extern classinfo *class_java_util_HashMap;
96
97 # if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
98 extern classinfo *class_java_lang_reflect_VMConstructor;
99 extern classinfo *class_java_lang_reflect_VMField;
100 extern classinfo *class_java_lang_reflect_VMMethod;
101 # endif
102
103 extern classinfo *arrayclass_java_lang_Object;
104
105 # if defined(ENABLE_ANNOTATIONS)
106 extern classinfo *class_sun_reflect_ConstantPool;
107 #  if defined(WITH_JAVA_RUNTIME_LIBRARY_GNU_CLASSPATH)
108 extern classinfo *class_sun_reflect_annotation_AnnotationParser;
109 #  endif
110 # endif
111 #endif
112
113
114 /* pseudo classes for the type checker ****************************************/
115
116 /*
117  * pseudo_class_Arraystub
118  *     (extends Object implements Cloneable, java.io.Serializable)
119  *
120  *     If two arrays of incompatible component types are merged,
121  *     the resulting reference has no accessible components.
122  *     The result does, however, implement the interfaces Cloneable
123  *     and java.io.Serializable. This pseudo class is used internally
124  *     to represent such results. (They are *not* considered arrays!)
125  *
126  * pseudo_class_Null
127  *
128  *     This pseudo class is used internally to represent the
129  *     null type.
130  *
131  * pseudo_class_New
132  *
133  *     This pseudo class is used internally to represent the
134  *     the 'uninitialized object' type.
135  */
136
137 extern classinfo *pseudo_class_Arraystub;
138 extern classinfo *pseudo_class_Null;
139 extern classinfo *pseudo_class_New;
140
141 #ifdef __cplusplus
142 }
143 #endif
144
145 #endif // _CLASS_HPP
146
147
148 /*
149  * These are local overrides for various environment variables in Emacs.
150  * Please do not remove this and leave it at the end of the file, where
151  * Emacs will automagically detect them.
152  * ---------------------------------------------------------------------
153  * Local variables:
154  * mode: c++
155  * indent-tabs-mode: t
156  * c-basic-offset: 4
157  * tab-width: 4
158  * End:
159  */