1 /* src/vm/loader.h - class loader 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: Reinhard Grafl
29 $Id: loader.h 3936 2005-12-10 23:58:29Z twisti $
42 /* forward typedefs ***********************************************************/
44 typedef struct classbuffer classbuffer;
48 #include "vm/descriptor.h"
49 #include "vm/global.h"
50 #include "vm/references.h"
51 #include "vm/method.h"
55 /* constant pool entries *******************************************************
57 All constant pool entries need a data structure which contain the entrys
58 value. In some cases this structure exist already, in the remaining cases
59 this structure must be generated:
61 kind structure generated?
62 ----------------------------------------------------------------------
63 CONSTANT_Class classinfo no XXX this will change
64 CONSTANT_Fieldref constant_FMIref yes
65 CONSTANT_Methodref constant_FMIref yes
66 CONSTANT_InterfaceMethodref constant_FMIref yes
67 CONSTANT_String unicode no
68 CONSTANT_Integer constant_integer yes
69 CONSTANT_Float constant_float yes
70 CONSTANT_Long constant_long yes
71 CONSTANT_Double constant_double yes
72 CONSTANT_NameAndType constant_nameandtype yes
73 CONSTANT_Utf8 unicode no
76 *******************************************************************************/
78 typedef struct { /* Integer */
83 typedef struct { /* Float */
88 typedef struct { /* Long */
93 typedef struct { /* Double */
98 typedef struct { /* NameAndType (Field or Method) */
99 utf *name; /* field/method name */
100 utf *descriptor; /* field/method type descriptor string */
101 } constant_nameandtype;
104 /* classbuffer ****************************************************************/
107 classinfo *class; /* pointer to classinfo structure */
108 u1 *data; /* pointer to byte code */
109 s4 size; /* size of the byte code */
110 u1 *pos; /* current read position */
111 char *path; /* path to file (for debugging) */
115 /* export variables ***********************************************************/
117 #if defined(USE_THREADS)
118 extern int blockInts;
122 /* function prototypes ********************************************************/
124 /* initialize loader, load important systemclasses */
125 bool loader_init(u1 *stackbottom);
127 void loader_load_all_classes(void);
130 void loader_close(void);
132 /* class loading functions */
133 classinfo *load_class_from_sysloader(utf *name);
134 classinfo *load_class_from_classloader(utf *name, java_objectheader *cl);
135 classinfo *load_class_bootstrap(utf *name);
137 /* (don't use the following directly) */
138 classinfo *load_class_from_classbuffer(classbuffer *cb);
139 classinfo *load_newly_created_array(classinfo *c,java_objectheader *loader);
141 /* return the primitive class inidicated by the given signature character */
142 classinfo *class_primitive_from_sig(char sig);
145 void fprintflags(FILE *fp, u2 f);
146 void printflags(u2 f);
148 #endif /* _LOADER_H */
151 * These are local overrides for various environment variables in Emacs.
152 * Please do not remove this and leave it at the end of the file, where
153 * Emacs will automagically detect them.
154 * ---------------------------------------------------------------------
157 * indent-tabs-mode: t