/* src/vm/classcache.h - loaded class cache and loading constraints
- Copyright (C) 1996-2005 R. Grafl, A. Krall, C. Kruegel, C. Oates,
- R. Obermaisser, M. Platter, M. Probst, S. Ring, E. Steiner,
- C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich, J. Wenninger,
- Institut f. Computersprachen - TU Wien
+ Copyright (C) 1996-2005, 2006 R. Grafl, A. Krall, C. Kruegel,
+ C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
+ E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
+ J. Wenninger, Institut f. Computersprachen - TU Wien
This file is part of CACAO.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
- Contact: cacao@complang.tuwien.ac.at
+ Contact: cacao@cacaojvm.org
Authors: Edwin Steiner
- Changes:
+ Changes: Christian Thalinger
- $Id: classcache.h 3808 2005-11-26 22:28:43Z edwin $
+ $Id: classcache.h 5192 2006-07-31 14:21:15Z twisti $
*/
#ifndef _CLASSCACHE_H
#define _CLASSCACHE_H
+#include "config.h"
+#include "vm/types.h"
+
#include <stdio.h> /* for FILE */
+#if defined(ENABLE_JVMTI)
+# include "native/jni.h"
+#endif
+
+#include "vm/hashtable.h"
#include "vm/references.h"
-#include "vm/tables.h"
/* forward declarations *******************************************************/
/* global variables ***********************************************************/
-extern hashtable classcache_hash;
+extern hashtable hashtable_classcache;
-/* structs ********************************************************************/
+/* structs ********************************************************************/
/*----------------------------------------------------------------------------*/
/* The Loaded Class Cache */
/* class name to this class object in the future */
/* */
/* The classcache_class_entry:s approximate the equivalence classes created */
-/* by the loading constraints and (XXX?) the equivalence of loaded classes. */
+/* by the loading constraints and the equivalence of loaded classes. */
/* */
/* When a loading constraint (loaderA,loaderB,NAME) is added, then the */
/* classcache_class_entry:s for NAME containing loaderA and loaderB resp. */
classcache_loader_entry *next; /* next loader entry in the list */
};
+
/* function prototypes ********************************************************/
/* initialize the loaded class cache */
bool classcache_init(void);
-void classcache_free();
+void classcache_free(void);
classinfo * classcache_lookup(classloader *initloader,utf *classname);
classinfo * classcache_lookup_defined(classloader *defloader,utf *classname);
classinfo * classcache_store(classloader *initloader,classinfo *cls,bool mayfree);
classinfo * classcache_store_defined(classinfo *cls);
+#if defined(ENABLE_VERIFIER)
bool classcache_add_constraint(classloader *a,classloader *b,utf *classname);
+bool classcache_add_constraints_for_params(classloader *a,classloader *b,
+ methodinfo *m);
+#endif
+
+s4 classcache_get_loaded_class_count(void);
+
+#if defined(ENABLE_JVMTI)
+void classcache_get_loaded_classes(s4 *class_count_ptr,
+ classinfo ***classes_ptr);
+#endif
-void classcache_debug_dump(FILE *file);
+#ifndef NDEBUG
+void classcache_debug_dump(FILE *file,utf *only);
+#endif
#endif /* _CLASSCACHE_H */