1 /* mm/cacao-gc/rootset.h - GC header for root set management
3 Copyright (C) 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
33 typedef struct rootset_t rootset_t;
38 #if defined(ENABLE_THREADS)
39 # include "threads/native/threads.h"
41 # include "threads/none/threads.h"
44 #include "vm/jit/replace.h"
45 #include "vmcore/method.h"
48 /* Structures *****************************************************************/
50 #define ROOTSET_DUMMY_THREAD ((threadobject *) (ptrint) -1)
51 #define RS_REFS 512 /* TODO: you see why we need to rethink this!!! */
53 #define REFTYPE_THREADOBJECT 1
54 #define REFTYPE_CLASSLOADER 2
55 #define REFTYPE_GLOBALREF 3
56 #define REFTYPE_FINALIZER 4
57 #define REFTYPE_LOCALREF 5
58 #define REFTYPE_STACK 6
59 #define REFTYPE_CLASSREF 7
61 /* rootset is passed as array of pointers, which point to the location of
65 rootset_t *next; /* link to the next chain element */
66 threadobject *thread; /* thread this rootset belongs to */
67 sourcestate_t *ss; /* sourcestate of the thread */
68 executionstate_t *es; /* executionstate of the thread */
69 s4 refcount; /* number of references */
70 java_objectheader **refs[RS_REFS]; /* list of references */
71 bool ref_marks[RS_REFS]; /* indicates if a reference marks */
78 /* Prototypes *****************************************************************/
81 rootset_t *rootset_create(void);
82 void rootset_from_globals(rootset_t *rs);
83 void rootset_from_thread(threadobject *thread, rootset_t *rs);
85 rootset_t *rootset_readout();
86 void rootset_writeback(rootset_t *rs);
89 void rootset_print(rootset_t *rs);
93 #endif /* _ROOTSET_H */
96 * These are local overrides for various environment variables in Emacs.
97 * Please do not remove this and leave it at the end of the file, where
98 * Emacs will automagically detect them.
99 * ---------------------------------------------------------------------
102 * indent-tabs-mode: t
106 * vim:noexpandtab:sw=4:ts=4: