CACAO
rootset.h
Go to the documentation of this file.
1 /* src/mm/cacao-gc/rootset.h - GC header for root set management
2 
3  Copyright (C) 2006, 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 _ROOTSET_H
27 #define _ROOTSET_H
28 
29 typedef struct rootset_t rootset_t;
30 
31 #include "config.h"
32 #include "vm/types.hpp"
33 
34 #include "threads/thread.hpp"
35 
36 #include "vm/method.hpp"
37 
38 #include "vm/jit/replace.hpp"
39 
40 
41 /* Structures *****************************************************************/
42 
43 #define ROOTSET_DUMMY_THREAD ((threadobject *) (ptrint) -1)
44 
45 #define ROOTSET_INITIAL_CAPACITY 16
46 
47 /* rootset is passed as array of pointers, which point to the location of
48  the reference */
49 
50 typedef struct rootset_entry_t {
51  java_object_t **ref; /* a pointer to the actual reference */
52  bool marks; /* indicates if a reference marks */
53 #if !defined(NDEBUG)
55 #endif
57 
58 
59 struct rootset_t {
60  rootset_t *next; /* link to the next chain element */
61  threadobject *thread; /* thread this rootset belongs to */
62  s4 capacity; /* the current capacity of this rs */
63  s4 refcount; /* number of references */
64  rootset_entry_t refs[ROOTSET_INITIAL_CAPACITY]; /* list of references */
65 };
66 
67 
68 /* Prototypes *****************************************************************/
69 
70 /*
71 rootset_t *rootset_create(void);
72 void rootset_from_globals(rootset_t *rs);
73 void rootset_from_thread(threadobject *thread, rootset_t *rs);
74 */
77 
78 #if !defined(NDEBUG)
79 void rootset_print(rootset_t *rs);
80 #endif
81 
82 
83 #endif /* _ROOTSET_H */
84 
85 /*
86  * These are local overrides for various environment variables in Emacs.
87  * Please do not remove this and leave it at the end of the file, where
88  * Emacs will automagically detect them.
89  * ---------------------------------------------------------------------
90  * Local variables:
91  * mode: c
92  * indent-tabs-mode: t
93  * c-basic-offset: 4
94  * tab-width: 4
95  * End:
96  * vim:noexpandtab:sw=4:ts=4:
97  */
#define ROOTSET_INITIAL_CAPACITY
Definition: rootset.h:45
rootset_t * next
Definition: rootset.h:60
rootset_entry_t refs[ROOTSET_INITIAL_CAPACITY]
Definition: rootset.h:64
struct rootset_entry_t rootset_entry_t
Definition: rootset.h:50
java_object_t ** ref
Definition: rootset.h:51
threadobject * thread
Definition: rootset.h:61
int32_t s4
Definition: types.hpp:45
void rootset_print(rootset_t *rs)
Definition: rootset.c:403
void rootset_writeback(rootset_t *rs)
Definition: rootset.c:366
s4 refcount
Definition: rootset.h:63
s4 reftype
Definition: rootset.h:54
s4 capacity
Definition: rootset.h:62
rootset_t * rootset_readout()
Definition: rootset.c:330
bool marks
Definition: rootset.h:52