1 /* src/vm/loader.h - class loader header
3 Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, 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., 51 Franklin Street, Fifth Floor, Boston, MA
25 Contact: cacao@cacaojvm.org
27 Authors: Reinhard Grafl
29 Changes: Christian Thalinger
31 $Id: loader.h 4357 2006-01-22 23:33:38Z twisti $
45 /* forward typedefs ***********************************************************/
47 typedef struct classbuffer classbuffer;
51 #include "vm/descriptor.h"
52 #include "vm/global.h"
53 #include "vm/references.h"
54 #include "vm/method.h"
58 /* constant pool entries *******************************************************
60 All constant pool entries need a data structure which contain the entrys
61 value. In some cases this structure exist already, in the remaining cases
62 this structure must be generated:
64 kind structure generated?
65 ----------------------------------------------------------------------
66 CONSTANT_Class classinfo no XXX this will change
67 CONSTANT_Fieldref constant_FMIref yes
68 CONSTANT_Methodref constant_FMIref yes
69 CONSTANT_InterfaceMethodref constant_FMIref yes
70 CONSTANT_String unicode no
71 CONSTANT_Integer constant_integer yes
72 CONSTANT_Float constant_float yes
73 CONSTANT_Long constant_long yes
74 CONSTANT_Double constant_double yes
75 CONSTANT_NameAndType constant_nameandtype yes
76 CONSTANT_Utf8 unicode no
79 *******************************************************************************/
81 typedef struct { /* Integer */
86 typedef struct { /* Float */
91 typedef struct { /* Long */
96 typedef struct { /* Double */
101 typedef struct { /* NameAndType (Field or Method) */
102 utf *name; /* field/method name */
103 utf *descriptor; /* field/method type descriptor string */
104 } constant_nameandtype;
107 /* classbuffer ****************************************************************/
110 classinfo *class; /* pointer to classinfo structure */
111 u1 *data; /* pointer to byte code */
112 s4 size; /* size of the byte code */
113 u1 *pos; /* current read position */
114 char *path; /* path to file (for debugging) */
118 /* export variables ***********************************************************/
120 #if defined(USE_THREADS)
121 extern int blockInts;
125 /* function prototypes ********************************************************/
127 /* initialize loader, load important systemclasses */
128 bool loader_init(u1 *stackbottom);
130 void loader_load_all_classes(void);
133 void loader_close(void);
135 /* class loading functions */
136 classinfo *load_class_from_sysloader(utf *name);
137 classinfo *load_class_from_classloader(utf *name, java_objectheader *cl);
138 classinfo *load_class_bootstrap(utf *name);
140 /* (don't use the following directly) */
141 classinfo *load_class_from_classbuffer(classbuffer *cb);
142 classinfo *load_newly_created_array(classinfo *c,java_objectheader *loader);
144 #endif /* _LOADER_H */
147 * These are local overrides for various environment variables in Emacs.
148 * Please do not remove this and leave it at the end of the file, where
149 * Emacs will automagically detect them.
150 * ---------------------------------------------------------------------
153 * indent-tabs-mode: t