GNU header update.
[cacao.git] / src / vm / jit / inline / sets.h
1 /* jit/sets.h -
2
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
7
8    This file is part of CACAO.
9
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.
14
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.
19
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
23    02111-1307, USA.
24
25    Contact: cacao@complang.tuwien.ac.at
26
27    Authors: Carolyn Oates
28
29    $Id: sets.h 1735 2004-12-07 14:33:27Z twisti $
30
31 */
32
33
34 #ifndef _SET_H
35 #define _SET_H
36
37 typedef struct methSet      methSet;
38 typedef struct methSetNode  methSetNode;
39 typedef struct fldSet       fldSet;
40 typedef struct fldSetNode   fldSetNode;
41 typedef struct classSet     classSet;
42 typedef struct classSetNode classSetNode;
43
44
45 #include "types.h"
46 #include "vm/global.h"
47
48
49 /*------------ Method /Class Used Markers -------------------------------*/                 
50
51 /* Class flags =
52    USED all methods and fields are available; 
53    PARTUSED = specific methods (static, <init>, <clinit>, inherited def used, special) used, 
54               but not instanciated
55    NOTUSED = nothing used in class - not needed 
56 */
57
58 /* Method Flags =
59    USED = method definition is used
60    PARTUSED = method definition will be used if class instanciated
61    NOTUSED  = method defintion never used
62 */
63
64 #define USED      2
65 #define PARTUSED  1
66 #define MARKED    1
67 #define NOTUSED   0
68
69 #define MONO      0
70 #define MONO1     1 /* potential poly that is really mono */
71 #define POLY      2
72
73
74 /*------------------------------------------------------------*/
75 /*-- flds used by a method set fns */
76 /*------------------------------------------------------------*/
77 struct fldSet {
78         fldSetNode *head;
79         fldSetNode *tail;
80         fldSetNode *pos;
81         s4 length;
82 };
83
84
85 struct fldSetNode {
86         fieldinfo *fldRef;
87         fldSetNode *nextfldRef;
88         bool writePUT;
89         bool readGET;
90         classSetNode *lastptrPUT; 
91         classSetNode *lastptrGET; 
92         s2 index;
93 };
94
95
96 fldSetNode *inFldSet (fldSetNode *, fieldinfo *);
97 fldSetNode *addFldRef(fldSetNode *, fieldinfo *);
98 fldSet *add2FldSet(fldSet *, fieldinfo *, bool, bool);
99 fldSet *createFldSet();
100 int printFldSet(fldSetNode *);
101 int printFieldSet(fldSet *);
102
103
104 /*------------------------------------------------------------*/
105 /*-- methodinfo call set fns */
106 /*------------------------------------------------------------*/
107 struct methSet {
108         methSetNode *head;
109         methSetNode *tail;
110         methSetNode *pos;
111         s4 length;
112 };
113
114
115 struct methSetNode {
116         methodinfo   *methRef;
117         methSetNode  *nextmethRef;
118         classSetNode *lastptrIntoClassSet2;
119         s2            index;
120         s4            monoPoly;
121 };
122
123
124 int inMethSet (methSetNode *, methodinfo *);
125 methSetNode *addMethRef(methSetNode *, methodinfo *);
126 methSet *add2MethSet(methSet    *, methodinfo *);
127 methSet *createMethSet();
128 int printMethSet   (methSetNode *);
129 int printMethodSet (methSet *);
130
131
132 /*------------------------------------------------------------*/
133 /*-- classinfo XTA set fns  */
134 /*------------------------------------------------------------*/
135
136 struct classSet {
137         classSetNode *head;
138         classSetNode *tail;
139         classSetNode *pos;
140         s4 length;
141 };
142
143
144 struct classSetNode {
145         classinfo *classType;
146         classSetNode *nextClass;
147         s2 index;
148 };
149
150
151 int inSet(classSetNode *, classinfo *);
152 classSetNode *addElement(classSetNode *,  classinfo *);
153 classSet *add2ClassSet(classSet *,  classinfo *);
154 classSet *createClassSet();
155 int inRange(classSetNode *, classinfo *);
156 classSetNode *addClassCone(classSetNode *,  classinfo *);
157 classSetNode *intersectSubtypesWithSet(classinfo *, classSetNode *); 
158 int sizeOfSet(classSetNode *s);
159 int setSize(classSetNode *);
160 int printSet(classSetNode *);
161 int printClassSet(classSet *);
162
163 #endif /* _SETS_H */
164
165
166 /*
167  * These are local overrides for various environment variables in Emacs.
168  * Please do not remove this and leave it at the end of the file, where
169  * Emacs will automagically detect them.
170  * ---------------------------------------------------------------------
171  * Local variables:
172  * mode: c
173  * indent-tabs-mode: t
174  * c-basic-offset: 4
175  * tab-width: 4
176  * End:
177  */