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)
52 #define ROOTSET_INITIAL_CAPACITY 16
54 #define REFTYPE_THREADOBJECT 1
55 #define REFTYPE_REGISTERED 1
56 #define REFTYPE_CLASSLOADER 2
57 #define REFTYPE_GLOBALREF 3
58 #define REFTYPE_FINALIZER 4
59 #define REFTYPE_LOCALREF 5
60 #define REFTYPE_STACK 6
61 #define REFTYPE_CLASSREF 7
63 /* rootset is passed as array of pointers, which point to the location of
66 typedef struct rootset_entry_t {
67 java_objectheader **ref; /* a pointer to the actual reference */
68 bool marks; /* indicates if a reference marks */
76 rootset_t *next; /* link to the next chain element */
77 threadobject *thread; /* thread this rootset belongs to */
78 sourcestate_t *ss; /* sourcestate of the thread */
79 executionstate_t *es; /* executionstate of the thread */
80 s4 capacity; /* the current capacity of this rs */
81 s4 refcount; /* number of references */
82 rootset_entry_t refs[ROOTSET_INITIAL_CAPACITY]; /* list of references */
86 /* Prototypes *****************************************************************/
89 rootset_t *rootset_create(void);
90 void rootset_from_globals(rootset_t *rs);
91 void rootset_from_thread(threadobject *thread, rootset_t *rs);
93 rootset_t *rootset_readout();
94 void rootset_writeback(rootset_t *rs);
97 void rootset_print(rootset_t *rs);
101 #endif /* _ROOTSET_H */
104 * These are local overrides for various environment variables in Emacs.
105 * Please do not remove this and leave it at the end of the file, where
106 * Emacs will automagically detect them.
107 * ---------------------------------------------------------------------
110 * indent-tabs-mode: t
114 * vim:noexpandtab:sw=4:ts=4: