* src/threads/posix/thread-posix.cpp: Eliminated some easy-to-fix or pointless compil...
[cacao.git] / src / vm / classcache.cpp
index 5458ec80bf42ff013475ebbec7c74032e228075d..bb167636ac90b29b96d01088b733689a29bb9e2d 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/classcache.cpp - loaded class cache and loading constraints
 
-   Copyright (C) 1996-2005, 2006, 2007, 2008
+   Copyright (C) 1996-2005, 2006, 2007, 2008, 2010
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
 
    This file is part of CACAO.
 
 #include "vm/types.h"
 
-#include "mm/memory.h"
+#include "mm/memory.hpp"
 
 #include "threads/lock.hpp"
 #include "threads/mutex.hpp"
 
 #include "toolbox/hashtable.h"
-#include "toolbox/logging.h"
+#include "toolbox/logging.hpp"
 
 #include "vm/classcache.hpp"
 #include "vm/exceptions.hpp"
 
 /* #define CLASSCACHE_VERBOSE */
 
-#if defined(__cplusplus)
-extern "C" {
-#endif
-
 /*============================================================================*/
 /* STATISTICS                                                                 */
 /*============================================================================*/
@@ -1342,7 +1338,7 @@ static s4 classcache_number_of_loaded_classes(void)
        classcache_name_entry  *en;
        classcache_class_entry *clsen;
        s4                      number;
-       s4                      i;
+       u4                      i;
 
        /* initialize class counter */
 
@@ -1392,66 +1388,6 @@ s4 classcache_get_loaded_class_count(void)
 }
 
 
-/* classcache_get_loaded_classes ***********************************************
-
-   Returns an array of all loaded classes as array.  The array is
-   allocaed on the Java heap.
-
-*******************************************************************************/
-
-#if defined(ENABLE_JVMTI)
-void classcache_get_loaded_classes(s4 *class_count_ptr,
-                                                                  classinfo ***classes_ptr)
-{
-       classinfo              **classes;
-       s4                       class_count;
-       classcache_name_entry   *en;
-       classcache_class_entry  *clsen;
-       s4                       i;
-       s4                       j;
-
-       CLASSCACHE_LOCK();
-
-       /* get the number of loaded classes and allocate the array */
-
-       class_count = classcache_number_of_loaded_classes();
-
-       classes = GCMNEW(classinfo*, class_count);
-
-       /* look in every slot of the hashtable */
-
-       for (i = 0, j = 0; i < hashtable_classcache.size; i++) {
-               /* iterate over hashlink */
-
-               for (en = hashtable_classcache.ptr[i]; en != NULL; en = en->hashlink) {
-                       /* filter pseudo classes $NEW$, $NULL$, $ARRAYSTUB$ out */
-
-                       if (en->name->text[0] == '$')
-                               continue;
-
-                       /* iterate over classes with same name */
-
-                       for (clsen = en->classes; clsen != NULL; clsen = clsen->next) {
-                               /* get only loaded classes */
-
-                               if (clsen->classobj != NULL) {
-                                       classes[j] = clsen->classobj;
-                                       j++;
-                               }
-                       }
-               }
-       }
-
-       /* pass the return values */
-
-       *class_count_ptr = class_count;
-       *classes_ptr     = classes;
-
-       CLASSCACHE_UNLOCK();
-}
-#endif /* defined(ENABLE_JVMTI) */
-
-
 /* classcache_foreach_loaded_class *********************************************
 
    Calls the given function for each loaded class.
@@ -1463,7 +1399,7 @@ void classcache_foreach_loaded_class(classcache_foreach_functionptr_t func,
 {
        classcache_name_entry   *en;
        classcache_class_entry  *clsen;
-       s4                       i;
+       u4                       i;
 
        CLASSCACHE_LOCK();
 
@@ -1574,10 +1510,6 @@ dump_it:
        CLASSCACHE_UNLOCK();
 }
 
-#if defined(__cplusplus)
-}
-#endif
-
 #endif /* NDEBUG */
 
 /*
@@ -1586,7 +1518,7 @@ dump_it:
  * Emacs will automagically detect them.
  * ---------------------------------------------------------------------
  * Local variables:
- * mode: c
+ * mode: c++
  * indent-tabs-mode: t
  * c-basic-offset: 4
  * tab-width: 4