Initial import of s390 codegen, codebase is copyed from x86_64.
[cacao.git] / src / vm / classcache.h
index 04c5411a55a3f2ecc6080ddecced12699038a517..9457aa71bf8c3bbb0a7aabbe759e9e631ced5c6b 100644 (file)
@@ -1,9 +1,9 @@
 /* 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 3814 2005-11-28 18:51:26Z edwin $
+   $Id: classcache.h 6209 2006-12-16 21:14:23Z edwin $
 
 */
 
 #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 *******************************************************/
@@ -52,10 +59,10 @@ typedef java_objectheader classloader;
 
 /* global variables ***********************************************************/
 
-extern hashtable classcache_hash;
+extern hashtable hashtable_classcache;
 
-/* structs ********************************************************************/
 
+/* structs ********************************************************************/
 
 /*----------------------------------------------------------------------------*/
 /* The Loaded Class Cache                                                     */
@@ -79,7 +86,7 @@ extern hashtable classcache_hash;
 /*   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.     */
@@ -115,6 +122,12 @@ struct classcache_loader_entry
        classcache_loader_entry  *next;       /* next loader entry in the list    */
 };
 
+
+/* callback function type for  classcache_foreach_loaded_class */
+
+typedef void (*classcache_foreach_functionptr_t)(classinfo *, void *);
+
+
 /* function prototypes ********************************************************/
 
 /* initialize the loaded class cache */
@@ -129,10 +142,24 @@ bool classcache_store_unique(classinfo *cls);
 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);
+
+void classcache_foreach_loaded_class(classcache_foreach_functionptr_t func,
+                                                                        void *data);
+
+#if defined(ENABLE_JVMTI)
+void classcache_get_loaded_classes(s4 *class_count_ptr,
+                                                                  classinfo ***classes_ptr);
+#endif
 
 #ifndef NDEBUG
-void classcache_debug_dump(FILE *file);
+void classcache_debug_dump(FILE *file,utf *only);
 #endif
        
 #endif /* _CLASSCACHE_H */