1 /* src/vm/class.h - class related functions header
3 Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
4 R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
5 C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
6 Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Christian Thalinger
31 $Id: class.h 2093 2005-03-27 15:16:57Z edwin $
39 #include "vm/tables.h"
43 /* global variables ***********************************************************/
45 extern hashtable class_hash; /* hashtable for classes */
47 extern list unlinkedclasses; /* this is only used for eager class loading */
50 /* frequently used classes ****************************************************/
52 /* important system classes */
54 extern classinfo *class_java_lang_Object;
55 extern classinfo *class_java_lang_Class;
56 extern classinfo *class_java_lang_ClassLoader;
57 extern classinfo *class_java_lang_Cloneable;
58 extern classinfo *class_java_lang_SecurityManager;
59 extern classinfo *class_java_lang_String;
60 extern classinfo *class_java_lang_System;
61 extern classinfo *class_java_io_Serializable;
64 /* system exception classes required in cacao */
66 extern classinfo *class_java_lang_Throwable;
67 extern classinfo *class_java_lang_VMThrowable;
68 extern classinfo *class_java_lang_Exception;
69 extern classinfo *class_java_lang_Error;
70 extern classinfo *class_java_lang_OutOfMemoryError;
73 extern classinfo *class_java_lang_Void;
74 extern classinfo *class_java_lang_Boolean;
75 extern classinfo *class_java_lang_Byte;
76 extern classinfo *class_java_lang_Character;
77 extern classinfo *class_java_lang_Short;
78 extern classinfo *class_java_lang_Integer;
79 extern classinfo *class_java_lang_Long;
80 extern classinfo *class_java_lang_Float;
81 extern classinfo *class_java_lang_Double;
84 /* some classes which may be used more often */
86 extern classinfo *class_java_util_Vector;
89 /* macros *********************************************************************/
91 /* initialize a constant_classref with referer `ref` and name `classname` */
92 #define CLASSREF_INIT(c,ref,classname) \
93 do { (c).pseudo_vftbl = CLASSREF_PSEUDO_VFTBL; \
94 (c).referer = (ref); \
95 (c).name = (classname); } while (0)
97 /* function prototypes ********************************************************/
99 void class_init_foo(void);
101 /* search for class and create it if not found */
102 classinfo *class_new(utf *u);
104 /* without locking (caller already holding lock*/
105 classinfo *class_new_intern(utf *u);
107 /* search for class in classtable */
108 classinfo *class_get(utf *u);
110 /* remove class from classtable */
111 bool class_remove(classinfo *c);
113 /* return an array class with the given component class */
114 classinfo *class_array_of(classinfo *component);
116 /* return an array class with the given dimension and element class */
117 classinfo *class_multiarray_of(s4 dim, classinfo *element);
119 /* return a classref for the given class name */
120 /* (does a linear search!) */
121 constant_classref *class_lookup_classref(classinfo *cls,utf *name);
123 /* return a classref for the given class name */
124 /* (does a linear search!) */
125 constant_classref *class_get_classref(classinfo *cls,utf *name);
127 /* return a classref for an array with the given dimension of with the */
128 /* given component type */
129 constant_classref *class_get_classref_multiarray_of(s4 dim,constant_classref *ref);
131 /* return a classref for the component type of the given array type */
132 constant_classref *class_get_classref_component_of(constant_classref *ref);
134 #endif /* _CLASS_H */
138 * These are local overrides for various environment variables in Emacs.
139 * Please do not remove this and leave it at the end of the file, where
140 * Emacs will automagically detect them.
141 * ---------------------------------------------------------------------
144 * indent-tabs-mode: t