Initial import of s390 codegen, codebase is copyed from x86_64.
[cacao.git] / src / vm / classcache.h
index ec0dcc3f5da0298c17a5a1566bbd435dcb4ed480..9457aa71bf8c3bbb0a7aabbe759e9e631ced5c6b 100644 (file)
@@ -26,9 +26,9 @@
 
    Authors: Edwin Steiner
 
-   Changes:
+   Changes: Christian Thalinger
 
-   $Id: classcache.h 4957 2006-05-26 11:48:10Z edwin $
+   $Id: classcache.h 6209 2006-12-16 21:14:23Z edwin $
 
 */
 
 
 #include <stdio.h>  /* for FILE */
 
+#if defined(ENABLE_JVMTI)
+# include "native/jni.h"
+#endif
+
 #include "vm/hashtable.h"
 #include "vm/references.h"
 
@@ -57,17 +61,6 @@ typedef java_objectheader classloader;
 
 extern hashtable hashtable_classcache;
 
-#if defined(ENABLE_JVMTI)
-#if defined(ENABLE_THREADS)
-# define CLASSCACHE_LOCK()      builtin_monitorenter(lock_hashtable_classcache)
-# define CLASSCACHE_UNLOCK()    builtin_monitorexit(lock_hashtable_classcache)
-#else
-# define CLASSCACHE_LOCK()
-# define CLASSCACHE_UNLOCK()
-#endif
-
-extern java_objectheader *lock_hashtable_classcache;
-#endif 
 
 /* structs ********************************************************************/
 
@@ -130,6 +123,11 @@ struct classcache_loader_entry
 };
 
 
+/* callback function type for  classcache_foreach_loaded_class */
+
+typedef void (*classcache_foreach_functionptr_t)(classinfo *, void *);
+
+
 /* function prototypes ********************************************************/
 
 /* initialize the loaded class cache */
@@ -150,6 +148,16 @@ 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,utf *only);
 #endif