1 /* src/native/localref.h - Management of local reference tables
3 Copyright (C) 1996-2005, 2006, 2007 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
31 /* forward typedefs ***********************************************************/
33 typedef struct localref_table localref_table;
38 #include "vm/global.h"
41 /* localref_table **************************************************************
43 ATTENTION: keep this structure a multiple of 8-bytes!!! This is
44 essential for the native stub on 64-bit architectures.
46 *******************************************************************************/
48 #define LOCALREFTABLE_CAPACITY 16
50 struct localref_table {
51 s4 capacity; /* table size */
52 s4 used; /* currently used references */
53 s4 localframes; /* number of current frames */
54 s4 PADDING; /* 8-byte padding */
55 localref_table *prev; /* link to prev table (LocalFrame) */
56 java_object_t *refs[LOCALREFTABLE_CAPACITY]; /* references */
60 #if defined(ENABLE_THREADS)
61 #define LOCALREFTABLE (THREADOBJECT->_localref_table)
63 extern localref_table *_no_threads_localref_table;
65 #define LOCALREFTABLE (_no_threads_localref_table)
69 /* function prototypes ********************************************************/
71 bool localref_table_init(void);
72 void localref_table_add(localref_table *lrt);
73 void localref_table_remove();
74 bool localref_frame_push(int32_t capacity);
75 void localref_frame_pop_all(void);
78 void localref_dump(void);
82 #endif /* _LOCALREF_H */
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 * ---------------------------------------------------------------------