Merged subtype and current trunk.
[cacao.git] / src / vm / linker.h
1 /* src/vm/linker.h - class linker header
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 _LINKER_H
27 #define _LINKER_H
28
29 /* forward typedefs ***********************************************************/
30
31 typedef struct arraydescriptor arraydescriptor;
32 typedef struct primitivetypeinfo primitivetypeinfo;
33
34
35 #include "config.h"
36 #include "vm/types.h"
37
38 #include "threads/mutex.hpp"
39
40 #include "vm/class.h"
41 #include "vm/references.h"
42 #include "vm/vftbl.hpp"
43
44
45 /* arraydescriptor *************************************************************
46
47    For every array class an arraydescriptor is allocated which
48    describes the array class. The arraydescriptor is referenced from
49    the vftbl of the array class.
50
51 *******************************************************************************/
52
53 struct arraydescriptor {
54         vftbl_t *componentvftbl; /* vftbl of the component type, NULL for primit. */
55         vftbl_t *elementvftbl;   /* vftbl of the element type, NULL for primitive */
56         s2       arraytype;      /* ARRAYTYPE_* constant                          */
57         s2       dimension;      /* dimension of the array (always >= 1)          */
58         s4       dataoffset;     /* offset of the array data from object pointer  */
59         s4       componentsize;  /* size of a component in bytes                  */
60         s2       elementtype;    /* ARRAYTYPE_* constant                          */
61 };
62
63
64 /* function prototypes ********************************************************/
65
66 #ifdef __cplusplus
67 extern "C" {
68 #endif
69
70 void       linker_preinit(void);
71 void       linker_init(void);
72 classinfo *link_class(classinfo *c);
73
74 #ifdef __cplusplus
75 }
76 #endif
77
78 #endif /* _LINKER_H */
79
80
81 /*
82  * These are local overrides for various environment variables in Emacs.
83  * Please do not remove this and leave it at the end of the file, where
84  * Emacs will automagically detect them.
85  * ---------------------------------------------------------------------
86  * Local variables:
87  * mode: c
88  * indent-tabs-mode: t
89  * c-basic-offset: 4
90  * tab-width: 4
91  * End:
92  */